Blame SOURCES/gdb-rhbz1125820-ppc64le-enablement-18of37.patch

2c2fa1
commit 2c3f079f58204594bc271b919a643e9f2813aa12
2c2fa1
Author: Alan Modra <amodra@gmail.com>
2c2fa1
Date:   Tue Dec 3 15:01:20 2013 +1030
2c2fa1
2c2fa1
    PowerPC64 linking of --just-symbols objects (klibc)
2c2fa1
    
2c2fa1
    With -mcmodel=medium we can't assume that a -R object doesn't use
2c2fa1
    toc-relative addressing if there's no toc.  Lots of things are
2c2fa1
    accessed via r2, not just the toc/got section.  Also, testing for
2c2fa1
    .opd is plain wrong for ELFv2.
2c2fa1
    
2c2fa1
    	* elf64-ppc.c (ppc64_elf_link_just_syms): Remove .got check.
2c2fa1
    	Handle ELFv2.
2c2fa1
2c2fa1
Index: gdb-7.6.1/bfd/elf64-ppc.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/bfd/elf64-ppc.c
2c2fa1
+++ gdb-7.6.1/bfd/elf64-ppc.c
2c2fa1
@@ -4887,10 +4887,8 @@ ppc64_elf_link_just_syms (asection *sec,
2c2fa1
       && (sec->owner->flags & (EXEC_P | DYNAMIC)) != 0
2c2fa1
       && is_ppc64_elf (sec->owner))
2c2fa1
     {
2c2fa1
-      asection *got = bfd_get_section_by_name (sec->owner, ".got");
2c2fa1
-      if (got != NULL
2c2fa1
-	  && got->size >= elf_backend_got_header_size
2c2fa1
-	  && bfd_get_section_by_name (sec->owner, ".opd") != NULL)
2c2fa1
+      if (abiversion (sec->owner) >= 2
2c2fa1
+	  || bfd_get_section_by_name (sec->owner, ".opd") != NULL)
2c2fa1
 	sec->has_toc_reloc = 1;
2c2fa1
     }
2c2fa1
   _bfd_elf_link_just_syms (sec, info);