]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PowerPC64 linking of --just-symbols objects (klibc)
authorAlan Modra <amodra@gmail.com>
Tue, 3 Dec 2013 04:31:20 +0000 (15:01 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 5 Dec 2013 10:50:39 +0000 (21:20 +1030)
With -mcmodel=medium we can't assume that a -R object doesn't use
toc-relative addressing if there's no toc.  Lots of things are
accessed via r2, not just the toc/got section.  Also, testing for
.opd is plain wrong for ELFv2.

* elf64-ppc.c (ppc64_elf_link_just_syms): Remove .got check.
Handle ELFv2.

bfd/ChangeLog
bfd/elf64-ppc.c

index 5d9ef7ce19ebb6d16b18b6dbab5e997ae362cef6..ed9a65bca0cc1e1fe62d3a4bd1eee0c73fde213b 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-05  Alan Modra  <amodra@gmail.com>
+
+       * elf64-ppc.c (ppc64_elf_link_just_syms): Remove .got check.
+       Handle ELFv2.
+
 2013-12-02  Tristan Gingold  <gingold@adacore.com>
 
        * configure.in: Bump version to 2.24.0
index bf13a5da6b184a1554239a249524bed84d6ea05b..e069a7e9616d1f8789bb5ffd110662ee64424bc5 100644 (file)
@@ -5001,10 +5001,8 @@ ppc64_elf_link_just_syms (asection *sec, struct bfd_link_info *info)
       && (sec->owner->flags & (EXEC_P | DYNAMIC)) != 0
       && is_ppc64_elf (sec->owner))
     {
-      asection *got = bfd_get_section_by_name (sec->owner, ".got");
-      if (got != NULL
-         && got->size >= elf_backend_got_header_size
-         && bfd_get_section_by_name (sec->owner, ".opd") != NULL)
+      if (abiversion (sec->owner) >= 2
+         || bfd_get_section_by_name (sec->owner, ".opd") != NULL)
        sec->has_toc_reloc = 1;
     }
   _bfd_elf_link_just_syms (sec, info);