This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PowerPC w/ shared libgcc: "R_PPC_REL24 relocation... out of range"
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: "H . J . Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org
- Date: Fri, 16 Nov 2001 11:19:46 +1300
- Subject: Re: PowerPC w/ shared libgcc: "R_PPC_REL24 relocation... out of range"
- References: <3BF3A09A.7020809@waitaki.otago.ac.nz> <20011115084327.A10945@lucon.org>
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.