The meaning of LMA and location counter in GNU ld

Ian Lance Taylor iant@google.com
Wed Jan 26 06:28:00 GMT 2011


ali hagigat <hagigatali@gmail.com> writes:

> 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?

In this specific example, yes, that's right.

Ian



More information about the Binutils mailing list