PIC and arm/linux-crt0.S

Shaun Jackman sjackman@gmail.com
Mon Jun 26 16:15:00 GMT 2006


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.



More information about the Newlib mailing list