This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: linker crash in arm stub generation
- From: Nick Clifton <nickc at redhat dot com>
- To: Phil Blundell <pb at reciva dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 12 Jun 2009 13:35:56 +0100
- Subject: Re: linker crash in arm stub generation
- References: <1244740179.21585.119.camel@mill.internal.reciva.com>
Hi Phil,
This testcase causes the linker (CVS head from a couple of days ago,
arm-linuxgnueabi target) to segfault in arm_build_one_stub():
Please could you open a bug report for this bug ?
Once you have done that, please try out this patch which I think should
solve the problem.
Cheers
Nick
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.196
diff -c -3 -p -r1.196 elf32-arm.c
*** bfd/elf32-arm.c 22 May 2009 11:58:44 -0000 1.196
--- bfd/elf32-arm.c 12 Jun 2009 12:34:47 -0000
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3450,3455 ****
--- 3450,3460 ----
stub_addr = stub_sec->output_section->vma + stub_sec->output_offset
+ stub_entry->stub_offset;
+ if (stub_entry->target_section == NULL
+ || stub_entry->target_section->output_section == NULL)
+ /* The output section has been deleted, ignore this stub. */
+ return TRUE;
+
/* This is the address of the stub destination. */
sym_value = (stub_entry->target_value
+ stub_entry->target_section->output_offset