Don't return on STT_GNU_IFUNC symbol when stripping.
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 9 Nov 2009 14:37:16 +0000 (14:37 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 9 Nov 2009 14:37:16 +0000 (14:37 +0000)
bfd/

2009-11-09  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/10911
* elflink.c (elf_link_output_extsym): Don't return on
STT_GNU_IFUNC symbol when stripping.

ld/testsuite/

2009-11-09  H.J. Lu  <hongjiu.lu@intel.com>

PR ld/10911
* ld-ifunc/ifunc-4a-x86.d: New.

bfd/ChangeLog
bfd/elflink.c
ld/testsuite/ChangeLog
ld/testsuite/ld-ifunc/ifunc-4a-x86.d [new file with mode: 0644]

index e918d6c..03f6773 100644 (file)
@@ -1,3 +1,9 @@
+2009-11-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/10911
+       * elflink.c (elf_link_output_extsym): Don't return on
+       STT_GNU_IFUNC symbol when stripping.
+
 2009-11-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * elf32-hppa.c (elf32_hppa_final_link): Don't sort unwind information
@@ -8,7 +14,7 @@
 
        * elflink.c (elf_link_add_object_symbols): Improve error
        message generated when a symbol is left unresolved because a
-        --no-add-needed command line option has prevented the
+       --no-add-needed command line option has prevented the
        inclusion of the DSO defining it.
 
 2009-11-03  Alan Modra  <amodra@bigpond.net.au>
index cd016b7..0153411 100644 (file)
@@ -8639,9 +8639,11 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
     strip = FALSE;
 
   /* If we're stripping it, and it's not a dynamic symbol, there's
-     nothing else to do unless it is a forced local symbol.  */
+     nothing else to do unless it is a forced local symbol or a
+     STT_GNU_IFUNC symbol.  */
   if (strip
       && h->dynindx == -1
+      && h->type != STT_GNU_IFUNC
       && !h->forced_local)
     return TRUE;
 
index a0c73c6..e5ffab9 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/10911
+       * ld-ifunc/ifunc-4a-x86.d: New.
+
 2009-11-02  Paul Brook  <paul@codesourcery.com>
 
        * ld-arm/arm-elf.exp: Add new attr-merge-vfp tests.
diff --git a/ld/testsuite/ld-ifunc/ifunc-4a-x86.d b/ld/testsuite/ld-ifunc/ifunc-4a-x86.d
new file mode 100644 (file)
index 0000000..d06f589
--- /dev/null
@@ -0,0 +1,8 @@
+#ld: -s
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+#source: ifunc-4-x86.s
+
+#...
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_[_0-9A-Z]+_IRELATIVE[ ]*[0-9a-f]*
+#pass