[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: R_PPC_REL24 relocation __libc_start_main/__nptl_deallocate_tsd out of range

On Wed, Feb 16, 2011 at 10:29:39AM +0100, Stefano Bonifazi wrote:
> My binaries are someway special being compiled with -fPIC and linked
> with -pie (gcc -Wl,-pie) as I need full relocatable PIC executables.

You probably want to just use gcc -fPIE for compiling (although gcc
-fPIC is not incorrect) and gcc -pie for linking.  This may help or it
may not.

> When I compile without "-nostartfiles", having libgcc added to my
> binary I get the following error at runtime:
> > R_PPC_REL24 relocation [...] __libc_start_main' out of range

I don't know that I can tell you how to fix it, but here's what it
means.  The relocation is 24-bit; in other words, the absolute value for
the distance from any call to the item called must be less than 2^23
(one bit is the sign).  In this case, the distance is larger.

One thing that sometimes works on hppa with this kind of problem is to
use -ffunction-sections.  You might try it and see if it works for you.

brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature

Reply to: