Option --preserve-build-id for Gnu ELF; contributed by Nicholas Twerdochlib

(SourceForge [ upx-Patches-3413335 ])
This commit is contained in:
John Reiser
2011-12-13 17:26:03 -08:00
parent 57e9b27085
commit 640d5b2dec
5 changed files with 222 additions and 5 deletions
+16
View File
@@ -88,6 +88,10 @@ protected:
unsigned char ei_data;
unsigned char ei_osabi;
char const *osabi_note;
unsigned char const *buildid_data;
int o_elf_shnum; // num output Shdrs
static unsigned char o_shstrtab[];
};
class PackLinuxElf32 : public PackLinuxElf
@@ -186,6 +190,12 @@ protected:
cprElfHdrNetBSD elfout;
__packed_struct(cprElfShdr3)
Elf32_Shdr shdr[3];
__packed_struct_end();
cprElfShdr3 shdrout;
struct Elf32_Nhdr {
unsigned namesz;
unsigned descsz;
@@ -293,6 +303,12 @@ protected:
cprElfHdr4 elfout;
__packed_struct(cprElfShdr3)
Elf64_Shdr shdr[3];
__packed_struct_end();
cprElfShdr3 shdrout;
static void compileTimeAssertions() {
COMPILE_TIME_ASSERT(sizeof(cprElfHdr1) == 64 + 1*56 + 12)
COMPILE_TIME_ASSERT(sizeof(cprElfHdr2) == 64 + 2*56 + 12)