PR23980, powerpc64 ld segfault

Alan Modra amodra@gmail.com
Mon Dec 17 22:40:00 GMT 2018


The segfault fixed here was triggered by attempting to link ppc64
input objects to an x86_64 output.  With that problem fixed, ld now
gives:

ld/ld-new -shared -o pr23980 write.pico writev.pico
ld/ld-new: powerpc:common64 architecture of input file `write.pico' is incompatible with i386:x86-64 output
ld/ld-new: powerpc:common64 architecture of input file `writev.pico' is incompatible with i386:x86-64 output
ld/ld-new: BFD (GNU Binutils) 2.31.51.20181217 assertion fail /home/alan/src/binutils-gdb/bfd/elf64-x86-64.c:2392
ld/ld-new: write.pico: unrecognized relocation type 0x7c in section `.text'
ld/ld-new: is this version of the linker - (GNU Binutils) 2.31.51.20181217 - out of date ?
ld/ld-new: final link failed: bad value


	PR 23980
	* elf64-ppc.c (ppc64_elf_hide_symbol): Check hash table type
	before referencing ppc64-only fields of hash entries.

diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index a2d3ea067c..31a3edfdae 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -6193,6 +6193,9 @@ ppc64_elf_hide_symbol (struct bfd_link_info *info,
   struct ppc_link_hash_entry *eh;
   _bfd_elf_link_hash_hide_symbol (info, h, force_local);
 
+  if (ppc_hash_table (info) == NULL)
+    return;
+
   eh = (struct ppc_link_hash_entry *) h;
   if (eh->is_func_descriptor)
     {

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list