This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

question about ld and the 'AT' statement


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]