This is the mail archive of the binutils@sources.redhat.com 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: segfault in bfd_elf32_bfd_link_add_symbols (2.14.90.0.5)


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


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