relocation R_X86_64_PC32 and shared libraries

H. J. Lu hjl@lucon.org
Wed Mar 2 17:13:00 GMT 2005


On Wed, Mar 02, 2005 at 11:45:23AM -0500, Matthew L Daniel wrote:
> I am running Fedora Core 3 (x86_64) with:
> gcc (GCC) 3.4.3 20050124 (Red Hat 3.4.3-17)
> (I've also tried with gcc4 (GCC) 4.0.0 20050125 (Red Hat 4.0.0-0.22))
> GNU ld version 2.15.95 20050302 (cvs update as of this morning)
> glibc-devel-2.3.4-2.fc3
> 
> When I try and compile Mozilla from CVS, I get the following error:
> 
> > gcc -shared -Wl,-soname -Wl,libnspr4.so -o libnspr4.so [lots of o files]
> ...
> > /usr/bin/ld: io/./priometh.o: relocation R_X86_64_PC32 against
> > `memcpy@@GLIBC_2.2.5' can not be used when making a shared object;
> > recompile with -fPIC
> > /usr/bin/ld: final link failed: Bad value
> 
> It WAS compiled with "-pipe -ansi -Wall -pthread -O2 -fPIC"
> and a bunch of Mozilla defines.
> 
> $ file io/./priometh.o
> io/./priometh.o: ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), not stripped
> $ nm io/./priometh.o | grep memcpy
>                  U memcpy
> 

I don't think it a linker problem. Send me a preprocessed priometh.cc
and compiler flags used to compile it. I will take a look.


H.J.



More information about the Binutils mailing list