This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
PIC and arm/linux-crt0.S
- From: "Shaun Jackman" <sjackman at gmail dot com>
- To: newlib at sources dot redhat dot com
- Date: Mon, 26 Jun 2006 09:19:08 -0600
- Subject: PIC and arm/linux-crt0.S
- Reply-to: "Shaun Jackman" <sjackman at gmail dot com>
The manner in which arm/linux-crt0.S writes to environ is not
compatible with PIC. So, I can either...
* patch linux-crt0.S and write the PIC store operation in assembler
(I'm more inclined to let the compiler do this for me)
* have _start call _main instead of main and do the write there
* and add _main to linux-syscalls1.c
* or create a new linux-crt1.c to hold _main.
How is this matter usually handled?
Cheers!
Shaun
n.b. that the offending instruction is...
ldr r3, =environ
... which causes a R_ARM_ABS32 relocation in the .text section. Most unkind.