This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH COMMITTED: Correct 64-bit ELF file header size check
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Wed, 23 Apr 2008 10:34:14 -0700
- Subject: 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;