This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

relocate UNINITIALIZED sections

Hi,

I write earlier the post: http://e2e.ti.com/support/dsp/omap_applications_processors/f/447/t/85400.aspx but noone answered.

I made some prograss but I still have some problem with creating a BIN file I need.

The problem is that sections are placed in output file not in order they appear in a script file. The .stack is placed after .text2 and next .const and .cinit sections. This makes bigger BIN file.

I want to locate all the UNINITIALIZED sections at the end of memory map, but when I use HIGH directive then sections are as I want but program doesn't work.

When I place HIGH directive at .data or .bss section EDMA of IVA doesn't work right. When I place HIGH directive at .stack section program doesn't work at all.

How to locate UNINITIALIZED sections at the end of the memory map?

I don't want to make two memory parts of IRAM.

My linker script:


-c
-heap  0x2000
-stack 0x2000

 
MEMORY
{
 IRAM        : origin = 0x402006A0,  len = 0x0010000      
}
 
  
SECTIONS
{

    .text       : 0x402006A0
    .text2 : {main.obj(.text), cam.obj(.text), misc.obj(.text), ...,  IVA.obj(.text)} > IRAM align 32
    .cinit      >       IRAM
   
    .data       >       IRAM 
    .const      >       IRAM   
    .bss        >       IRAM
    .stack      >       IRAM 
    .switch     >       IRAM
    .far        >       IRAM
}

 

Best regards

 

 

  • Regarding the specific question in the previous post of how to locate _c_int00 at a specific address, you can use this syntax to get it exactly where you want it:

    SECTIONS
    {
    .text:_c_int00 : 0x200000

    - or -

    .text:boot : 0x200000 { rts64plus.lib<boot.obj>(.text) }
    }

    If I understand correctly, however, you really only need it to be aligned to a certain alignment; try:

    SECTIONS
    {
    .text:_c_int00 > PMEM, align(4096)
    }

    Yes, the linker does reorder the sections to try to pack them into memory more efficiently. If you want to force a certain order, you'll need to use a GROUP:

    SECTIONS
    {
    GROUP
    {
    .text
    .cinit
    .data
    .const
    .bss
    .stack
    .switch
    .far
    } > IRAM
    }

    tomrgb said:

    I want to locate all the UNINITIALIZED sections at the end of memory map, but when I use HIGH directive then sections are as I want but program doesn't work.

    When I place HIGH directive at .data or .bss section EDMA of IVA doesn't work right. When I place HIGH directive at .stack section program doesn't work at all.

    How to locate UNINITIALIZED sections at the end of the memory map?

    I'm sorry, I don't know of any way to instruct the linker to sort uninitialized sections after initialized sections, although this seems like a reasonable feature to request.

    Using HIGH should not affect the correctness of the program.  Can you be more specific about the problem you are seeing?  Does the linker give you an error message?  Does the linker honor the HIGH request?

     

  • Hi,

    This is exactly what I need. Earlier I tried:

        .text: { _c_int00 } : 0x40200000

    and

       .text: { rts64plus.lib<boot.obj>(.text) } : 0x40200000

    But it didn't work. Your syntax works great. Thanks

    I'm affraid I can't write anythink more about the HIGH directive. The linker didn't give any error or warnings messages. The MAP file looked ok - as I would expected with the HIGH directive, but the program didn't start at all or the EDMA hung during a data transfer.

    You wrote that sort uninitialized sections after initialized sections would be a reasonable feature. I agree. Also creating binary file with size of a sum of initialized sections by hex6x.exe would be a reasonable freature.

    Thanks for help

    Best regards