]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/
authorTristan Gingold <gingold@adacore.com>
Tue, 4 Sep 2012 13:34:49 +0000 (13:34 +0000)
committerTristan Gingold <gingold@adacore.com>
Tue, 4 Sep 2012 13:34:49 +0000 (13:34 +0000)
2012-08-05  Maciej W. Rozycki  <macro@linux-mips.org>

* elf32-vax.c (elf_vax_adjust_dynamic_symbol): Don't allocate
PLT slots for local symbols.

ld/
2012-08-05  Maciej W. Rozycki  <macro@linux-mips.org>

* ld-vax-elf: New directory.
* ld-vax-elf/plt-local-lib.dd: New test.
* ld-vax-elf/plt-local-lib.ld: New test linker script.
* ld-vax-elf/plt-local-lib.s: New test source.
* ld-vax-elf/plt-local.dd: New test.
* ld-vax-elf/plt-local.ld: New test linker script.
* ld-vax-elf/plt-local.s: New test source.
* ld-vax-elf/plt-local-hidden-pic.s: New test source.
* ld-vax-elf/plt-local-rehidden-pic.s: New test source.
* ld-vax-elf/vax-elf.exp: New test script.

bfd/ChangeLog
bfd/elf32-vax.c
ld/testsuite/ChangeLog

index 20622bfbf11c7d719b961330a81def7462343403..9d65fce1f80711d3f697d15a002b000ac015f8b7 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-05  Maciej W. Rozycki  <macro@linux-mips.org>
+
+       * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Don't allocate
+       PLT slots for local symbols.
+
 2012-08-28  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
        Apply from mainline
index 84ec972563f328974ba7fdc3c1cc62173cb7ac62..6258d96097553d2805b7920aacf309415923bb14 100644 (file)
@@ -933,39 +933,21 @@ elf_vax_adjust_dynamic_symbol (info, h)
   if (h->type == STT_FUNC
       || h->needs_plt)
     {
-      if (! info->shared
-         && !h->def_dynamic
-         && !h->ref_dynamic
-         /* We must always create the plt entry if it was referenced
-            by a PLTxxO relocation.  In this case we already recorded
-            it as a dynamic symbol.  */
-         && h->dynindx == -1)
+      if (h->plt.refcount <= 0
+         || SYMBOL_CALLS_LOCAL (info, h)
+         || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+             && h->root.type == bfd_link_hash_undefweak))
        {
          /* This case can occur if we saw a PLTxx reloc in an input
             file, but the symbol was never referred to by a dynamic
-            object.  In such a case, we don't actually need to build
-            a procedure linkage table, and we can just do a PCxx
-            reloc instead.  */
-         BFD_ASSERT (h->needs_plt);
+            object, or if all references were garbage collected.  In
+            such a case, we don't actually need to build a procedure
+            linkage table, and we can just do a PCxx reloc instead.  */
          h->plt.offset = (bfd_vma) -1;
-         return TRUE;
-       }
-
-      /* GC may have rendered this entry unused.  */
-      if (h->plt.refcount <= 0)
-       {
          h->needs_plt = 0;
-         h->plt.offset = (bfd_vma) -1;
          return TRUE;
        }
 
-      /* Make sure this symbol is output as a dynamic symbol.  */
-      if (h->dynindx == -1)
-       {
-         if (! bfd_elf_link_record_dynamic_symbol (info, h))
-           return FALSE;
-       }
-
       s = bfd_get_linker_section (dynobj, ".plt");
       BFD_ASSERT (s != NULL);
 
index 8407cb47eb8027060a60d10e47925d6b1ba2ef37..48ce92e5a119c9018f1db6615378604601977330 100644 (file)
@@ -1,3 +1,16 @@
+2012-08-05  Maciej W. Rozycki  <macro@linux-mips.org>
+
+       * ld-vax-elf: New directory.
+       * ld-vax-elf/plt-local-lib.dd: New test.
+       * ld-vax-elf/plt-local-lib.ld: New test linker script.
+       * ld-vax-elf/plt-local-lib.s: New test source.
+       * ld-vax-elf/plt-local.dd: New test.
+       * ld-vax-elf/plt-local.ld: New test linker script.
+       * ld-vax-elf/plt-local.s: New test source.
+       * ld-vax-elf/plt-local-hidden-pic.s: New test source.
+       * ld-vax-elf/plt-local-rehidden-pic.s: New test source.
+       * ld-vax-elf/vax-elf.exp: New test script.
+
 2012-08-28  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
        Apply mainline patches