In order to understand what function the AT() keyword has in a linker
script, I write the following hello.s program, and a linker script
named ldscript. My assumption is that the .text section will be loaded
at "physical" address 0x40000, and .data section will be loaded right
after .text section, so I should be able to copy the string in .data
section to the .bss section. but after running make, and using gdb to
execute the program until the break point and watch the contents at
virtual address 0x30000 (.bss section), I can't find the string !
Query, 1. the address that the AT keyword specifies to load is physical
address ?
2. I can't see the string in .bss section ,that's because the
loader ignored the AT() keyword's request ? ( I use Red
Hat
Linux 7.1 on i586 )
The GNU ld manual says " the AT keyword specifies the load address of
the section ", but it also says " you can force the output section to
be loaded at a specified address by specifying start immediately
following the section name ". ( the syntax of a section definition is
like this : SECTIONS{
secname start : AT(ldadr)
{ contents }
...
} )
(
http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_chapter/ld_3.html#SEC21)
Query, 3. what's the difference between these two statements ? In other
words, what's the difference between the two "load addresses" ?
Thanks.