1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

set e_shentsize to work around bug in binutils [mostly cosmetic]

This commit is contained in:
John Reiser 2006-10-24 09:43:50 -07:00
parent a31c4bd474
commit 829e2d6c5d
2 changed files with 4 additions and 4 deletions

View File

@ -1053,7 +1053,7 @@ PackLinuxElf32::generateElfHdr(
h2->ehdr.e_shoff = 0;
assert(get_native16(&h2->ehdr.e_ehsize) == sizeof(Elf32_Ehdr));
assert(get_native16(&h2->ehdr.e_phentsize) == sizeof(Elf32_Phdr));
h2->ehdr.e_shentsize = 0;
h2->ehdr.e_shentsize = sizeof(Elf32_Shdr);
h2->ehdr.e_shnum = 0;
h2->ehdr.e_shstrndx = 0;
@ -1103,7 +1103,7 @@ PackOpenBSDElf32x86::generateElfHdr(
h3->ehdr.e_shoff = 0;
assert(get_native16(&h3->ehdr.e_ehsize) == sizeof(Elf32_Ehdr));
assert(get_native16(&h3->ehdr.e_phentsize) == sizeof(Elf32_Phdr));
h3->ehdr.e_shentsize = 0;
h3->ehdr.e_shentsize = sizeof(Elf32_Shdr);
h3->ehdr.e_shnum = 0;
h3->ehdr.e_shstrndx = 0;
@ -1165,7 +1165,7 @@ PackLinuxElf64::generateElfHdr(
h2->ehdr.e_shoff = 0;
assert(get_native16(&h2->ehdr.e_ehsize) == sizeof(Elf64_Ehdr));
assert(get_native16(&h2->ehdr.e_phentsize) == sizeof(Elf64_Phdr));
h2->ehdr.e_shentsize = 0;
h2->ehdr.e_shentsize = sizeof(Elf64_Shdr);
h2->ehdr.e_shnum = 0;
h2->ehdr.e_shstrndx = 0;

View File

@ -240,7 +240,7 @@ static int modifyheaders ## CLASS (Elf ## CLASS ## _Ehdr *ehdr, \
if (EGET(ehdr->e_shoff) >= newsize) { \
ESET(ehdr->e_shoff,0); \
ESET(ehdr->e_shnum,0); \
ESET(ehdr->e_shentsize,0); \
ESET(ehdr->e_shentsize,sizeof(Elf ## CLASS ## _Shdr)); \
ESET(ehdr->e_shstrndx,0); \
} \
\