[ltt-dev] unable to link marker-lib - relocation R_X86_64_PC32 against `__stop___markers' can not be used when making a shared object; recompile with -fPIC

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue Nov 11 23:52:40 EST 2008


* lshorbguard-ltt at yahoo.com (lshorbguard-ltt at yahoo.com) wrote:
> Hello,
> 
> I am unable to build markers-userspace-0.5 (or 0.6).  Here's what I get:
> 
> make -f Makefile_64
> 
> gcc -Wl,-Telf_x86_64.xmark -O2 -fPIC -DCONFIG_MARKERS -shared -o libtestlib.so testlib.c marker-lib.o
> /usr/bin/ld: marker-lib.o: relocation R_X86_64_32 against
> `__stop___markers' can not be used when making a shared object;
> recompile with -fPIC
> marker-lib.o: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [libtestlib.so] Error 1
> 

Hi,

Short story : do a make clean. :)

I got the same result if I do, on my 64-bits machine :

% make  (oops, compiled 32-bits)
gcc -O2 -DCONFIG_MARKERS -c -o marker-lib.o marker-lib.c
gcc -Wl,-Telf_i386.xmark -O2 -DCONFIG_MARKERS -shared -o libtestlib.so testlib.c marker-lib.o
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status
make: *** [libtestlib.so] Error 1

It however created marker-lib.o


Then, if I do :

% make -f Makefile_64
gcc -Wl,-Telf_x86_64.xmark -O2 -fPIC -DCONFIG_MARKERS -shared -o libtestlib.so testlib.c marker-lib.o
/usr/bin/ld: marker-lib.o: relocation R_X86_64_32 against `__stop___markers' can not be used when making a shared object; recompile with -fPIC
marker-lib.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libtestlib.so] Error 1

to fix it :
% make clean
% make -f Makefile_64

gcc -fPIC -O2 -DCONFIG_MARKERS -c -o marker-lib.o marker-lib.c
gcc -Wl,-Telf_x86_64.xmark -O2 -fPIC -DCONFIG_MARKERS -shared -o libtestlib.so testlib.c marker-lib.o
gcc -fPIC -Wl,-Telf_x86_64.xmark -O2 -DCONFIG_MARKERS -L. -ltestlib -o testprog testprog.c marker-lib.o
gcc -fPIC -O2 -DCONFIG_MARKERS -S -o testprog.S testprog.c

Mathieu


> I have patched my elf_x86_64.x per the included patch.
> 
> clearly marker-lib.o is being built with the -fPIC option... Any suggestions?
> 
> X86_64 kernel 2.6.26.5, otherwise FC7 system. using gcc 4.1.2 
> 
> Any assistance appreciated.
> 
> Thanks,
> 
> Lance
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68




More information about the lttng-dev mailing list