diff --git a/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh b/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh index 1515a53a..7b5ebb4a 100644 --- a/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh +++ b/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh @@ -89,7 +89,7 @@ dec92f4426cd66ad46e1c55baea771c215c8d7459f3ee20402a4d3badec2b346 *mips-linux.elf 1074ed555a78cf8cf64f1eb63b4e53aa8f7722b84e43d2e93584f15cb673dafb *mipsel-linux.elf/upx-3.95 b187d0fe62676798cc18ecd13102ca3bf579cacc1972d5ad8c4f8ab3b557673a *powerpc-linux.elf/upx-3.91 aa75c8bb1a8f5b03ae2930447b4269d32abbe908a2c36f86b42f4b22099e3fc5 *powerpc-linux.elf/upx-3.95 -7394ebc58786b7b7747c31bdc1c912836379dfe11c8083ccf2790e9be871420f *powerpc64le-linux.elf/upx-3.95 +86ad66afe70c4c976a72ed49b8cc982a07aa2c4752a8bb5bb0a1124638a2ca1a *powerpc64le-linux.elf/upx-3.95 " expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\ 76395d696c4e3fd50d1232559181f3726a4ec1845cb452ac3f85ec2b169b628d *amd64-linux.elf/upx-3.91 diff --git a/src/stub/powerpc64-darwin.dylib-entry.h b/src/stub/powerpc64-darwin.dylib-entry.h index 1a319b0f..cc930133 100644 --- a/src/stub/powerpc64-darwin.dylib-entry.h +++ b/src/stub/powerpc64-darwin.dylib-entry.h @@ -33,8 +33,8 @@ /* clang-format off */ #define STUB_POWERPC64_DARWIN_DYLIB_ENTRY_SIZE 10217 -#define STUB_POWERPC64_DARWIN_DYLIB_ENTRY_ADLER32 0x9c64043d -#define STUB_POWERPC64_DARWIN_DYLIB_ENTRY_CRC32 0x1be09522 +#define STUB_POWERPC64_DARWIN_DYLIB_ENTRY_ADLER32 0xba830437 +#define STUB_POWERPC64_DARWIN_DYLIB_ENTRY_CRC32 0x0a9d7f41 unsigned char stub_powerpc64_darwin_dylib_entry[10217] = { /* 0x0000 */ 127, 69, 76, 70, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -69,16 +69,16 @@ unsigned char stub_powerpc64_darwin_dylib_entry[10217] = { /* 0x01d0 */ 72, 0, 0,248, 57, 32, 0, 1,125, 41, 28, 44, 56, 99, 0, 4, /* 0x01e0 */ 125, 41, 73, 20,121, 41,248, 36,124, 41, 0, 64,125, 41, 72, 20, /* 0x01f0 */ 78,128, 0, 32,141, 3, 0, 1,157, 5, 0, 1,124, 41, 0, 64, -/* 0x0200 */ 125, 41, 74, 20, 65,194,255,209, 65,225,255,236, 56,224, 0, 1, +/* 0x0200 */ 125, 41, 72, 20, 65,194,255,209, 65,225,255,236, 56,224, 0, 1, /* 0x0210 */ 72, 0, 0, 20, 56,231,255,255,125, 41, 72, 21, 65,194,255,185, /* 0x0220 */ 124,231, 57, 21,125, 41, 72, 21, 65,194,255,173,124,231, 57, 21, -/* 0x0230 */ 124, 41, 0, 64,125, 41, 74, 20, 65,194,255,157, 65,192,255,216, +/* 0x0230 */ 124, 41, 0, 64,125, 41, 72, 20, 65,194,255,157, 65,192,255,216, /* 0x0240 */ 57, 0, 0, 0, 52,231,255,253, 84,231, 64, 46, 65,192, 0, 28, /* 0x0250 */ 141, 99, 0, 1,124,234, 88,249,125, 74, 14,112, 44, 42, 0, 0, /* 0x0260 */ 65,194, 0, 0, 72, 0, 0, 12,125, 41, 72, 21, 65,194,255,105, /* 0x0270 */ 125, 8, 65, 21,125, 41, 72, 21, 65,194,255, 93,125, 8, 65, 21, /* 0x0280 */ 64,130, 0, 40, 57, 0, 0, 1,125, 41, 72, 21, 65,194,255, 73, -/* 0x0290 */ 125, 8, 65, 21,124, 41, 0, 64,125, 41, 74, 20, 65,194,255, 57, +/* 0x0290 */ 125, 8, 65, 21,124, 41, 0, 64,125, 41, 72, 20, 65,194,255, 57, /* 0x02a0 */ 65,192,255,232, 57, 8, 0, 2, 32,234,250,255, 57, 8, 0, 1, /* 0x02b0 */ 125, 8, 1,148,124,234, 42, 20,125, 9, 3,166,141, 7, 0, 1, /* 0x02c0 */ 157, 5, 0, 1, 67, 32,255,248, 56,224, 1, 0,124, 7, 41,236, diff --git a/src/stub/powerpc64-darwin.macho-entry.h b/src/stub/powerpc64-darwin.macho-entry.h index a0ba2117..38edd9b5 100644 --- a/src/stub/powerpc64-darwin.macho-entry.h +++ b/src/stub/powerpc64-darwin.macho-entry.h @@ -33,8 +33,8 @@ /* clang-format off */ #define STUB_POWERPC64_DARWIN_MACHO_ENTRY_SIZE 9556 -#define STUB_POWERPC64_DARWIN_MACHO_ENTRY_ADLER32 0xd899f4f3 -#define STUB_POWERPC64_DARWIN_MACHO_ENTRY_CRC32 0xbe5b0933 +#define STUB_POWERPC64_DARWIN_MACHO_ENTRY_ADLER32 0x062df4ed +#define STUB_POWERPC64_DARWIN_MACHO_ENTRY_CRC32 0xeef8619b unsigned char stub_powerpc64_darwin_macho_entry[9556] = { /* 0x0000 */ 127, 69, 76, 70, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -68,17 +68,17 @@ unsigned char stub_powerpc64_darwin_macho_entry[9556] = { /* 0x01c0 */ 56, 99,255,255, 56,165,255,255, 57, 64,255,255, 72, 0, 0,248, /* 0x01d0 */ 57, 32, 0, 1,125, 41, 28, 44, 56, 99, 0, 4,125, 41, 73, 20, /* 0x01e0 */ 121, 41,248, 36,124, 41, 0, 64,125, 41, 72, 20, 78,128, 0, 32, -/* 0x01f0 */ 141, 3, 0, 1,157, 5, 0, 1,124, 41, 0, 64,125, 41, 74, 20, +/* 0x01f0 */ 141, 3, 0, 1,157, 5, 0, 1,124, 41, 0, 64,125, 41, 72, 20, /* 0x0200 */ 65,194,255,209, 65,225,255,236, 56,224, 0, 1, 72, 0, 0, 20, /* 0x0210 */ 56,231,255,255,125, 41, 72, 21, 65,194,255,185,124,231, 57, 21, /* 0x0220 */ 125, 41, 72, 21, 65,194,255,173,124,231, 57, 21,124, 41, 0, 64, -/* 0x0230 */ 125, 41, 74, 20, 65,194,255,157, 65,192,255,216, 57, 0, 0, 0, +/* 0x0230 */ 125, 41, 72, 20, 65,194,255,157, 65,192,255,216, 57, 0, 0, 0, /* 0x0240 */ 52,231,255,253, 84,231, 64, 46, 65,192, 0, 28,141, 99, 0, 1, /* 0x0250 */ 124,234, 88,249,125, 74, 14,112, 44, 42, 0, 0, 65,194, 0, 0, /* 0x0260 */ 72, 0, 0, 12,125, 41, 72, 21, 65,194,255,105,125, 8, 65, 21, /* 0x0270 */ 125, 41, 72, 21, 65,194,255, 93,125, 8, 65, 21, 64,130, 0, 40, /* 0x0280 */ 57, 0, 0, 1,125, 41, 72, 21, 65,194,255, 73,125, 8, 65, 21, -/* 0x0290 */ 124, 41, 0, 64,125, 41, 74, 20, 65,194,255, 57, 65,192,255,232, +/* 0x0290 */ 124, 41, 0, 64,125, 41, 72, 20, 65,194,255, 57, 65,192,255,232, /* 0x02a0 */ 57, 8, 0, 2, 32,234,250,255, 57, 8, 0, 1,125, 8, 1,148, /* 0x02b0 */ 124,234, 42, 20,125, 9, 3,166,141, 7, 0, 1,157, 5, 0, 1, /* 0x02c0 */ 67, 32,255,248, 56,224, 1, 0,124, 7, 41,236,124, 7, 26, 44, diff --git a/src/stub/powerpc64-linux.elf-entry.h b/src/stub/powerpc64-linux.elf-entry.h index c438f784..2739e373 100644 --- a/src/stub/powerpc64-linux.elf-entry.h +++ b/src/stub/powerpc64-linux.elf-entry.h @@ -33,8 +33,8 @@ /* clang-format off */ #define STUB_POWERPC64_LINUX_ELF_ENTRY_SIZE 10472 -#define STUB_POWERPC64_LINUX_ELF_ENTRY_ADLER32 0x7a3ce8ee -#define STUB_POWERPC64_LINUX_ELF_ENTRY_CRC32 0x0173bd8c +#define STUB_POWERPC64_LINUX_ELF_ENTRY_ADLER32 0x9249e8e8 +#define STUB_POWERPC64_LINUX_ELF_ENTRY_CRC32 0xee7987a3 unsigned char stub_powerpc64_linux_elf_entry[10472] = { /* 0x0000 */ 127, 69, 76, 70, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -68,17 +68,17 @@ unsigned char stub_powerpc64_linux_elf_entry[10472] = { /* 0x01c0 */ 56, 99,255,255, 56,165,255,255, 57, 64,255,255, 72, 0, 0,248, /* 0x01d0 */ 57, 32, 0, 1,125, 41, 28, 44, 56, 99, 0, 4,125, 41, 73, 20, /* 0x01e0 */ 121, 41,248, 36,124, 41, 0, 64,125, 41, 72, 20, 78,128, 0, 32, -/* 0x01f0 */ 141, 3, 0, 1,157, 5, 0, 1,124, 41, 0, 64,125, 41, 74, 20, +/* 0x01f0 */ 141, 3, 0, 1,157, 5, 0, 1,124, 41, 0, 64,125, 41, 72, 20, /* 0x0200 */ 65,194,255,209, 65,225,255,236, 56,224, 0, 1, 72, 0, 0, 20, /* 0x0210 */ 56,231,255,255,125, 41, 72, 21, 65,194,255,185,124,231, 57, 21, /* 0x0220 */ 125, 41, 72, 21, 65,194,255,173,124,231, 57, 21,124, 41, 0, 64, -/* 0x0230 */ 125, 41, 74, 20, 65,194,255,157, 65,192,255,216, 57, 0, 0, 0, +/* 0x0230 */ 125, 41, 72, 20, 65,194,255,157, 65,192,255,216, 57, 0, 0, 0, /* 0x0240 */ 52,231,255,253, 84,231, 64, 46, 65,192, 0, 28,141, 99, 0, 1, /* 0x0250 */ 124,234, 88,249,125, 74, 14,112, 44, 42, 0, 0, 65,194, 0, 0, /* 0x0260 */ 72, 0, 0, 12,125, 41, 72, 21, 65,194,255,105,125, 8, 65, 21, /* 0x0270 */ 125, 41, 72, 21, 65,194,255, 93,125, 8, 65, 21, 64,130, 0, 40, /* 0x0280 */ 57, 0, 0, 1,125, 41, 72, 21, 65,194,255, 73,125, 8, 65, 21, -/* 0x0290 */ 124, 41, 0, 64,125, 41, 74, 20, 65,194,255, 57, 65,192,255,232, +/* 0x0290 */ 124, 41, 0, 64,125, 41, 72, 20, 65,194,255, 57, 65,192,255,232, /* 0x02a0 */ 57, 8, 0, 2, 32,234,250,255, 57, 8, 0, 1,125, 8, 1,148, /* 0x02b0 */ 124,234, 42, 20,125, 9, 3,166,141, 7, 0, 1,157, 5, 0, 1, /* 0x02c0 */ 67, 32,255,248, 56,224, 1, 0,124, 7, 41,236,124, 7, 26, 44, diff --git a/src/stub/powerpc64le-linux.elf-entry.h b/src/stub/powerpc64le-linux.elf-entry.h index b2f88305..08b236e2 100644 --- a/src/stub/powerpc64le-linux.elf-entry.h +++ b/src/stub/powerpc64le-linux.elf-entry.h @@ -33,8 +33,8 @@ /* clang-format off */ #define STUB_POWERPC64LE_LINUX_ELF_ENTRY_SIZE 10175 -#define STUB_POWERPC64LE_LINUX_ELF_ENTRY_ADLER32 0x8930ab1a -#define STUB_POWERPC64LE_LINUX_ELF_ENTRY_CRC32 0xb1ef9c3e +#define STUB_POWERPC64LE_LINUX_ELF_ENTRY_ADLER32 0xa82dab14 +#define STUB_POWERPC64LE_LINUX_ELF_ENTRY_CRC32 0x2aeb381d unsigned char stub_powerpc64le_linux_elf_entry[10175] = { /* 0x0000 */ 127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -68,17 +68,17 @@ unsigned char stub_powerpc64le_linux_elf_entry[10175] = { /* 0x01c0 */ 255,255, 99, 56,255,255,165, 56,255,255, 64, 57,248, 0, 0, 72, /* 0x01d0 */ 1, 0, 32, 57, 46, 24, 41,125, 4, 0, 99, 56, 20, 73, 41,125, /* 0x01e0 */ 36,248, 41,121, 64, 0, 41,124, 20, 72, 41,125, 32, 0,128, 78, -/* 0x01f0 */ 1, 0, 3,141, 1, 0, 5,157, 64, 0, 41,124, 20, 74, 41,125, +/* 0x01f0 */ 1, 0, 3,141, 1, 0, 5,157, 64, 0, 41,124, 20, 72, 41,125, /* 0x0200 */ 209,255,194, 65,236,255,225, 65, 1, 0,224, 56, 20, 0, 0, 72, /* 0x0210 */ 255,255,231, 56, 21, 72, 41,125,185,255,194, 65, 21, 57,231,124, /* 0x0220 */ 21, 72, 41,125,173,255,194, 65, 21, 57,231,124, 64, 0, 41,124, -/* 0x0230 */ 20, 74, 41,125,157,255,194, 65,216,255,192, 65, 0, 0, 0, 57, +/* 0x0230 */ 20, 72, 41,125,157,255,194, 65,216,255,192, 65, 0, 0, 0, 57, /* 0x0240 */ 253,255,231, 52, 46, 64,231, 84, 28, 0,192, 65, 1, 0, 99,141, /* 0x0250 */ 249, 88,234,124,112, 14, 74,125, 0, 0, 42, 44, 0, 0,194, 65, /* 0x0260 */ 12, 0, 0, 72, 21, 72, 41,125,105,255,194, 65, 21, 65, 8,125, /* 0x0270 */ 21, 72, 41,125, 93,255,194, 65, 21, 65, 8,125, 40, 0,130, 64, /* 0x0280 */ 1, 0, 0, 57, 21, 72, 41,125, 73,255,194, 65, 21, 65, 8,125, -/* 0x0290 */ 64, 0, 41,124, 20, 74, 41,125, 57,255,194, 65,232,255,192, 65, +/* 0x0290 */ 64, 0, 41,124, 20, 72, 41,125, 57,255,194, 65,232,255,192, 65, /* 0x02a0 */ 2, 0, 8, 57,255,250,234, 32, 1, 0, 8, 57,148, 1, 8,125, /* 0x02b0 */ 20, 42,234,124,166, 3, 9,125, 1, 0, 7,141, 1, 0, 5,157, /* 0x02c0 */ 248,255, 32, 67, 0, 1,224, 56,236, 41, 7,124, 44, 26, 7,124, diff --git a/src/stub/powerpc64le-linux.kernel.vmlinux.h b/src/stub/powerpc64le-linux.kernel.vmlinux.h index 4c7304e9..8d0f2b1a 100644 --- a/src/stub/powerpc64le-linux.kernel.vmlinux.h +++ b/src/stub/powerpc64le-linux.kernel.vmlinux.h @@ -33,8 +33,8 @@ /* clang-format off */ #define STUB_POWERPC64LE_LINUX_KERNEL_VMLINUX_SIZE 10027 -#define STUB_POWERPC64LE_LINUX_KERNEL_VMLINUX_ADLER32 0xf3c74c75 -#define STUB_POWERPC64LE_LINUX_KERNEL_VMLINUX_CRC32 0xd3432e57 +#define STUB_POWERPC64LE_LINUX_KERNEL_VMLINUX_ADLER32 0x16c34c6f +#define STUB_POWERPC64LE_LINUX_KERNEL_VMLINUX_CRC32 0xed57bde6 unsigned char stub_powerpc64le_linux_kernel_vmlinux[10027] = { /* 0x0000 */ 127, 69, 76, 70, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -70,16 +70,16 @@ unsigned char stub_powerpc64le_linux_kernel_vmlinux[10027] = { /* 0x01e0 */ 248, 0, 0, 72, 1, 0, 32, 57, 46, 24, 41,125, 4, 0, 99, 56, /* 0x01f0 */ 20, 73, 41,125, 36,248, 41,121, 64, 0, 41,124, 20, 72, 41,125, /* 0x0200 */ 32, 0,128, 78, 1, 0, 3,141, 1, 0, 5,157, 64, 0, 41,124, -/* 0x0210 */ 20, 74, 41,125,209,255,194, 65,236,255,225, 65, 1, 0,224, 56, +/* 0x0210 */ 20, 72, 41,125,209,255,194, 65,236,255,225, 65, 1, 0,224, 56, /* 0x0220 */ 20, 0, 0, 72,255,255,231, 56, 21, 72, 41,125,185,255,194, 65, /* 0x0230 */ 21, 57,231,124, 21, 72, 41,125,173,255,194, 65, 21, 57,231,124, -/* 0x0240 */ 64, 0, 41,124, 20, 74, 41,125,157,255,194, 65,216,255,192, 65, +/* 0x0240 */ 64, 0, 41,124, 20, 72, 41,125,157,255,194, 65,216,255,192, 65, /* 0x0250 */ 0, 0, 0, 57,253,255,231, 52, 46, 64,231, 84, 28, 0,192, 65, /* 0x0260 */ 1, 0, 99,141,249, 88,234,124,112, 14, 74,125, 0, 0, 42, 44, /* 0x0270 */ 0, 0,194, 65, 12, 0, 0, 72, 21, 72, 41,125,105,255,194, 65, /* 0x0280 */ 21, 65, 8,125, 21, 72, 41,125, 93,255,194, 65, 21, 65, 8,125, /* 0x0290 */ 40, 0,130, 64, 1, 0, 0, 57, 21, 72, 41,125, 73,255,194, 65, -/* 0x02a0 */ 21, 65, 8,125, 64, 0, 41,124, 20, 74, 41,125, 57,255,194, 65, +/* 0x02a0 */ 21, 65, 8,125, 64, 0, 41,124, 20, 72, 41,125, 57,255,194, 65, /* 0x02b0 */ 232,255,192, 65, 2, 0, 8, 57,255,250,234, 32, 1, 0, 8, 57, /* 0x02c0 */ 148, 1, 8,125, 20, 42,234,124,166, 3, 9,125, 1, 0, 7,141, /* 0x02d0 */ 1, 0, 5,157,248,255, 32, 67, 0, 1,224, 56,236, 41, 7,124, diff --git a/src/stub/src/arch/powerpc/64le/nrv2d_d.S b/src/stub/src/arch/powerpc/64le/nrv2d_d.S index 0045ce13..d1ee5a85 100644 --- a/src/stub/src/arch/powerpc/64le/nrv2d_d.S +++ b/src/stub/src/arch/powerpc/64le/nrv2d_d.S @@ -59,11 +59,14 @@ eq must load next 32 bits from memory beql-: branch and link [call subroutine] if cr0 is eq, unlikely + + 'cmpld' sets EQ/NE to detect empty bit buffer, and LT/GT to detect 0/1 + 'addc' shifts left, and puts old MSB into CArry for its 0/1 data value */ -#define jnextb0y cmpld bits,hibit; add bits,bits,bits; beql- get32d; blt+ -#define jnextb0n cmpld bits,hibit; add bits,bits,bits; beql- get32d; blt- -#define jnextb1y cmpld bits,hibit; add bits,bits,bits; beql- get32d; bgt+ -#define jnextb1n cmpld bits,hibit; add bits,bits,bits; beql- get32d; bgt- +#define jnextb0y cmpld bits,hibit; addc bits,bits,bits; beql- get32d; blt+ +#define jnextb0n cmpld bits,hibit; addc bits,bits,bits; beql- get32d; blt- +#define jnextb1y cmpld bits,hibit; addc bits,bits,bits; beql- get32d; bgt+ +#define jnextb1n cmpld bits,hibit; addc bits,bits,bits; beql- get32d; bgt- #undef getnextb /* rotate next bit into bottom bit of reg, set CC on entire result */