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

See the CrossGCC FAQ for lots more information.


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

Re: arm-elf : initializing variables


Arnaud:

Arnaud ZANETTI wrote:

This work fine, but I cannot find out how to have my initialized variables initialized. I used a fromelf utility that just convert the .text section to pure binary code (the only thing my loader understands), but, that way, I cannot keep the initial values found in the ELF executable.


See the linker's AT directive. Generally speaking, you load your initializers into readonly memory using AT, then use a memcpy() or equivalent in your startup code to move those values to their proper places in RAM.


On other tool chains, I used a special feature of both the compiler and linker to have those initial values put in a special RO section, the variables to be initialized put first in link order, and I simply have to copy the former into the latter at the beginning of the code.


Basically the same concept here, although with GNU it is more do-it-yourself.



b.g. -- Bill Gatliff GNU-based embedded development, training and consulting services. bgat@billgatliff.com



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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