This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
patch for arm-elf bfd
- To: nickc at cygnus dot com
- Subject: patch for arm-elf bfd
- From: Philip Blundell <pb at tazenda dot demon dot co dot uk>
- Date: Sun, 03 Sep 2000 14:19:00 +0100
- Cc: binutils at sourceware dot cygnus dot com
Building Mozilla on Linux/ARM causes the linker to segfault while trying to
generate a large shared library. The problem is that this code in
elf32_arm_relocate_section is being reached when sec->output_section is NULL:
if (relocation_needed)
relocation = h->root.u.def.value
+ sec->output_section->vma
+ sec->output_offset;
else
relocation = 0;
Since building without debugging avoids the problem, I came up with the
following patch by analogy to the i386 code, which seems to fix the crash for
me. Is this correct?
Thanks
p.
2000-09-03 Philip Blundell <philb@gnu.org>
* elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate
references to undefined symbols in debugging sections.
Index: elf32-arm.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.h,v
retrieving revision 1.34
diff -u -p -u -r1.34 elf32-arm.h
--- elf32-arm.h 2000/08/10 19:41:07 1.34
+++ elf32-arm.h 2000/09/03 13:12:24
@@ -1794,7 +1794,14 @@ elf32_arm_relocate_section (output_bfd,
(!info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
)
- && ((input_section->flags & SEC_ALLOC) != 0)
+ && ((input_section->flags & SEC_ALLOC) != 0
+ /* DWARF will emit R_ARM_ABS32 relocations in its
+ sections against symbols defined externally
+ in shared libraries. We can't do anything
+ with them here. */
+ || ((input_section->flags & SEC_DEBUGGING) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
)
relocation_needed = 0;
break;