Bug 679 - ld failed to support protected data symbols
Summary: ld failed to support protected data symbols
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: unassigned
Depends on:
Reported: 2005-01-19 00:02 UTC by H.J. Lu
Modified: 2006-01-29 16:06 UTC (History)
1 user (show)

See Also:
Target: x86_64-unknown-linux-gnu
Last reconfirmed:

A testcase (418 bytes, application/octet-stream)
2005-01-19 00:03 UTC, H.J. Lu

Note You need to log in before you can comment on or make changes to this bug.
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.