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

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