This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PR23980, powerpc64 ld segfault
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 18 Dec 2018 09:10:22 +1030
- Subject: PR23980, powerpc64 ld segfault
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