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-littlearm)
0x0000000000008080 . = ((0x8000 + SIZEOF_HEADERS) + 0xc)
.text 0x0000000000008080 0xb44
.text 0x0000000000008080 0xb4c
*(.text)
.text 0x0000000000008080 0x3ac tmp/arm.v5a-linux.elf-fold.o
0x0000000000008348 munmap
0x00000000000083b0 get_sys_munmap
0x000000000000830c getpid
0x0000000000008334 readlink
0x00000000000083d0 __udivsi3
0x000000000000838c mmap
0x0000000000008370 __clear_cache
0x00000000000083b8 mmap_privanon
@@ -29,18 +30,18 @@ TARGET(elf32-littlearm)
0x00000000000083d0 div10
0x000000000000835c mprotect
0x00000000000082e4 close
.text 0x000000000000842c 0x798 tmp/armel-linux.elf-main.o
.text 0x000000000000842c 0x7a0 tmp/armel-linux.elf-main.o
0x000000000000844c get_page_mask
0x0000000000008a90 upx_main
0x0000000000008a98 upx_main
*(.data)
.data 0x0000000000008bc4 0x0 tmp/arm.v5a-linux.elf-fold.o
.data 0x0000000000008bc4 0x0 tmp/armel-linux.elf-main.o
.data 0x0000000000008bcc 0x0 tmp/arm.v5a-linux.elf-fold.o
.data 0x0000000000008bcc 0x0 tmp/armel-linux.elf-main.o
.data
.bss 0x0000000000008bc4 0x0
.bss 0x0000000000008bc4 0x0 tmp/arm.v5a-linux.elf-fold.o
.bss 0x0000000000008bc4 0x0 tmp/armel-linux.elf-main.o
.bss 0x0000000000008bcc 0x0
.bss 0x0000000000008bcc 0x0 tmp/arm.v5a-linux.elf-fold.o
.bss 0x0000000000008bcc 0x0 tmp/armel-linux.elf-main.o
LOAD tmp/arm.v5a-linux.elf-fold.o
LOAD tmp/armel-linux.elf-main.o
OUTPUT(tmp/arm.v5a-linux.elf-fold.bin elf32-littlearm)