This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: segfault in bfd_elf32_bfd_link_add_symbols (2.14.90.0.5)
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: David Le Corfec <dlc+bugbinutils at nerim dot net>
- Cc: bug-binutils at gnu dot org, binutils at sources dot redhat dot com
- Date: Sat, 23 Aug 2003 13:39:51 +0930
- Subject: Re: segfault in bfd_elf32_bfd_link_add_symbols (2.14.90.0.5)
- References: <200308191406.44830.dlc@no-dont-spam-me-please.nerim.net>
On Tue, Aug 19, 2003 at 02:07:42PM +0200, David Le Corfec wrote:
> The 2 objects are at http://dlc.nerim.net/objs/
> just doing "ld exec_library.o graphics_hidd.o" causes the segfaults with
It's a bug in handling of absolute symbols.
* elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner.
Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.239
diff -u -p -r1.239 elflink.h
--- bfd/elflink.h 20 Aug 2003 08:37:19 -0000 1.239
+++ bfd/elflink.h 23 Aug 2003 04:02:17 -0000
@@ -1186,7 +1186,8 @@ elf_link_add_object_symbols (bfd *abfd,
bfd *common_bfd;
symbol_align = ffs (h->root.u.def.value) - 1;
- if ((h->root.u.def.section->owner->flags & DYNAMIC) == 0)
+ if (h->root.u.def.section->owner != NULL
+ && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
{
normal_align = h->root.u.def.section->alignment_power;
if (normal_align > symbol_align)
--
Alan Modra
IBM OzLabs - Linux Technology Centre