Try to appease Android runtime loader; _Shdr vs _Phdr offsets

JNI FalalError called: Unable to load library:
    [dlopen failed: "/lib/arm/libunity.so"
    .dynamic section has invalid offset: 0x6d3e58,
    expected to match PT_DYNAMIC offset: 0x441e58]
https://github.com/upx/upx/issues/609
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
This commit is contained in:
John Reiser
2023-03-26 10:53:30 -07:00
parent b5d1eba4c1
commit b361b91ec7
2 changed files with 32 additions and 5 deletions
+5 -2
View File
@@ -127,9 +127,12 @@
SHT_FINI_ARRAY = 15, /* Array of destructors */
SHT_PREINIT_ARRAY = 16, /* Array of pre-constructors */
SHT_GROUP = 17, /* Section group */
SHT_SYMTAB_SHNDX = 18, /* Extended section indeces */
SHT_SYMTAB_SHNDX = 18, /* Extended section indices */
SHT_GNU_HASH = 0x6ffffff6, /* GNU-style hash table. */
SHT_GNU_LIBLIST = 0x6ffffff7, /* Prelink library list */
SHT_GNU_HASH = 0x6ffffff6, /* GNU-style hash table. */
SHT_GNU_verdef = 0x6ffffffd, /* Version definition section. */
SHT_GNU_verneed = 0x6ffffffe, /* Version needs section. */
SHT_GNU_versym = 0x6fffffff, /* Version symbol table. */
SHT_LOOS = 0x60000000, /* LOcal OS; SHT_ANDROID_REL{,A} is +1, +2 */
SHT_LOPROC = 0x70000000, /* Start of processor-specific */