This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-pie broken on ppc32


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]