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]

PATCH: Report unrecognized i386 relocation.


The current linker does:

 Offset     Info    Type            Sym.Value  Sym. Name
00000000  00000526 unrecognized: 26      00000000   x
[hjl@gnu be]$ ld -r foo.o
ld: final link failed: Bad value

This patch reports unrecognized i386 relocation.


H.J.
----
2004-08-12  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_relocate_section): Report unrecognized
	relocation.

--- bfd/elf32-i386.c.bad	2004-06-24 08:30:31.000000000 -0700
+++ bfd/elf32-i386.c	2004-08-11 12:34:03.038417120 -0700
@@ -2039,6 +2039,13 @@ elf_i386_relocate_section (bfd *output_b
 	  && ((indx = r_type - R_386_tls_offset) - R_386_ext
 	      >= R_386_tls - R_386_ext))
 	{
+	  char *name = bfd_get_section_ident (input_section);
+	  (*_bfd_error_handler)
+	    (_("%s: unrecognized relocation (0x%x) in section `%s'"),
+	     bfd_archive_filename (input_bfd), r_type,
+	     name ? name : input_section->name);
+	  if (name)
+	    free (name);
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
 	}


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