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]

gold patch committed: Handle SHT_X86_64_UNWIND


PR 12675 points out that gold doesn't correctly handle a .eh_frame
section with section type SHT_X86_64_UNWIND.  It would be nice if
.eh_frame always has a special section type, but it doesn't, so we must
continue to recognize it by name.  Given that, this patch changes gold
to treat SHT_X86_64_UNWIND as equivalent to SHT_PROGBITS when looking at
a .eh_frame section.  Committed to mainline.

Ian


2011-06-29  Ian Lance Taylor  <iant@google.com>

	PR gold/12675
	* object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
	SHT_X86_64_UNWIND.
	* layout.cc (Layout::layout_eh_frame): Likewise.


Index: layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.208
diff -u -p -r1.208 layout.cc
--- layout.cc	29 Jun 2011 21:26:40 -0000	1.208
+++ layout.cc	29 Jun 2011 21:38:15 -0000
@@ -1132,7 +1132,8 @@ Layout::layout_eh_frame(Sized_relobj_fil
 			unsigned int reloc_shndx, unsigned int reloc_type,
 			off_t* off)
 {
-  gold_assert(shdr.get_sh_type() == elfcpp::SHT_PROGBITS);
+  gold_assert(shdr.get_sh_type() == elfcpp::SHT_PROGBITS
+	      || shdr.get_sh_type() == elfcpp::SHT_X86_64_UNWIND);
   gold_assert((shdr.get_sh_flags() & elfcpp::SHF_ALLOC) != 0);
 
   const char* const name = ".eh_frame";
Index: object.cc
===================================================================
RCS file: /cvs/src/src/gold/object.cc,v
retrieving revision 1.143
diff -u -p -r1.143 object.cc
--- object.cc	17 Jun 2011 11:20:42 -0000	1.143
+++ object.cc	29 Jun 2011 21:38:15 -0000
@@ -511,7 +511,9 @@ bool
 Sized_relobj_file<size, big_endian>::check_eh_frame_flags(
     const elfcpp::Shdr<size, big_endian>* shdr) const
 {
-  return (shdr->get_sh_type() == elfcpp::SHT_PROGBITS
+  elfcpp::Elf_Word sh_type = shdr->get_sh_type();
+  return ((sh_type == elfcpp::SHT_PROGBITS
+	   || sh_type == elfcpp::SHT_X86_64_UNWIND)
 	  && (shdr->get_sh_flags() & elfcpp::SHF_ALLOC) != 0);
 }
 

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