The meaning of LMA and location counter in GNU ld

ali hagigat hagigatali@gmail.com
Wed Jan 26 05:45:00 GMT 2011


3.4.4 Assign alias names to memory regions
SECTIONS
{
     .text :
     {
         *(.text)
     } > REGION_TEXT
    .rodata :
    {
        *(.rodata)
        rodata_end = .;
    } > REGION_RODATA
    .data : AT (rodata_end)
    {
        data_start = .;
        *(.data)
     } > REGION_DATA
     data_size = SIZEOF(.data);
     data_load_start = LOADADDR(.data);
     .bss :
     {
         *(.bss)
     } > REGION_BSS
}
---------------------------------------------------------------
I have copied part of the manual for ld.
In front of .data, there is an AT command: AT (rodata_end)
Is it necessary to write it? If I do not write it, any ways the load
address for .data section will be after .rodata regardless of
REGION_RODATA. Is that right?



More information about the Binutils mailing list