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]

fix ld/437


	* elflink.c (elf_link_sort_relocs): Don't bomb on unusual sections.
	(_bfd_elf_link_omit_section_dynsym): Formatting.

Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.105
diff -u -p -r1.105 elflink.c
--- bfd/elflink.c	7 Oct 2004 14:45:24 -0000	1.105
+++ bfd/elflink.c	11 Oct 2004 01:07:47 -0000
@@ -629,8 +629,7 @@ _bfd_elf_link_omit_section_dynsym (bfd *
 	  bfd *dynobj = elf_hash_table (info)->dynobj;
 
 	  if (dynobj != NULL
-	      && (ip = bfd_get_section_by_name (dynobj, p->name))
-	      != NULL
+	      && (ip = bfd_get_section_by_name (dynobj, p->name)) != NULL
 	      && (ip->flags & SEC_LINKER_CREATED)
 	      && ip->output_section == p)
 	    return TRUE;
@@ -5712,6 +5711,14 @@ elf_link_sort_relocs (bfd *abfd, struct 
 	bfd_byte *erel, *erelend;
 	asection *o = lo->u.indirect.section;
 
+	if (o->contents == NULL && o->size != 0)
+	  {
+	    /* This is a reloc section that is being handled as a normal
+	       section.  See bfd_section_from_shdr.  We can't combine
+	       relocs in this case.  */
+	    free (sort);
+	    return 0;
+	  }
 	erel = o->contents;
 	erelend = o->contents + o->size;
 	p = sort + o->output_offset / ext_size * sort_elt;

-- 
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]