question about ld and the 'AT' statement
heinricg@esiee.fr
heinricg@esiee.fr
Mon Mar 15 09:26:00 GMT 2004
Hi all,
I am developing an application for an embedded target and I need to
place my initialised data in ROM. Therefore, I have a script that
looks like:
OUTPUT_FORMAT(elf32-littlearm)
MEMORY
{
rom : ORIGIN = 0x10000, LENGTH = 0x28000
ram : ORIGIN = 0xD0000, LENGTH = 0x1A00
}
SECTIONS
{
.text :
{
__text_start = .; *(.text) *(.strings) __text_end = .;
} > rom
.init : AT (__text_end)
{
__data_start = .; *(.data) __data_end = .;
} > ram
.bss ALIGN (0x4) :
{ [...] }
[...]
}
when I use the "objdump -D" command on my object file, I can see that
my initialised data appear at addresses from 0xd0018 (i.e. in RAM). I
would have thought that they would be located after the _text segment,
unless objddump displays the relocation addresses rather than the load
addresses.
Is that normal or I am missing something?
Thanks,
Greg.
More information about the Binutils
mailing list