[parisc-linux] Program counter from sigcontext, constructors

Carlos O'Donell carlos@baldric.uwo.ca
Sat, 26 Apr 2003 17:24:42 -0400


> This is a bug in 3.0.4.  If you look at the assembler output for the
> testcase, you will see the following:
> 
> 	.section	.ctors,"aw"
> 	.long	my_start
> 
> This is incorrect.  The code should be:
> 
> 	.section	.ctors,"aw",@progbits
> 	.align	4
> 	.word	P%my_start
> 
> Using a plabel constructor causes $$dyncall to correctly load the
> pic register for the call to my_start.  This is necessary because
> the startup file crtbegin.o is not compiled as pic code and the
> code in __do_global_ctors_aux clobbers the pic register.

Good catch. I hadn't bothered looking at the .S!
Again the recommendation is going to be "Use a newer gcc" :)

c.