Bug 679

Summary: ld failed to support protected data symbols
Product: binutils Reporter: H.J. Lu <hjl.tools>
Component: ldAssignee: unassigned
Severity: normal CC: bug-binutils
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target: x86_64-unknown-linux-gnu
Build: Last reconfirmed:
Attachments: A testcase

Description H.J. Lu 2005-01-19 00:02:19 UTC
_bfd_elf_symbol_refs_local_p treats all STV_PROTECTED symbols as
dynamic to support function pointer equality tests. It doesn't work
with protected data symbols on x86_64.
Comment 1 H.J. Lu 2005-01-19 00:03:46 UTC
Created attachment 375 [details]
A testcase

[hjl@gnu-20 x86_64-2]$ make
gcc -B./ -fPIC	 -c -o x.o x.c
ld -shared -o libx.so x.o
ld: x.o: relocation R_X86_64_PC32 against `_memcpy_mem_ops_method' can not be
used when making a shared object; recompile with -fPIC
ld: final link failed: Bad value
make: *** [libx.so] Error 1
Comment 2 H.J. Lu 2005-01-19 00:27:58 UTC
A patch is posted at

Comment 3 H.J. Lu 2005-03-02 18:35:24 UTC
Comment 4 Per Steinar Iversen 2006-01-20 11:41:48 UTC
This problem seems to be present still in AS4 U2, it appeared when installing
Oracle on a fully updated machine. As an experiment I rebuilt
binutils with the patch from the binutils list and Oracle then installed without
any complaints.

There is a reference to this bug here, at the bottom of the page:

Comment 5 H.J. Lu 2006-01-29 16:06:15 UTC
This bug database is for the FSF binutils. Please report your Red Hat
binutils problem to Red Hat.