what does AT do in a linker scripts ?

Erik Christiansen dvalin@internode.on.net
Wed Jul 13 08:49:00 GMT 2016


On 13.07.16 16:16, Yubin Ruan wrote:
> Hi,
> I am reading some C code and some linker scripts for `ld`.
> I find something really hard to understand:
> 
>     .text : AT(0x100000) {
>         *(.text .stub .text.* .gnu.linkonce.t.*)
>     }
> 
> I understand what the `.text` and the wild char * do, but what does
> the `AT` after the colon do ?
> Need help.

It specifies the LMA, i.e. the address at which the output section is to
be loaded, e.g. into ROM. (As opposed to the VMA, the address at which
the output section has been linked/located to run.)

> And also, why is there no man page describing the syntax of linker scripts ?

That is annoying, and has been for a very long time, but we need to use
the documentation provided:

# apt-get install binutils-doc
$ info ld

It's described in section: "3.6.8.2 Output Section LMA"

Erik



More information about the Binutils mailing list