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
+30 -30
View File
@@ -6,41 +6,41 @@ Name Origin Length Attributes
Linker script and memory map
TARGET(elf32-littlearm)
0x0000000000008080 . = ((0x8000 + SIZEOF_HEADERS) + 0xc)
0x0000000000008040 . = ((0x8000 + SIZEOF_HEADERS) + 0xc)
.text 0x0000000000008080 0xaa8
.text 0x0000000000008040 0xab0
*(.text)
.text 0x0000000000008080 0x30c tmp/arm.v4a-linux.elf-fold.o
0x00000000000082dc munmap
0x0000000000008310 get_sys_munmap
0x00000000000082c4 getpid
0x00000000000082d4 readlink
0x00000000000082f8 mmap
0x00000000000082ec __clear_cache
0x0000000000008318 mmap_privanon
0x00000000000082a4 write
0x000000000000829c read
0x00000000000082bc unlink
0x0000000000008290 my_bkpt
0x0000000000008298 exit
0x00000000000082cc brk
0x00000000000082ac open
0x0000000000008330 div10
0x00000000000082e4 mprotect
0x00000000000082b4 close
.text 0x000000000000838c 0x79c tmp/arm.v4a-linux.elf-main.o
0x00000000000083ac get_page_mask
0x00000000000089f4 upx_main
.text 0x0000000000008040 0x30c tmp/arm.v4a-linux.elf-fold.o
0x0000000000008250 my_bkpt
0x0000000000008258 exit
0x000000000000825c read
0x0000000000008264 write
0x000000000000826c open
0x0000000000008274 close
0x000000000000827c unlink
0x0000000000008284 getpid
0x000000000000828c brk
0x0000000000008294 readlink
0x000000000000829c munmap
0x00000000000082a4 mprotect
0x00000000000082ac __clear_cache
0x00000000000082b8 mmap
0x00000000000082d0 get_sys_munmap
0x00000000000082d8 mmap_privanon
0x00000000000082f0 __udivsi3
0x00000000000082f0 div10
.text 0x000000000000834c 0x7a4 tmp/arm.v4a-linux.elf-main.o
0x000000000000836c get_page_mask
0x00000000000089bc upx_main
*(.data)
.data 0x0000000000008b28 0x0 tmp/arm.v4a-linux.elf-fold.o
.data 0x0000000000008b28 0x0 tmp/arm.v4a-linux.elf-main.o
.data 0x0000000000008af0 0x0 tmp/arm.v4a-linux.elf-fold.o
.data 0x0000000000008af0 0x0 tmp/arm.v4a-linux.elf-main.o
.data
.bss 0x0000000000008b28 0x0
.bss 0x0000000000008b28 0x0 tmp/arm.v4a-linux.elf-fold.o
.bss 0x0000000000008b28 0x0 tmp/arm.v4a-linux.elf-main.o
LOAD tmp/arm.v4a-linux.elf-fold.o
LOAD tmp/arm.v4a-linux.elf-main.o
OUTPUT(tmp/arm.v4a-linux.elf-fold.bin elf32-littlearm)
.bss 0x0000000000000000 0x0
.bss 0x0000000000000000 0x0 tmp/arm.v4a-linux.elf-fold.o
.bss 0x0000000000000000 0x0 tmp/arm.v4a-linux.elf-main.o