Syscall on powerpc linux wipes arg registers, unlike x86_64

Also squeaky-clean 'get_page_mask' for I/D cache consistency.
https://github.com/upx/upx/issues/813

	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
This commit is contained in:
John Reiser
2024-04-21 19:46:05 -07:00
committed by Markus F.X.J. Oberhumer
parent 9d26713b1a
commit 9fb64ded10
6 changed files with 467 additions and 462 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ Idx Name Size VMA LMA File off Algn Flags
9 NRV_TAIL 01c 0 0 01788 2**0 CONTENTS
10 CFLUSH 024 0 0 017a4 2**0 CONTENTS
11 ELFMAINY 012 0 0 017c8 2**0 CONTENTS
12 ELFMAINZ 0124 0 0 017da 2**0 CONTENTS
12 ELFMAINZ 0118 0 0 017da 2**0 CONTENTS
SYMBOL TABLE:
00000000 l d LZMA_DEC30 0 LZMA_DEC30
00000000 l d NRV_TAIL 0 NRV_TAIL
@@ -34,7 +34,7 @@ SYMBOL TABLE:
RELOCATION RECORDS FOR [ELFMAINX]:
OFFSET TYPE VALUE
00000000 R_PPC_REL24 ELFMAINZ+0x000000dc
00000000 R_PPC_REL24 ELFMAINZ+0x000000d0
RELOCATION RECORDS FOR [NRV2E]:
OFFSET TYPE VALUE
@@ -58,4 +58,4 @@ OFFSET TYPE VALUE
RELOCATION RECORDS FOR [ELFMAINZ]:
OFFSET TYPE VALUE
00000120 R_PPC_ADDR32 O_BINFO
00000114 R_PPC_ADDR32 O_BINFO
+23 -23
View File
@@ -9,35 +9,35 @@ Linker script and memory map
TARGET(elf32-powerpc)
0x0000000000100080 . = ((0x100000 + SIZEOF_HEADERS) + 0xc)
.text 0x0000000000100080 0x10ec
.text 0x0000000000100080 0x1100
*(.text)
.text 0x0000000000100080 0x290 tmp/powerpc-linux.elf-fold.o
0x0000000000100080 get_page_mask
0x0000000000100300 munmap
0x00000000001002d0 readlink
0x00000000001002ac mmap
0x00000000001002d8 write
0x00000000001002e0 read
0x0000000000100308 my_bkpt
0x0000000000100298 Pprotect
0x00000000001002c0 exit
0x00000000001002c8 brk
0x00000000001002e8 open
0x00000000001002f8 mprotect
0x00000000001002f0 close
.text 0x0000000000100310 0xe5c tmp/powerpc-linux.elf-main.o
0x0000000000100f6c upx_main
.text 0x0000000000100080 0x2a4 tmp/powerpc-linux.elf-fold.o
0x0000000000100084 get_page_mask
0x0000000000100314 munmap
0x00000000001002e4 readlink
0x00000000001002c0 mmap
0x00000000001002ec write
0x00000000001002f4 read
0x000000000010031c my_bkpt
0x00000000001002ac Pprotect
0x00000000001002d4 exit
0x00000000001002dc brk
0x00000000001002fc open
0x000000000010030c mprotect
0x0000000000100304 close
.text 0x0000000000100324 0xe5c tmp/powerpc-linux.elf-main.o
0x0000000000100f80 upx_main
*(.data)
.data 0x000000000010116c 0x0 tmp/powerpc-linux.elf-fold.o
.data 0x000000000010116c 0x0 tmp/powerpc-linux.elf-main.o
.data 0x0000000000101180 0x0 tmp/powerpc-linux.elf-fold.o
.data 0x0000000000101180 0x0 tmp/powerpc-linux.elf-main.o
.data
.bss 0x000000000010116c 0x0
.bss 0x000000000010116c 0x0 tmp/powerpc-linux.elf-fold.o
.bss 0x000000000010116c 0x0 tmp/powerpc-linux.elf-main.o
.bss 0x0000000000101180 0x0
.bss 0x0000000000101180 0x0 tmp/powerpc-linux.elf-fold.o
.bss 0x0000000000101180 0x0 tmp/powerpc-linux.elf-main.o
.rela.dyn 0x000000000010116c 0x0
.rela.dyn 0x0000000000101180 0x0
.rela.text 0x0000000000000000 0x0 tmp/powerpc-linux.elf-fold.o
LOAD tmp/powerpc-linux.elf-fold.o
LOAD tmp/powerpc-linux.elf-main.o