This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
-pie broken on ppc32
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 19 Feb 2004 19:28:25 +0100
- Subject: -pie broken on ppc32
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
With current GCC, any -pie binary will crash.
The problem popped up after I've commited the change to avoid using
both GOT and PLT slots for _Jv_RegisterClasses.
Now all PIEs have
0001030c ffffff01 R_PPC_ADDR32 bad symbol index: 00ffffff
relocation.
Stripped down testcase is:
.data
.4byte _Jv_RegisterClasses
.weak _Jv_RegisterClasses
(or .8byte). gcc -nostdlib -o test test.s will not create any dynamic
relocation here, gcc -nostdlib -shared -o test.so test.s will create
dynamic relocation against undef weak _Jv_RegisterClasses.
But with -pie, h->dynindx is -1 (this part of ld wants to handle it
like normal executable) but then as !SYMBOL_REFERENCES_LOCAL (info, h)
relocate section wants to create a dynamic relocation for it
(in ppc32 or ppc64 case creates relocation with symbol -1,
on e.g. amd64 it creates a bogus RELATIVE relocation).
Note that gcc -pie -o test test.c -lgcj works (i.e. when _Jv_RegisterClasses
is defined in one of the dependencies, then a dynamic relocation is
created in all cases).
Should ld in this case (on all arches) just skip the dynamic relocation
and store 0?
Jakub