Cleanup after broken tools

zig/powerpc64le/musl newly undefined openat64; adjacent literal strings
in C source were not concatenated; comment introduced by double slash
did not ignore backslash in rest of line
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64-linux.elf-entry.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
	modified:   stub/src/upxfd_linux.c
This commit is contained in:
John Reiser
2025-03-21 13:25:02 -07:00
parent ff9d577e46
commit 071579b5b6
13 changed files with 3103 additions and 3064 deletions
+920 -916
View File
File diff suppressed because it is too large Load Diff
+1058 -1048
View File
File diff suppressed because it is too large Load Diff
+1060 -1050
View File
File diff suppressed because it is too large Load Diff
+5 -3
View File
@@ -31,9 +31,11 @@ NBPW= 4
#include "arch/mips/r3000/macros.ash"
#include "arch/mips/r3000/bits.ash"
// eglibc-2.11.1/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
// #define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
// "$14", "$15", "$24", "$25", "hi", "lo", "memory"
/*
eglibc-2.11.1/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
#define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \
"$14", "$15", "$24", "$25", "hi", "lo", "memory"
*/
.set mips1
.set noreorder
+1
View File
@@ -71,6 +71,7 @@ __NR_mprotect = 125
__NR_munmap = 91
__NR_open = 5
__NR_write = 4
__NR_openat = 286
EINVAL= 22
+3
View File
@@ -290,6 +290,7 @@ SYS_munmap= 91
SYS_ftruncate= 93
SYS_mprotect= 125
SYS_msync= 144
SYS_openat= 286
SYS_memfd_create= 360
exit: .globl exit
@@ -308,6 +309,8 @@ read: .globl read
li r0,SYS_read; 5: b 5f
open: .globl open
li r0,SYS_open; 5: b 5f
openat: .globl openat
li r0,SYS_openat; 5: b 5f
mprotect: .globl mprotect
li 0,SYS_mprotect; 5: b 5f
msync: .globl msync
+1
View File
@@ -70,6 +70,7 @@ __NR_munmap = 91
__NR_close = 6
__NR_open = 5
__NR_write = 4
__NR_openat = 286
EINVAL= 22
+4
View File
@@ -357,6 +357,7 @@ SYS_munmap= 91
SYS_ftruncate= 93
SYS_mprotect= 125
SYS_msync= 144
SYS_openat= 286
SYS_memfd_create= 360
mmap: .globl mmap
@@ -389,6 +390,9 @@ read: .globl read
li r0,SYS_read; 5: b 5f
open: .globl open
li r0,SYS_open; 5: b 5f
openat64: .globl openat64 // alias of openat because this is 64-bit already
openat: .globl openat
li r0,SYS_openat; 5: b 5f
close: .globl close
li r0,SYS_close; 5: b sysgo
+1 -2
View File
@@ -141,8 +141,7 @@ unsigned long upx_mmap_and_fd_linux( // returns (mapped_addr | (1+ fd))
if (fd < 0) {
if (-EISDIR == fd) { // no memfd_create often lacks O_TMPFILE, too
write(2, addr_string(
"UPX-5.0 wants memfd_create(), "
"or needs /dev/shm(,O_TMPFILE,)\n"), 61);
"UPX-5.0 wants memfd_create(), or needs /dev/shm(,O_TMPFILE,)\\n"), 61);
exit(127);
}
// Error from open() is unknown. Cause later SIGSEGV.
+11 -10
View File
@@ -50,23 +50,24 @@ LOAD tmp/powerpc-expand.o
LOAD tmp/powerpc-linux.elf-main2.o
OUTPUT(tmp/powerpc-linux.elf-fold.bin elf32-powerpc)
SYSCALLS 0x0000000000000000 0xf8
SYSCALLS 0x0000000000000000 0xf8 tmp/powerpc-linux.elf-fold.o
0x0000000000000050 munmap
0x00000000000000b0 memcpy
SYSCALLS 0x0000000000000000 0x100
SYSCALLS 0x0000000000000000 0x100 tmp/powerpc-linux.elf-fold.o
0x0000000000000058 munmap
0x00000000000000b8 memcpy
0x0000000000000010 readlink
0x0000000000000018 ftruncate
0x0000000000000058 mmap
0x0000000000000060 mmap
0x0000000000000028 write
0x000000000000006c memfd_create
0x0000000000000074 memfd_create
0x0000000000000030 read
0x00000000000000d4 memset
0x0000000000000048 msync
0x00000000000000f0 my_bkpt
0x00000000000000dc memset
0x0000000000000050 msync
0x00000000000000f8 my_bkpt
0x0000000000000000 exit
0x0000000000000008 brk
0x0000000000000040 openat
0x0000000000000038 open
0x0000000000000040 mprotect
0x0000000000000048 mprotect
0x0000000000000020 close
EXP_HEAD 0x0000000000000000 0xa8
+9 -7
View File
@@ -27,8 +27,8 @@ OUTPUT(tmp/powerpc64-linux.elf-fold.bin elf64-powerpc)
.bss 0x0000000000000000 0x0
.bss 0x0000000000000000 0x0 tmp/powerpc64-linux.elf-fold.o
SYSCALLS 0x0000000000000000 0x140
SYSCALLS 0x0000000000000000 0x140 tmp/powerpc64-linux.elf-fold.o
SYSCALLS 0x0000000000000000 0x148
SYSCALLS 0x0000000000000000 0x148 tmp/powerpc64-linux.elf-fold.o
0x0000000000000008 mmap
0x0000000000000020 munmap
0x0000000000000028 mprotect
@@ -40,11 +40,13 @@ SYSCALLS 0x0000000000000000 0x140
0x0000000000000058 write
0x0000000000000060 read
0x0000000000000068 open
0x0000000000000070 close
0x0000000000000078 upxfd_create
0x00000000000000d0 memfd_create
0x0000000000000114 memcpy
0x0000000000000138 my_bkpt
0x0000000000000070 openat64
0x0000000000000070 openat
0x0000000000000078 close
0x0000000000000080 upxfd_create
0x00000000000000d8 memfd_create
0x000000000000011c memcpy
0x0000000000000140 my_bkpt
.comment 0x0000000000000000 0x33
.comment 0x0000000000000000 0x33 tmp/powerpc64-linux.elf-fold.o
+9 -7
View File
@@ -27,8 +27,8 @@ OUTPUT(tmp/powerpc64le-linux.elf-fold.bin elf64-powerpcle)
.bss 0x0000000000000000 0x0
.bss 0x0000000000000000 0x0 tmp/powerpc64le-linux.elf-fold.o
SYSCALLS 0x0000000000000000 0x140
SYSCALLS 0x0000000000000000 0x140 tmp/powerpc64le-linux.elf-fold.o
SYSCALLS 0x0000000000000000 0x148
SYSCALLS 0x0000000000000000 0x148 tmp/powerpc64le-linux.elf-fold.o
0x0000000000000008 mmap
0x0000000000000020 munmap
0x0000000000000028 mprotect
@@ -40,11 +40,13 @@ SYSCALLS 0x0000000000000000 0x140
0x0000000000000058 write
0x0000000000000060 read
0x0000000000000068 open
0x0000000000000070 close
0x0000000000000078 upxfd_create
0x00000000000000d0 memfd_create
0x0000000000000114 memcpy
0x0000000000000138 my_bkpt
0x0000000000000070 openat64
0x0000000000000070 openat
0x0000000000000078 close
0x0000000000000080 upxfd_create
0x00000000000000d8 memfd_create
0x000000000000011c memcpy
0x0000000000000140 my_bkpt
.comment 0x0000000000000000 0x33
.comment 0x0000000000000000 0x33 tmp/powerpc64le-linux.elf-fold.o