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 COMMITTED: Correct 64-bit ELF file header size check


I noticed a bug in the test for whether a 64-bit ELF file is large
enough to hold the ELF header.  Fixed with the appended patch.

Ian


2008-04-23  Ian Lance Taylor  <iant@google.com>

	* object.cc (make_elf_object): Correct test for 64-bit ELF file
	header size.


Index: object.cc
===================================================================
RCS file: /cvs/src/src/gold/object.cc,v
retrieving revision 1.70
diff -u -p -r1.70 object.cc
--- object.cc	19 Apr 2008 19:34:41 -0000	1.70
+++ object.cc	23 Apr 2008 17:32:04 -0000
@@ -1678,7 +1678,7 @@ make_elf_object(const std::string& name,
     }
   else
     {
-      if (bytes < elfcpp::Elf_sizes<32>::ehdr_size)
+      if (bytes < elfcpp::Elf_sizes<64>::ehdr_size)
 	{
 	  gold_error(_("%s: ELF file too short"), name.c_str());
 	  return NULL;

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