arm-elf : initializing variables

Grant Edwards grante@visi.com
Tue Dec 16 02:11:00 GMT 2003


On Mon, Dec 15, 2003 at 01:02:38PM +0100, Arnaud ZANETTI wrote:

> 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.
>
> Is there such a feature I can use in arm-elf target?

Sure.  It works exactly the way you described.

> And how?

Edit the linker script to set the load address (LMA) of the
data section to be somewhere in "rom".  Or you can use objcopy
to modify the LMA of the data section after it's been linked

In your startup code, copy the data from the ROM address (LMA)
to the actual RAM address of the data section (VMA).

> Or Should I swicth to an other target that is more intended to
> generate plain binary executables?

Huh?  I don't think the target has anything to do with it.  The
linker works the same regardless of the target.

-- 
Grant Edwards
grante@visi.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



More information about the crossgcc mailing list