PowerPC w/ shared libgcc: "R_PPC_REL24 relocation... out of range"

Bryce McKinlay bryce@waitaki.otago.ac.nz
Tue Nov 6 07:58:00 GMT 2001


H . J . Lu wrote:

>On Fri, Nov 16, 2001 at 12:01:46AM +1300, Bryce McKinlay wrote:
>
>>I'm getting the following error when I try to run something linked 
>>against shared libgcc with current GCC:
>>
>>$ ./a.out
>>./a.out: error while loading shared libraries: 
>>/home/bryce/gcc/lib/libgcc_s.so.1: R_PPC_REL24 relocation at 0x0ffd5ca4 
>>for symbol `_Jv_RegisterClasses' out of range
>>
>
>Could you please do
>
># readelf -a libgcc_s.so.1  | grep _Jv_RegisterClasses
>
>Something is wrong with your libgcc_s.so.1.
>

OK, it turns out that crtstuff was being built without -fPIC. The reason 
is that other targets define CRTSTUFF_T_CFLAGS_S to include "-fPIC", but 
in t-ppccomm we have:

# There is no need to add -fPIC here because crtstuff is multilibbed
# and so automatically gets -fPIC when needed.
CRTSTUFF_T_CFLAGS_S = -msdata=none

... but I disabled multilib.

FWIW, I understand the need to mulitlib libgcc on ppc-linux, but it 
sucks that libstdc++ and libgcj get multilibbed by default also. The 
builds take forever and waste disk space. I'd like to turn that off by 
default if possible.

And why not have -fPIC in CRTSTUFF_T_CFLAGS_S? It won't hurt if -fPIC is 
specified twice.

regards

Bryce.




More information about the Binutils mailing list