Many changes for ELF shared libraries on Linux and Android

Handling more than 2 PT_LOAD (and thus more than 1 executable PT_LOAD)
required extensive changes.  But the bonus is the infrastructure
to support a different (de-)compression algorithm for each PT_LOAD.

https://github.com/upx/upx/issues/341   i386 .so decompression
https://github.com/upx/upx/issues/609   armv7 .so on Android
https://github.com/upx/upx/issues/625   amd64 .so execution
https://github.com/upx/upx/issues/654   armv7 .exe
Not yet: .so on MIPS, PowerPC, PowerPC64
This commit is contained in:
John Reiser
2023-03-04 17:37:25 -08:00
committed by Markus F.X.J. Oberhumer
parent fa56a1d9cd
commit adb0ca8250
121 changed files with 15796 additions and 6036 deletions
+6 -5
View File
@@ -210,15 +210,16 @@ const char *Packer::getDecompressorSections() const
static const char lzma_elf_fast[] =
"LZMA_ELF00,LZMA_DEC20,LZMA_DEC30";
if (ph.method == M_NRV2B_LE32)
unsigned const method = forced_method(ph.method);
if (method == M_NRV2B_LE32)
return opt->small ? nrv2b_le32_small : nrv2b_le32_fast;
if (ph.method == M_NRV2D_LE32)
if (method == M_NRV2D_LE32)
return opt->small ? nrv2d_le32_small : nrv2d_le32_fast;
if (ph.method == M_NRV2E_LE32)
if (method == M_NRV2E_LE32)
return opt->small ? nrv2e_le32_small : nrv2e_le32_fast;
// if (ph.method == M_CL1B_LE32)
// if (method == M_CL1B_LE32)
// return opt->small ? cl1b_le32_small : cl1b_le32_fast;
if (M_IS_LZMA(ph.method)) {
if (M_IS_LZMA(method)) {
if (callsManyTimes(ph.format)) {
return opt->small ? lzma_elf_small : lzma_elf_fast;
}