This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ppc64 ld segfault on ABI incompatible shared lib.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Cc: Olaf Hering <olh at suse dot de>, Marcus Meissner <meissner at suse dot de>
- Date: Tue, 25 Nov 2003 12:43:23 +1030
- Subject: ppc64 ld segfault on ABI incompatible shared lib.
Fixes a segfault in ppc_size_one_stub caused by someone exporting a
function code symbol without exporting a corresponding opd entry from a
shared lib.
* elf64-ppc.c (ppc_type_of_stub): Disallow stubs other than
ppc_stub_plt_call to symbols defined in shared libs.
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.139
diff -u -p -r1.139 elf64-ppc.c
--- bfd/elf64-ppc.c 18 Nov 2003 04:14:15 -0000 1.139
+++ bfd/elf64-ppc.c 25 Nov 2003 01:58:42 -0000
@@ -6070,8 +6070,9 @@ ppc_type_of_stub (asection *input_sec,
}
}
- if (h->elf.root.type != bfd_link_hash_defined
- && h->elf.root.type != bfd_link_hash_defweak)
+ if (!(h->elf.root.type == bfd_link_hash_defined
+ || h->elf.root.type == bfd_link_hash_defweak)
+ || h->elf.root.u.def.section->output_section == NULL)
return ppc_stub_none;
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre