This is the mail archive of the binutils@sourceware.org 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: readelf: don't ignore relocation against symbols without type


"gcc -feliminate-dwarf2-dups" may generate symbols without type for
debug info. This patch allows readelf to relocate dwarf info in files
generated by "gcc -feliminate-dwarf2-dups".


H.J.
---
2006-09-29  H.J. Lu  <hongjiu.lu@intel.com>

	* readelf.c (debug_apply_rela_addends): Don't ignore relocation
	against symbols without type.

--- binutils/readelf.c.wi	2006-09-16 16:51:50.000000000 -0700
+++ binutils/readelf.c	2006-09-29 07:05:47.000000000 -0700
@@ -7747,6 +7747,10 @@ debug_apply_rela_addends (void *file,
 
 	      if (ELF32_R_SYM (rp->r_info) != 0
 		  && ELF32_ST_TYPE (sym->st_info) != STT_SECTION
+		  /* Relocations against symbols without type can happen.
+		     Gcc -feliminate-dwarf2-dups may generate symbols
+		     without type for debug info.  */
+		  && ELF32_ST_TYPE (sym->st_info) != STT_NOTYPE
 		  /* Relocations against object symbols can happen,
 		     eg when referencing a global array.  For an
 		     example of this see the _clz.o binary in libgcc.a.  */
@@ -7776,6 +7780,7 @@ debug_apply_rela_addends (void *file,
 
 	      if (ELF64_R_SYM (rp->r_info) != 0
 		  && ELF64_ST_TYPE (sym->st_info) != STT_SECTION
+		  && ELF64_ST_TYPE (sym->st_info) != STT_NOTYPE
 		  && ELF64_ST_TYPE (sym->st_info) != STT_OBJECT)
 		{
 		  warn (_("skipping unexpected symbol type %s in relocation in section .rela.%s\n"),


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