AnsweredAssumed Answered

elf2dyn error when creating a Dynamically Loaded Module (DLM)

Question asked by msCircal on Sep 25, 2015
Latest reply on Nov 27, 2015 by Kader.M

Platform: CCES 1.1.1.0

Blackfin: ADSP-BF706

 

I am trying to create a DLM as outlined in CrossCore System Run-Time documentation.

 

I was able to create a simple DLM that had one single simple DLM function. I was able to successfully create a DXE project to make use of this DLM, load it dynamically, and call the DLM function successfully.

 

I went on to create a more complex DLM, which incorporates a 3rd party .dlb library.

This library has been previously used in a regular DXE CCES project, and works fine.

 

With my new DLM, I am getting an error on elf2dyn, which I am not sure I full understand.

Compiling, linking work fine.

 

The elf2dyn console output is as follows:

'Creating Dynamic Loadable Module (DLM) file output (.dyn) ...'

 

"C:\Analog Devices\CrossCore Embedded Studio 1.1.1\elf2dyn" -r -e _xxx_Decoder DLMtest.dxe

elf2dyn: ed0054: Error: Relocation out of range: [0000000a in section 10 (.text)] -> [00000100 in section 4 (.data)]

 

Exporting: _xxx_Decoder

make[1]: [post-build] Error 1 (ignored)

 

In my LDF file, I have only created simple section definitions (.text, .data .bss)  See bottom of this message.

 

Not sure if I fully understand what the issue is. Not much info is on these forums with respect to DLMs and elf2dyn.

 

Any help is appreciated.

 

Thanks, Martin

 

 

 

= =====================================================================================

LDF file is as below ...

/*

** ADSP-BF706 linker description file

**

** Product      : CrossCore Embedded Studio 1.1.0.0

** Tool Version : 6.0.3.2

*/

 

 

ARCHITECTURE(ADSP-BF706)

 

 

/*

** Define a linked objects list.

*/

$OBJECTS = $COMMAND_LINE_OBJECTS;

 

 

/*

** Define a linked library list.

*/

$LIBRARIES =

 

 

    libcc.dlb

   ,libio.dlb

   ,libc.dlb

   ,librt_fileio.dlb

   ,libdsp.dlb

   ,libetsi.dlb

   ,libssl.dlb

   ,libdrv.dlb

   ,libdyn.dlb

   ,libsmall.dlb

   ,libevent.dlb

   ,libprofile.dlb

   ,libosal_noos.dlb

   ;

 

 

/*

** List of all objects and libraries.

*/

$OBJS_LIBS = $OBJECTS, $LIBRARIES;

 

 

/*

** List of objects and libraries which prefer internal memory as

** specified by prefersMem attribute.

*/

$OBJS_LIBS_INTERNAL =

 

 

    $OBJS_LIBS{prefersMem("internal")};

 

 

/*

** List of objects and libraries which don't have a preference for

** external memory as specified by prefersMem attribute.

*/

$OBJS_LIBS_NOT_EXTERNAL = $OBJS_LIBS{!prefersMem("external")};                                  

 

 

MEMORY

{

    // The sizes here are arbitary and should be large enough to hold the inputs

    // sections they will contain.  Specific START and END are unimportant as these

    // addresses will be "abstracted" away by elf2dyn.

   

    MEM_TEXT { START(0x00000000) END (0x07FFFFFF) TYPE(RAM) WIDTH(8) } 

    MEM_DATA { START(0x08000000) END (0x0BFFFFFF) TYPE(RAM) WIDTH(8) } 

    MEM_BSZ  { START(0x0C000000) END (0x0FFFFFFF) TYPE(RAM) WIDTH(8) }

}

 

 

 

DYNAMIC p0

{

    OUTPUT( $COMMAND_LINE_OUTPUT_FILE )

 

 

    SECTIONS

    {

       

        // Note the presence of three, and only three, output sections.  They must

        // be called .text, .data, and .bsz.  .bsz must be a zero-fill section

        // (ZERO_INIT keyword)

       

        .text

        {

            INPUT_SECTION_ALIGN(4)

            INPUT_SECTIONS( $OBJECTS(program) $LIBRARIES(program))

           

        } >MEM_TEXT

       

        .data

        {

            INPUT_SECTION_ALIGN(4)

            INPUT_SECTIONS( $OBJECTS(data1 constdata voldata) $LIBRARIES(data1 constdata voldata))

           

            // Reserve 128K for DLM's own heap ... 3rd party DLB appears to require heap allocations.

            RESERVE(heaps_in_L2_sram, heaps_in_L2_sram_length = 131072, 4)

          ldf_heap_space = heaps_in_L2_sram;

          ldf_heap_end = (ldf_heap_space + (heaps_in_L2_sram_length - 4)) & 0xfffffffc;

          ldf_heap_length = ldf_heap_end - ldf_heap_space;

        

        } >MEM_DATA

 

 

 

        .bss ZERO_INIT

        {

            INPUT_SECTION_ALIGN(4)

            INPUT_SECTIONS( $OBJECTS(bsz) $LIBRARIES(bsz))

        } >MEM_BSZ

    }

}

Outcomes