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
+9 -8
View File
@@ -9,13 +9,14 @@ Linker script and memory map
TARGET(elf32-bigarm)
0x0000000000008080 . = ((0x8000 + SIZEOF_HEADERS) + 0xc)
.text 0x0000000000008080 0xaa8
.text 0x0000000000008080 0xab0
*(.text)
.text 0x0000000000008080 0x30c tmp/armeb.v4a-linux.elf-fold.o
0x00000000000082dc munmap
0x0000000000008310 get_sys_munmap
0x00000000000082c4 getpid
0x00000000000082d4 readlink
0x0000000000008330 __udivsi3
0x00000000000082f8 mmap
0x00000000000082ec __clear_cache
0x0000000000008318 mmap_privanon
@@ -29,18 +30,18 @@ TARGET(elf32-bigarm)
0x0000000000008330 div10
0x00000000000082e4 mprotect
0x00000000000082b4 close
.text 0x000000000000838c 0x79c tmp/armeb.v4a-linux.elf-main.o
.text 0x000000000000838c 0x7a4 tmp/armeb.v4a-linux.elf-main.o
0x00000000000083ac get_page_mask
0x00000000000089f4 upx_main
0x00000000000089fc upx_main
*(.data)
.data 0x0000000000008b28 0x0 tmp/armeb.v4a-linux.elf-fold.o
.data 0x0000000000008b28 0x0 tmp/armeb.v4a-linux.elf-main.o
.data 0x0000000000008b30 0x0 tmp/armeb.v4a-linux.elf-fold.o
.data 0x0000000000008b30 0x0 tmp/armeb.v4a-linux.elf-main.o
.data
.bss 0x0000000000008b28 0x0
.bss 0x0000000000008b28 0x0 tmp/armeb.v4a-linux.elf-fold.o
.bss 0x0000000000008b28 0x0 tmp/armeb.v4a-linux.elf-main.o
.bss 0x0000000000008b30 0x0
.bss 0x0000000000008b30 0x0 tmp/armeb.v4a-linux.elf-fold.o
.bss 0x0000000000008b30 0x0 tmp/armeb.v4a-linux.elf-main.o
LOAD tmp/armeb.v4a-linux.elf-fold.o
LOAD tmp/armeb.v4a-linux.elf-main.o
OUTPUT(tmp/armeb.v4a-linux.elf-fold.bin elf32-bigarm)