Each PROT_WRITE segment has implicit .bss on end of last page (64-bit only for now);

Also  workaround kernel bug invoking the escape hatch on arm64 (aarch64).
https://github.com/upx/upx/issues/611
This commit is contained in:
John Reiser
2022-10-27 11:01:37 -07:00
committed by Markus F.X.J. Oberhumer
parent 7dd2cdea1e
commit 50a6698715
10 changed files with 645 additions and 589 deletions
+30 -30
View File
@@ -9,7 +9,7 @@ Linker script and memory map
TARGET(elf64-powerpcle)
0x00000000001000bc . = ((0x100000 + SIZEOF_HEADERS) + 0xc)
.text 0x00000000001000bc 0xbb8
.text 0x00000000001000bc 0xba4
*(.text)
.text 0x00000000001000bc 0x328 tmp/powerpc64le-linux.elf-fold.o
0x00000000001000bc get_page_mask
@@ -23,47 +23,47 @@ TARGET(elf64-powerpcle)
0x00000000001003cc mprotect
0x00000000001003d4 munmap
0x00000000001003dc my_bkpt
.text 0x00000000001003e4 0x890 tmp/powerpc64le-linux.elf-main.o
.text 0x00000000001003e4 0x87c tmp/powerpc64le-linux.elf-main.o
*(.data)
.data 0x0000000000100c74 0x0 tmp/powerpc64le-linux.elf-fold.o
.data 0x0000000000100c74 0x0 tmp/powerpc64le-linux.elf-main.o
.data 0x0000000000100c60 0x0 tmp/powerpc64le-linux.elf-fold.o
.data 0x0000000000100c60 0x0 tmp/powerpc64le-linux.elf-main.o
.sfpr 0x0000000000100c74 0xa4
.sfpr 0x0000000000100c74 0xa4 linker stubs
0x0000000000100c74 _savegpr0_14
0x0000000000100c9c _savegpr0_24
0x0000000000100cac _savegpr0_28
0x0000000000100cc4 _restgpr0_14
0x0000000000100cec _restgpr0_24
0x0000000000100cfc _restgpr0_28
.sfpr 0x0000000000100c60 0xa4
.sfpr 0x0000000000100c60 0xa4 linker stubs
0x0000000000100c60 _savegpr0_14
0x0000000000100c88 _savegpr0_24
0x0000000000100c98 _savegpr0_28
0x0000000000100cb0 _restgpr0_14
0x0000000000100cd8 _restgpr0_24
0x0000000000100ce8 _restgpr0_28
.glink 0x0000000000100d18 0x0
.glink 0x0000000000100d18 0x0 linker stubs
.glink 0x0000000000100d08 0x0
.glink 0x0000000000100d08 0x0 linker stubs
.eh_frame 0x0000000000100d18 0x0
.eh_frame 0x0000000000100d18 0x0 linker stubs
.eh_frame 0x0000000000100d04 0x0
.eh_frame 0x0000000000100d04 0x0 linker stubs
.rela.dyn 0x0000000000100d18 0x0
.rela.iplt 0x0000000000100d18 0x0 linker stubs
.rela.dyn 0x0000000000100d08 0x0
.rela.iplt 0x0000000000100d08 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 0x0000000000100d18 0x0
.branch_lt 0x0000000000100d18 0x0 linker stubs
.branch_lt 0x0000000000100d08 0x0
.branch_lt 0x0000000000100d08 0x0 linker stubs
.toc 0x0000000000100d18 0x0
.toc 0x0000000000100d18 0x0 tmp/powerpc64le-linux.elf-main.o
.toc 0x0000000000100d08 0x0
.toc 0x0000000000100d08 0x0 tmp/powerpc64le-linux.elf-main.o
.opd 0x0000000000100d18 0x58
.opd 0x0000000000100d18 0x58 tmp/powerpc64le-linux.elf-main.o
0x0000000000100d58 upx_main
.opd 0x0000000000100d08 0x58
.opd 0x0000000000100d08 0x58 tmp/powerpc64le-linux.elf-main.o
0x0000000000100d48 upx_main
.iplt 0x0000000000100d70 0x0
.iplt 0x0000000000100d70 0x0 linker stubs
.iplt 0x0000000000100d60 0x0
.iplt 0x0000000000100d60 0x0 linker stubs
.bss 0x0000000000100d70 0x0
.bss 0x0000000000100d70 0x0 tmp/powerpc64le-linux.elf-fold.o
.bss 0x0000000000100d70 0x0 tmp/powerpc64le-linux.elf-main.o
.bss 0x0000000000100d60 0x0
.bss 0x0000000000100d60 0x0 tmp/powerpc64le-linux.elf-fold.o
.bss 0x0000000000100d60 0x0 tmp/powerpc64le-linux.elf-main.o