[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/13255] Wrong `local symbol is referenced by DSO' warnings on Sol
From: |
ro at TechFak dot Uni-Bielefeld.DE |
Subject: |
[Bug ld/13255] Wrong `local symbol is referenced by DSO' warnings on Solaris |
Date: |
Mon, 10 Oct 2011 15:36:42 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=13255
Rainer Orth <ro at TechFak dot Uni-Bielefeld.DE> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl at sourceware dot org
--- Comment #1 from Rainer Orth <ro at TechFak dot Uni-Bielefeld.DE> 2011-10-10
15:36:42 UTC ---
I've digged a bit deeper and found the culprit patch:
In 2.21.1, h->forced_local is 0 in the test in elflink.c
(elf_link_output_extsym):
/* We should also warn if a forced local symbol is referenced from
shared libraries. */
In 2.21.90, it is set to 1 by _bfd_elf_link_hash_hide_symbol with this
callstack, called due to --gc-sections:
(gdb) where
#0 _bfd_elf_link_hash_hide_symbol (info=0x821b7e0, h=0x84231c4, force_local=1)
at /vol/gnu/src/binutils/binutils-2.21.90/bfd/elflink.c:6783
#1 0x080ffce4 in elf_gc_sweep_symbol (h=0x84231c4, data=0x8047688) at
/vol/gnu/src/binutils/binutils-2.21.90/bfd/elflink.c:11704
#2 0x080b54d0 in bfd_link_hash_traverse (htab=0x822a7e0, func=0x80ffc26
<elf_gc_sweep_symbol>, info=0x8047688) at
/vol/gnu/src/binutils/binutils-2.21.90/bfd/linker.c:628
#3 0x080fff0c in elf_gc_sweep (abfd=0x821e860, info=0x821b7e0) at
/vol/gnu/src/binutils/binutils-2.21.90/bfd/elflink.c:11789
#4 0x08100672 in bfd_elf_gc_sections (abfd=0x821e860, info=0x821b7e0) at
/vol/gnu/src/binutils/binutils-2.21.90/bfd/elflink.c:12033
#5 0x0807c4f1 in lang_gc_sections () at
/vol/gnu/src/binutils/binutils-2.21.90/ld/ldlang.c:6346
#6 0x0807ca59 in lang_process () at
/vol/gnu/src/binutils/binutils-2.21.90/ld/ldlang.c:6653
#7 0x08080156 in main (argc=24, argv=0x804780c) at
/vol/gnu/src/binutils/binutils-2.21.90/ld/ldmain.c:465
This is ultimately caused by H.J.'s patch
PR ld/13177
* elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT
nor GOT references.
For the symbol in question, we have
h->root.type = bfd_link_hash_defined
h->plt.refcount = -1
h->got.refcount = 0
If I either remove the --gc-sections or revert the patch, the test links just
fine.
Rainer
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.