------- Additional Comments From hjl at lucon dot org  2005-01-19 00:27 -------
Created an attachment (id=7985)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7985&action=view)
A testcase

With the new linker, I got

[EMAIL PROTECTED] x86_64-3]$ make
gcc -fPIC   -c -o x.o x.c
gcc -shared -o libx.so x.o
/usr/local/bin/ld: x.o: relocation R_X86_64_PC32 against `foo' can not be used
when making a shared object; recompile with -fPIC
/usr/local/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make: *** [libx.so] Error 1

With the old linker, I got
[EMAIL PROTECTED] x86_64-3]$ make CC="gcc -B/usr/bin/"
gcc -B/usr/bin/ -fPIC   -c -o x.o x.c
gcc -B/usr/bin/ -shared -o libx.so x.o
gcc -B/usr/bin/ -o foo m.c libx.so -Wl,-rpath,.
./foo
called from main foo_p: 0x400610
called from shared foo: 0x2a9566d8d8
shared foo: 0x2a9566d8d8
shared foo: 0x2a9566d8d8
called from shared foo_p: 0x400610
shared foo: 0x2a9566d8d8
shared foo: 0x2a9566d8d8
called from main foo: 0x400610
got from main foo: 0x2a9566d8d8
Function pointer `foo' are't the same in DSO and main


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19520

Reply via email to