This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
complex reloc corner case bug
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Mon, 12 Feb 2007 21:47:26 +1030
- Subject: complex reloc corner case bug
This fixes a corner case bug in the new complex relocation code that
caused a segfault on powerpc64. It's possible to have a bfd with
relocs but no symbols (all the relocs use no symbol), a situation
that occurs with the powerpc64 linker created stub bfd.
* elflink.c (evaluate_complex_relocation_symbols): Ignore relocs
with a zero symbol index.
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.247
diff -u -p -r1.247 elflink.c
--- bfd/elflink.c 5 Feb 2007 23:15:38 -0000 1.247
+++ bfd/elflink.c 12 Feb 2007 10:58:11 -0000
@@ -6769,7 +6769,10 @@ evaluate_complex_relocation_symbols (bfd
index = ELF32_R_SYM (rel->r_info);
if (bed->s->arch_size == 64)
index >>= 24;
-
+
+ if (index == STN_UNDEF)
+ continue;
+
if (index < locsymcount)
{
/* The symbol is local. */
--
Alan Modra
IBM OzLabs - Linux Technology Centre