This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR ld/10433: Latest ld fails to link ldconfig properly
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sources dot redhat dot com
- Cc: amodra at bigpond dot net dot au
- Date: Wed, 22 Jul 2009 14:32:27 -0700
- Subject: PATCH: PR ld/10433: Latest ld fails to link ldconfig properly
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
A STT_GNU_IFUNC symbol goes through PLT only if it is ever referenced.
I checked in this patch to fix it.
H.J.
--
Index: ChangeLog
===================================================================
--- ChangeLog (revision 6448)
+++ ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2009-07-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/10433
+ * elflink.c (elf_link_output_extsym): Special case ifunc syms
+ when ref_regular, not def_regular.
+
2009-07-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/10426
Index: elflink.c
===================================================================
--- elflink.c (revision 6448)
+++ elflink.c (working copy)
@@ -8660,9 +8660,10 @@ elf_link_output_extsym (struct elf_link_
and also to finish up anything that needs to be done for this
symbol. FIXME: Not calling elf_backend_finish_dynamic_symbol for
forced local syms when non-shared is due to a historical quirk.
- STT_GNU_IFUNC symbol must go through PLT. */
+ STT_GNU_IFUNC symbol must go through PLT only if it is ever
+ referenced. */
if ((h->type == STT_GNU_IFUNC
- && h->def_regular
+ && h->ref_regular
&& !finfo->info->relocatable)
|| ((h->dynindx != -1
|| h->forced_local)