File binutils-fix-ld-segv.diff of Package binutils.13942

Fix for bsc#1154025

Fixes a segfault in linking some pacemaker libs where some versions
use linker script magic to force some symbols visible, making their
sections not have an owner.
--- bfd/elf64-x86-64.c.mm	2019-10-15 13:54:18.826038254 +0000
+++ bfd/elf64-x86-64.c	2019-10-15 13:52:38.040286437 +0000
@@ -2239,6 +2239,7 @@ check_pic:
 		= (info->nocopyreloc
 		   || (h != NULL
 		       && eh->def_protected
+		       && h->root.u.def.section->owner
 		       && elf_has_no_copy_on_protected (h->root.u.def.section->owner)));
 	      if ((sec->flags & SEC_ALLOC) != 0
 		  && (sec->flags & SEC_READONLY) != 0
@@ -3859,6 +3860,7 @@ direct:
 	      sec = h->root.u.def.section;
 	      if ((info->nocopyreloc
 		   || (eh->def_protected
+		       && h->root.u.def.section->owner
 		       && elf_has_no_copy_on_protected (h->root.u.def.section->owner)))
 		  && !(h->root.u.def.section->flags & SEC_CODE))
 		return elf_x86_64_need_pic (info, input_bfd, input_section,