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]

wrong reloc sizes


Apparently it's possible to fool ld into trying to link objects
with invalid relocs.  Since that is really a user error, we
probably shouldn't abort.

	* elflink.h (elf_link_read_relocs_from_section): Don't abort with
	wrong reloc sizes.

Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.207
diff -u -p -r1.206 elflink.h
--- bfd/elflink.h	25 Feb 2003 04:14:38 -0000	1.207
+++ bfd/elflink.h	25 Feb 2003 02:41:23 -0000
@@ -2579,7 +2579,10 @@ elf_link_read_relocs_from_section (abfd,
   else if (shdr->sh_entsize == sizeof (Elf_External_Rela))
     swap_in = bed->s->swap_reloca_in;
   else
-    abort ();
+    {
+      bfd_set_error (bfd_error_wrong_format);
+      return FALSE;
+    }
 
   erela = external_relocs;
   erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;

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