From 504deeff42d2018fa3bc1364d8469c6e682d42cd Mon Sep 17 00:00:00 2001 From: John Reiser Date: Wed, 24 May 2006 13:15:39 -0700 Subject: [PATCH] ET_DYN cannot be old format for decompression --- src/p_lx_elf.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index f589ab0c..1cf94f70 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -1858,9 +1858,10 @@ void PackLinuxElf32x86::unpack(OutputFile *fo) fi->seek(0, SEEK_SET); fi->readx(bufehdr, MAX_ELF_HDR); unsigned const e_entry = get_native32(&ehdr->e_entry); - if (e_entry < 0x401180 - && e_entry >=0x100000 // beware ET_DYN.e_entry==0x10f0 or so - ) { /* old style, 8-byte b_info */ + unsigned const e_type = get_native16(&ehdr->e_type); + if (e_entry < 0x401180 && Elf32_Ehdr::ET_EXEC==e_type) { + // beware ET_DYN.e_entry==0x10f0 or so + /* old style, 8-byte b_info */ szb_info = 2*sizeof(unsigned); } }