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] |
OK. Thanks to you both.[...]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.
vectors: ldr pc, Reset_Addr ldr pc, Undefined_Addr /* Undefined instructions */ ldr pc, SWI_Addr ldr pc, Prefetch_Addr /* Prefetch abort*/ ldr pc, Abort_Addr /* Data abort */ nop /* Reserved vector */ ldr pc, IRQ_Addr ldr pc, FIQ_Addr [ ... ]
resetHandler: [ initial system setup ] ldr pc, Start_Addr
.align 0 Reset_Addr: .word resetHandler [ ... ] Start_Addr: .word _start
------ 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] |