/proc/self/exe now is optional

... for the benefit of 'unshare', 'chroot', etc.
If not present, then upx run-time stub unmaps all pages of original main program.
https://github.com/upx/upx/issues/721

	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh

           ... plus all associaed *.h, *.map, *.dump in stub/
This commit is contained in:
John Reiser
2023-10-30 08:23:52 -07:00
parent f62576a2be
commit 52400e2561
43 changed files with 4302 additions and 4340 deletions
+42 -42
View File
@@ -9,62 +9,62 @@ Linker script and memory map
TARGET(elf64-powerpcle)
0x00000000001000bc . = ((0x100000 + SIZEOF_HEADERS) + 0xc)
.text 0x00000000001000bc 0xbfc
.text 0x00000000001000bc 0xc04
*(.text)
.text 0x00000000001000bc 0x340 tmp/powerpc64le-linux.elf-fold.o
.text 0x00000000001000bc 0x348 tmp/powerpc64le-linux.elf-fold.o
0x00000000001000bc get_page_mask
0x000000000010038c mmap
0x00000000001003a4 Pprotect
0x00000000001003a4 mprotect
0x00000000001003bc exit
0x00000000001003c4 brk
0x00000000001003cc readlink
0x00000000001003d4 read
0x00000000001003dc open
0x00000000001003e4 close
0x00000000001003ec munmap
0x00000000001003f4 my_bkpt
.text 0x00000000001003fc 0x8bc tmp/powerpc64le-linux.elf-main.o
0x0000000000100394 mmap
0x00000000001003ac Pprotect
0x00000000001003ac mprotect
0x00000000001003c4 exit
0x00000000001003cc brk
0x00000000001003d4 readlink
0x00000000001003dc read
0x00000000001003e4 open
0x00000000001003ec close
0x00000000001003f4 munmap
0x00000000001003fc my_bkpt
.text 0x0000000000100404 0x8bc tmp/powerpc64le-linux.elf-main.o
*(.data)
.data 0x0000000000100cb8 0x0 tmp/powerpc64le-linux.elf-fold.o
.data 0x0000000000100cb8 0x0 tmp/powerpc64le-linux.elf-main.o
.data 0x0000000000100cc0 0x0 tmp/powerpc64le-linux.elf-fold.o
.data 0x0000000000100cc0 0x0 tmp/powerpc64le-linux.elf-main.o
.sfpr 0x0000000000100cb8 0xa4
.sfpr 0x0000000000100cb8 0xa4 linker stubs
0x0000000000100cb8 _savegpr0_14
0x0000000000100ce0 _savegpr0_24
0x0000000000100cf0 _savegpr0_28
0x0000000000100d08 _restgpr0_14
0x0000000000100d30 _restgpr0_24
0x0000000000100d40 _restgpr0_28
.sfpr 0x0000000000100cc0 0xa4
.sfpr 0x0000000000100cc0 0xa4 linker stubs
0x0000000000100cc0 _savegpr0_14
0x0000000000100ce8 _savegpr0_24
0x0000000000100cf8 _savegpr0_28
0x0000000000100d10 _restgpr0_14
0x0000000000100d38 _restgpr0_24
0x0000000000100d48 _restgpr0_28
.glink 0x0000000000100d60 0x0
.glink 0x0000000000100d60 0x0 linker stubs
.glink 0x0000000000100d68 0x0
.glink 0x0000000000100d68 0x0 linker stubs
.eh_frame 0x0000000000100d5c 0x0
.eh_frame 0x0000000000100d5c 0x0 linker stubs
.eh_frame 0x0000000000100d64 0x0
.eh_frame 0x0000000000100d64 0x0 linker stubs
.rela.dyn 0x0000000000100d60 0x0
.rela.iplt 0x0000000000100d60 0x0 linker stubs
.rela.dyn 0x0000000000100d68 0x0
.rela.iplt 0x0000000000100d68 0x0 linker stubs
.data
LOAD tmp/powerpc64le-linux.elf-fold.o
LOAD tmp/powerpc64le-linux.elf-main.o
OUTPUT(tmp/powerpc64le-linux.elf-fold.bin elf64-powerpcle)
.branch_lt 0x0000000000100d60 0x0
.branch_lt 0x0000000000100d60 0x0 linker stubs
.branch_lt 0x0000000000100d68 0x0
.branch_lt 0x0000000000100d68 0x0 linker stubs
.toc 0x0000000000100d60 0x0
.toc 0x0000000000100d60 0x0 tmp/powerpc64le-linux.elf-main.o
.toc 0x0000000000100d68 0x0
.toc 0x0000000000100d68 0x0 tmp/powerpc64le-linux.elf-main.o
.opd 0x0000000000100d60 0x58
.opd 0x0000000000100d60 0x58 tmp/powerpc64le-linux.elf-main.o
0x0000000000100da0 upx_main
.opd 0x0000000000100d68 0x58
.opd 0x0000000000100d68 0x58 tmp/powerpc64le-linux.elf-main.o
0x0000000000100da8 upx_main
.iplt 0x0000000000100db8 0x0
.iplt 0x0000000000100db8 0x0 linker stubs
.iplt 0x0000000000100dc0 0x0
.iplt 0x0000000000100dc0 0x0 linker stubs
.bss 0x0000000000100db8 0x0
.bss 0x0000000000100db8 0x0 tmp/powerpc64le-linux.elf-fold.o
.bss 0x0000000000100db8 0x0 tmp/powerpc64le-linux.elf-main.o
.bss 0x0000000000100dc0 0x0
.bss 0x0000000000100dc0 0x0 tmp/powerpc64le-linux.elf-fold.o
.bss 0x0000000000100dc0 0x0 tmp/powerpc64le-linux.elf-main.o