How to control location of startup code?
Richard Earnshaw
rearnsha@arm.com
Wed Mar 31 14:35:00 GMT 2004
>
> >> Is there any way to control how the default startup code ends up in
> the output file/the virutal address it gets and/or what output
> section it's included in?
>
> I do it by putting it in a seperate segment. More specifically, I have
> my own "crt0.s" it contains the reset vector and other IRQ like things
> below is the relavent snippit in ARM assembly
>
>
> >> .section .vectors
[...]
> The *PROBLEM* with this is by default the '.vectors' segment is not
> tagged as loadable perhaps there is a way to do this in GAS, it was
> not obvious to me.
>
You need to set the section flags when you create the section, something
like:
.section .vectors, code, "ax"
which tells the assembler that the section contains code, has to be
_A_llocated at load time and is e_X_ecutable.
R.
------
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