Set STB_GNU_UNIQUE only if symbol is defined in regular object
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 8 Feb 2013 01:33:01 +0000 (01:33 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 8 Feb 2013 01:33:01 +0000 (01:33 +0000)
bfd/

PR ld/15107
* elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if
symbol is defined in regular object.

ld/testsuite/

PR ld/15107
* ld-unique/unique_empty.s: Add reference to "b".

bfd/ChangeLog
bfd/elflink.c
ld/testsuite/ChangeLog
ld/testsuite/ld-unique/unique_empty.s

index c652c3523d78a974a2033f22ff8f083dc52485d9..4c936117c163a33b3bb345362c106984ecb5ae62 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/15107
+       * elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if
+       symbol is defined in regular object.
+
 2013-02-07  Roberto Agostino Vitillo  <ra.vitillo@gmail.com>
 
        PR binutils/15106
index d336730e07897a247e272c604f1aa041572158c2..e6c835153fb5048abc82a09ec22933e457c0ec57 100644 (file)
@@ -8868,7 +8868,8 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
       /* Turn off visibility on local symbol.  */
       sym.st_other &= ~ELF_ST_VISIBILITY (-1);
     }
-  else if (h->unique_global)
+  /* Set STB_GNU_UNIQUE only if symbol is defined in regular object.  */
+  else if (h->unique_global && h->def_regular)
     sym.st_info = ELF_ST_INFO (STB_GNU_UNIQUE, h->type);
   else if (h->root.type == bfd_link_hash_undefweak
           || h->root.type == bfd_link_hash_defweak)
index 2c12a52678a4b29470c2e1a72cfff1107ef8b88b..c031a5edd3aba8b2e3a91f29df2ffff3e88854e8 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/15107
+       * ld-unique/unique_empty.s: Add reference to "b".
+
 2013-02-06  H.J. Lu  <hongjiu.lu@intel.com>
 
        * ld-size/size-10.rd: Updated.
index efd66839bce75b604cdf4c0c3f4d5239cc89d598..c4c52c2cda67aed149b3363a7b93151a7f2fb6ac 100644 (file)
@@ -1,4 +1,4 @@
         .type main,"function"
         .global main
 main:
-        .long 0
+        .dc.a b
This page took 0.031515 seconds and 4 git commands to generate.