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]

reserving LMA space in linker script


In a GNU ld script I'd like to have something like the following:

    .text  : { *(.text ... ) } > ram
   
    . = ALIGN(4);
    _data_load = .
    . += SIZEOF(.data);

    ...

    .data  : AT(_data_load)  { *(.data ...) } > ram

However, ld doesn't allow getting the address or size of a section
before it is defined.  This does work in some other linkers though.

The reason I want to do this is to be able to restart the code on
an embedded system without having to download through the
debugger all over again.  This is just like loading the data from
ROM except that the VMA and LMA are both in RAM.

I can solve this by allocating a large enough space, but I don't
want to leave holes in memory.  Is there any other way to get
this sort of thing done?

Thanks,
Darin Johnson


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