This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linker crash in arm stub generation


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]