Compare commits

...

3906 Commits

Author SHA1 Message Date
jory 3a828abcb9 An attempt to obfuscate more to get less detected as upx by AV
CI / Rebuild stubs (push) Waiting to run
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-22.04, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-24.04, true, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15-intel, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-15, g++-15, macos-26, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64, windows-11-arm, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64ec, windows-11-arm, true, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-amd64, windows-2022, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-amd64, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-i386, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (-arm64EC, /machine:arm64ec, arm64ec-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (amd64-win64-vs2025, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (arm64-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (i386-win32-vs2025, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-aarch64, -fPIE, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-x86_64, -fPIE, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (i386-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-aarch64, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-arm, arm-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-armeb, armeb-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, -fPIE, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc, powerpc-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, -fPIE, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, -fPIE, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, -fPIE, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-13, g++-13, macos-14, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-i386, windows-2022, amd64_x86, 2022) (push) Blocked by required conditions
2025-12-12 22:02:28 +01:00
jory c95ff77bed fixed broken packer
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-22.04, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-24.04, true, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15-intel, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-15, g++-15, macos-26, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64, windows-11-arm, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64ec, windows-11-arm, true, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-amd64, windows-2022, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-i386, windows-2022, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-amd64, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (-arm64EC, /machine:arm64ec, arm64ec-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (amd64-win64-vs2025, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (arm64-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (i386-win32-vs2025, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-aarch64, -fPIE, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-x86_64, -fPIE, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (i386-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-aarch64, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-arm, arm-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-armeb, armeb-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, -fPIE, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc, powerpc-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, -fPIE, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, -fPIE, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, -fPIE, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-windows-gnu) (push) Blocked by required conditions
CI / Rebuild stubs (push) Waiting to run
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-13, g++-13, macos-14, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-i386, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, powerpc64-linux-musl) (push) Blocked by required conditions
2025-12-12 19:46:23 +01:00
jory d4f43249ab feat: Improve evasion techniques
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-22.04, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-24.04, true, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15-intel, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-15, g++-15, macos-26, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64, windows-11-arm, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64ec, windows-11-arm, true, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-amd64, windows-2022, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-i386, windows-2022, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-amd64, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-i386, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (-arm64EC, /machine:arm64ec, arm64ec-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (arm64-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (i386-win32-vs2025, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-aarch64, -fPIE, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-x86_64, -fPIE, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (i386-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-aarch64, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-arm, arm-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-armeb, armeb-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, -fPIE, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc, powerpc-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, -fPIE, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, -fPIE, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, -fPIE, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-windows-gnu) (push) Blocked by required conditions
CI / Rebuild stubs (push) Waiting to run
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-13, g++-13, macos-14, true) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (amd64-win64-vs2025, windows-2025, amd64, 2022) (push) Blocked by required conditions
- Add dummy import to alter import hash
- Use common section names to avoid detection
- Modify entry point signatures for both 32-bit and 64-bit stubs
2025-12-12 19:21:24 +01:00
jory 808dd698ef Update upx_evasion.py
CI / Rebuild stubs (push) Waiting to run
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-22.04, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-24.04, true, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-13, g++-13, macos-14, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15-intel, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-15, g++-15, macos-26, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64, windows-11-arm, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64ec, windows-11-arm, true, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-amd64, windows-2022, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-i386, windows-2022, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-amd64, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-i386, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (-arm64EC, /machine:arm64ec, arm64ec-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (amd64-win64-vs2025, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (arm64-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-aarch64, -fPIE, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-x86_64, -fPIE, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (i386-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-aarch64, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-arm, arm-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-armeb, armeb-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, -fPIE, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc, powerpc-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, -fPIE, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, -fPIE, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (i386-win32-vs2025, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, -fPIE, riscv64-linux-musl) (push) Blocked by required conditions
2025-12-12 14:31:37 +00:00
jory 0a8ac15c67 added custom stub
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-22.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }}-0 (ubuntu-24.04-arm) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-22.04, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.os) }} (ubuntu-24.04, true, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-13, g++-13, macos-14, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-14, g++-14, macos-15-intel, true) (push) Blocked by required conditions
CI / ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }} (gcc-15, g++-15, macos-26, true) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64, windows-11-arm, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-11-arm64ec, windows-11-arm, true, arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-amd64, windows-2022, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2022-i386, windows-2022, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-amd64, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('{0}', matrix.name) }} (windows-2025-i386, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (amd64-win64-vs2025, windows-2025, amd64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (arm64-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (i386-win32-vs2025, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-aarch64, -fPIE, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-x86_64, -fPIE, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (i386-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-aarch64, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-arm, arm-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-armeb, armeb-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, -fPIE, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc, powerpc-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, -fPIE, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, -fPIE, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-windows-gnu) (push) Blocked by required conditions
CI / Rebuild stubs (push) Waiting to run
CI / ${{ format('windows-bh {0}', matrix.name) }} (-arm64EC, /machine:arm64ec, arm64ec-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, -fPIE, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.3.4) (push) Blocked by required conditions
2025-12-12 15:19:13 +01:00
jory 6bcfbb7c4f feat: Implement AV evasion techniques (section renaming and padding)
This commit introduces two new AV evasion techniques:
- Section renaming: UPX0, UPX1, and UPX2 sections are now renamed to .text, .data, and .rdata respectively.
- Random padding: A new command-line option --add-padding is introduced to add random padding to the end of the packed file.

These changes aim to make UPX-packed executables harder to detect by antivirus software.
2025-12-11 22:41:54 +01:00
John Reiser f3d4503e93 clang-format inconsistency
modified:   p_elf_enum.h
2025-12-10 10:33:46 -08:00
John Reiser 70cb4aadda Fix "bad slide" on 32-bit ARM shared library
https://github.com/upx/upx/issues/944
	modified:   src/p_elf_enum.h
	modified:   src/p_lx_elf.cpp
2025-12-10 10:24:53 -08:00
John Reiser 75325bf9ef bb1
modified:   src/p_lx_elf.cpp
2025-12-10 10:24:53 -08:00
Markus F.X.J. Oberhumer 669bf2251f CI updates 2025-12-10 12:30:09 +01:00
Markus F.X.J. Oberhumer 190fd76583 CI updates 2025-12-10 10:15:51 +01:00
Markus F.X.J. Oberhumer 8622e22be0 CI updates 2025-12-02 13:54:23 +01:00
Markus F.X.J. Oberhumer 139a0324b6 CI updates 2025-11-29 18:10:15 +01:00
Markus F.X.J. Oberhumer e39f2b2b2f CI updates 2025-11-29 15:12:15 +01:00
John Reiser 7a46365296 Fix unpack of PackLinuxI386 for upx version 11
Old b_info without .b_method
https://github.com/upx/upx/issues/942
        modified:   p_unix.cpp
2025-11-25 04:29:52 -08:00
Markus F.X.J. Oberhumer f83b7690e5 CI updates 2025-11-25 09:15:40 +01:00
Markus F.X.J. Oberhumer 98c00d0fcb CI updates 2025-11-08 09:05:25 +01:00
Markus F.X.J. Oberhumer b04d566b83 CI updates 2025-11-03 15:41:08 +01:00
Markus F.X.J. Oberhumer b3c765ac7c CI updates 2025-11-02 23:52:34 +01:00
Markus F.X.J. Oberhumer f7146b5af9 CI updates 2025-11-02 18:41:09 +01:00
John Reiser 5dbf94e49b Update README.SRC to enable success by newbies.
Need i386 version of zlib, updated libmfpr.so, g++ (not clang++).
https://github.com/upx/upx/issues/938
	modified:   README.SRC
2025-10-29 11:14:58 -07:00
Markus F.X.J. Oberhumer 2e39c924d5 CI updates 2025-10-29 10:03:11 +01:00
John Reiser 3068d19492 WinPE with TLS: fix relocation bugs
--strip-relocs not needed after bugfixes, but keep safety check.
Thanks to @ml1050.
https://github.com/upx/upx/issues/880
	modified:   pefile.cpp
2025-10-26 13:36:43 -07:00
Markus F.X.J. Oberhumer 09d7d08e55 all: version bump 2025-10-24 22:02:13 +02:00
Markus F.X.J. Oberhumer 31ff38049f CI updates 2025-10-24 21:53:23 +02:00
John Reiser a5f5e7fc73 WinPE: Require --strip-relocs if relocating compressed data
Thanks to @bitraid for investigating and suggestions.
https://github.com/upx/upx/issues/880
	modified:   pefile.cpp
2025-10-24 08:35:20 -07:00
Markus F.X.J. Oberhumer 3533ebe804 CI updates 2025-10-13 01:44:37 +02:00
Markus F.X.J. Oberhumer c4ed5cc159 CI updates 2025-10-11 02:59:23 +02:00
John Reiser 303ac34539 ord() not needed
modified:   scripts/bin2h.py
2025-10-10 13:34:15 -07:00
John Reiser e8947a6812 Cleanup deubg
modified:   scripts/brandelf.py
2025-10-10 13:10:14 -07:00
John Reiser 533e642945 Merge branch 'jreiser-python3a' into jreiser-python3 2025-10-10 11:50:22 -07:00
John Reiser 8ab47ba8a4 More python3
modified:   scripts/brandelf.py
	modified:   scripts/gpp_inc.py
	modified:   src/arch/i086/cleanasm.py
2025-10-10 11:43:39 -07:00
John Reiser e4c638aa73 Mixing python3 strings with bytes requires .encode and .decode
modified:   stub/scripts/bin2h.py
	modified:   stub/scripts/brandelf.py
	modified:   stub/scripts/gpp_inc.py
	modified:   stub/scripts/xstrip.py
2025-10-10 08:56:37 -07:00
John Reiser 4ec866594b Mixing python3 strings with bytes requires .encode and .decode
modified:   stub/scripts/bin2h.py
	modified:   stub/scripts/brandelf.py
	modified:   stub/scripts/gpp_inc.py
	modified:   stub/scripts/xstrip.py
2025-10-10 08:38:59 -07:00
John Reiser a3d5a0a7b8 Replace 'has_key' with 'in'
modified:   src/stub/scripts/bin2h.py
	modified:   src/stub/scripts/xstrip.py
	modified:   src/stub/src/arch/i086/cleanasm.py
2025-10-08 14:35:13 -07:00
John Reiser 59d5d25a77 python-is-python3
modified:   ci.yml
2025-10-08 14:24:32 -07:00
John Reiser e60ebd4027 install python
modified:   ci.yml
2025-10-08 14:22:12 -07:00
John Reiser 3a61782f12 no more PYTHON2
modified:   src/stub/Makefile
2025-10-08 14:18:52 -07:00
John Reiser 11041f44e6 need ../deps/packages
modified:   ci.yml
2025-10-08 14:05:01 -07:00
John Reiser 649063c8c6 ci.yml syntax
modified:   ci.yml
2025-10-08 08:40:23 -07:00
John Reiser 36271c3244 python (python3) replaces python2
https://github.com/upx/upx/issues/868
Thanks to 'tansy' for the patches to *.py .

	modified:   .github/workflows/ci.yml
	modified:   src/stub/scripts/bin2h.py
	modified:   src/stub/scripts/brandelf.py
	modified:   src/stub/scripts/gpp_inc.py
	modified:   src/stub/scripts/xstrip.py
	modified:   src/stub/src/arch/i086/cleanasm.py
	modified:   src/stub/src/arch/i086/wdis2gas.py
2025-10-08 08:32:24 -07:00
Markus F.X.J. Oberhumer 3c3caaa567 CI updates 2025-10-07 22:00:31 +02:00
Markus F.X.J. Oberhumer d3504d8af2 CI updates 2025-10-05 13:17:03 +02:00
Markus F.X.J. Oberhumer 12d1c6bbda CI updates 2025-09-30 20:38:33 +02:00
Markus F.X.J. Oberhumer 466ceb4a1f CI updates 2025-09-18 12:03:48 +02:00
John Reiser 3b71139426 WIP Propagate CETCOMPAT flag for PeFile.
https://github.com/upx/upx/issues/909
	modified:   pefile.cpp
	modified:   pefile.h
2025-09-13 15:50:01 -07:00
Markus F.X.J. Oberhumer b11f043d64 CI updates 2025-09-10 11:11:51 +02:00
John Reiser aef93548f9 Fix memfd_create in shared libraries on amd64 Linux < kernel 6.3
https://github.com/upx/upx/issues/929
	modified:   stub/src/amd64-linux.elf-so_fold.S
           plus generated .h .dump
2025-09-09 14:58:00 -07:00
John Reiser 26ca21f6cb arm.v4a: cancel_sigsegv
modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/src/arm.v4a-linux.elf-entry.S
	modified:   src/stub/src/arm.v4a-linux.elf-fold.S
           plus generated .h .dump .map
2025-08-21 06:19:21 -07:00
Markus F.X.J. Oberhumer 404fb48668 CI updates 2025-08-21 00:21:15 +02:00
John Reiser e85e8bec5d New option --catch-sigsegv on amd64, arm64, arm.v4a
Catch SIGSEGV during de-compression, and print state info
("auto debug") using /proc/self/maps and gdb.
This was motivated by suspicion of unreliable hardware
which triggered "Heisenbugs": a crash which cannot be reproduced.
If SIGSGV occurs without the "auto debug" info, then that
implies an error user code after de-compression, often when
user code accesses /proc/self/exe, which is not the un-compressed file.
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/help.cpp
	modified:   src/main.cpp
	modified:   src/options.h
	modified:   src/p_lx_elf.cpp
	modified:   src/stub/Makefile
	modified:   src/stub/src/amd64-linux.elf-entry.S
	modified:   src/stub/src/amd64-linux.elf-fold.S
	modified:   src/stub/src/arm.v4a-linux.elf-entry.S
	modified:   src/stub/src/arm.v4a-linux.elf-fold.S
	modified:   src/stub/src/arm64-linux.elf-entry.S
	modified:   src/stub/src/arm64-linux.elf-fold.S
           plus generated .h .dump .map
2025-08-19 12:25:33 -07:00
John Reiser 4530e5c264 Fix upxfd_create for stubs on PowerPC64
https://github.com/upx/upx/issues/925
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/src/powerpc64-linux.elf-fold.S
           plus generated .h
2025-08-16 16:00:11 -07:00
Markus F.X.J. Oberhumer 1188d2933b SIGSEGV: handle and pretty-print on arm64-linux 2025-08-10 09:55:12 +02:00
Markus F.X.J. Oberhumer 4e88556c94 SIGSEGV: handle and pretty-print on amd64-linux 2025-08-10 09:39:29 +02:00
Markus F.X.J. Oberhumer 1f0036a460 CI updates 2025-08-10 09:05:14 +02:00
Markus F.X.J. Oberhumer 5d30472ee2 CI updates 2025-08-04 16:05:44 +02:00
Markus F.X.J. Oberhumer 9866b9bca9 SIGSEGV: handle and pretty-print on amd64-linux 2025-08-01 00:49:27 +02:00
Markus F.X.J. Oberhumer bbf52cee67 CI updates 2025-07-30 23:09:28 +02:00
Markus F.X.J. Oberhumer b9b77965b7 CI updates 2025-07-30 01:40:30 +02:00
Markus F.X.J. Oberhumer 852666010e CI updates 2025-07-29 19:50:17 +02:00
John Reiser bbb886ae4d gcc 14.2.1-3 lax on signed-vs-unsigned compare
modified:   p_lx_elf.cpp
2025-07-25 07:14:33 -07:00
John Reiser b52d3e0772 Detect DT_HASH chain out-of-bounds
https://issues.oss-fuzz.com/u/1/issues/430110068
	modified:   p_lx_elf.cpp
2025-07-24 11:09:58 -07:00
Markus F.X.J. Oberhumer 27f8f4f62e CI updates 2025-07-25 18:20:14 +02:00
Markus F.X.J. Oberhumer 21ec7e7410 CI updates 2025-07-25 10:03:28 +02:00
Markus F.X.J. Oberhumer ae6d5303ba CI updates 2025-07-25 03:07:51 +02:00
Markus F.X.J. Oberhumer fbbc2bc874 CI updates 2025-07-23 14:33:29 +02:00
Markus F.X.J. Oberhumer 62f22d61e6 CI updates 2025-07-23 11:00:41 +02:00
Markus F.X.J. Oberhumer 3f1f76f8a3 CI updates 2025-07-21 15:57:03 +02:00
Markus F.X.J. Oberhumer 518712c613 CI updates 2025-07-21 12:26:30 +02:00
Markus F.X.J. Oberhumer c0c08c9f43 all: post-release version bump 2025-07-20 15:59:04 +02:00
Markus F.X.J. Oberhumer c4113b6bd6 all: prepare for release 2025-07-20 14:41:25 +02:00
Markus F.X.J. Oberhumer 4988868e61 CI updates 2025-07-20 13:58:38 +02:00
Markus F.X.J. Oberhumer 5a513ab16f CI updates 2025-07-20 12:21:56 +02:00
Markus F.X.J. Oberhumer f1a9d1bec9 CI updates 2025-07-20 00:38:43 +02:00
Markus F.X.J. Oberhumer 70a3acfded CI updates 2025-07-18 20:17:11 +02:00
Markus F.X.J. Oberhumer 3ec6a3cce0 CI updates 2025-07-18 12:42:37 +02:00
Markus F.X.J. Oberhumer dd0a8856cc CI updates 2025-07-18 11:44:36 +02:00
Markus F.X.J. Oberhumer c51a1130b8 CI updates 2025-07-17 20:47:19 +02:00
Markus F.X.J. Oberhumer 9851fba246 CI updates 2025-07-17 15:46:12 +02:00
Markus F.X.J. Oberhumer 8054543671 CI updates 2025-07-15 10:55:39 +02:00
Markus F.X.J. Oberhumer 17d0e897ba CI updates 2025-07-15 09:56:46 +02:00
Markus F.X.J. Oberhumer a7940fd19b CI updates 2025-07-07 18:01:00 +02:00
John Reiser 1fbd34035e shell trap on ERR to help locate failing commands
modified:   misc/testsuite/mimic_ctest.sh
2025-07-06 19:21:26 -07:00
John Reiser 945d9157fa PowerPC64 editing error affecting -fPIE
https://github.com/upx/upx/issues/918
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/powerpc64-linux.elf-fold.S
          plus generated powerpc64*-linux.elf-fold.h
2025-07-05 18:10:46 -07:00
Markus F.X.J. Oberhumer 915bfbd82e CI updates 2025-07-05 22:23:13 +02:00
Markus F.X.J. Oberhumer ef01a73e8f CI updates 2025-06-26 11:54:26 +02:00
Markus F.X.J. Oberhumer 7e4e6a3cb1 CI updates 2025-06-26 11:30:46 +02:00
Markus F.X.J. Oberhumer ca97430db2 CI updates 2025-06-06 12:25:13 +02:00
Markus F.X.J. Oberhumer 7530643d1d CI updates 2025-06-01 14:55:43 +02:00
Markus F.X.J. Oberhumer 073cdb0d58 CI updates 2025-06-01 14:11:05 +02:00
Markus F.X.J. Oberhumer 9a93b5d1c1 CI updates 2025-05-31 15:44:22 +02:00
Markus F.X.J. Oberhumer 44ce469b84 CI updates 2025-05-31 13:54:04 +02:00
Markus F.X.J. Oberhumer 4d8d330f21 CI updates 2025-05-30 18:31:56 +02:00
Markus F.X.J. Oberhumer 793e1622ea CI updates 2025-05-29 12:04:43 +02:00
Markus F.X.J. Oberhumer 92a33fa0cc CI updates 2025-05-25 10:12:35 +02:00
John Reiser e8c49a2c35 Prevent SIGSEGV on de-compress of modified PE file
https://github.com/upx/upx/issues/863
	modified:   pefile.cpp
2025-05-13 10:51:59 -07:00
Markus F.X.J. Oberhumer d2e9db7112 CI updates 2025-05-10 13:55:49 +02:00
John Reiser b728b0e021 buildLinuxLoader needs more space
for shlib + lzma + Android
https://github.com/upx/upx/issues/913
	modified:   p_lx_elf.cpp
2025-05-07 13:52:58 -07:00
John Reiser a1ef410509 ELF DT_DYNSYM: fix checking of symbol table
Particularly JNI_OnLoad
https://github.com/upx/upx/issues/914
	modified:   p_lx_elf.cpp
2025-05-07 17:02:56 -07:00
Markus F.X.J. Oberhumer 24b4ec42e7 CI updates 2025-05-07 19:11:57 +02:00
Markus F.X.J. Oberhumer 52dde5789e all: post-release version bump 2025-05-06 14:01:35 +02:00
Markus F.X.J. Oberhumer 730c6ce6c5 all: prepare for release 2025-05-06 12:19:16 +02:00
Markus F.X.J. Oberhumer 5ed1d5b2b3 src/stub: fix ET_DYN with non-zero PT_LOAD[0].p_vaddr 2025-05-01 20:42:39 +02:00
Markus F.X.J. Oberhumer 23c70ec447 src/stub: fix ET_DYN with non-zero PT_LOAD[0].p_vaddr 2025-05-01 20:37:36 +02:00
Markus F.X.J. Oberhumer e29e73a4e4 src/help.cpp: mention --fileinfo 2025-05-01 20:33:34 +02:00
Markus F.X.J. Oberhumer 27289a7589 src/stub: flush datacache before msync 2025-04-29 17:53:33 +02:00
Markus F.X.J. Oberhumer e509bb87e9 src/stub: flush datacache before msync 2025-04-29 17:44:47 +02:00
Markus F.X.J. Oberhumer 5cec09966e submodules: update for new versions 2025-04-22 15:44:29 +02:00
Markus F.X.J. Oberhumer b5789fb321 src: minor cleanups 2025-04-21 14:04:27 +02:00
Markus F.X.J. Oberhumer a1b0fd987f CI updates 2025-04-20 15:46:19 +02:00
Markus F.X.J. Oberhumer a468b92e3a PowerPC Psync flush datacache before msync 2025-04-20 15:06:58 +02:00
John Reiser ddf0b50c6d PowerPC Psync flush datacache before msync
https://github.com/upx/upx/issues/907
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
2025-04-20 14:55:06 +02:00
Markus F.X.J. Oberhumer 3af2b21869 CI updates 2025-04-11 09:41:08 +02:00
Markus F.X.J. Oberhumer c4bfebeceb CI updates 2025-04-10 20:04:34 +02:00
Markus F.X.J. Oberhumer d23484b9db CI updates 2025-04-09 11:32:13 +02:00
John Reiser 071579b5b6 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
2025-03-21 13:25:02 -07:00
John Reiser ff9d577e46 O_DIRECTORY is architecture-dependent
https://github.com/upx/upx/issues/902
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
	modified:   stub/src/upxfd_android.c
	modified:   stub/src/upxfd_linux.c
           plus generated .h .map .dump
2025-03-21 10:54:27 -07:00
John Reiser a25c20ee0b M_LZMA with hi parameter bytes confused --ultra-brute
https://github.com/upx/upx/issues/900
	modified:   packhead.cpp
	modified:   p_lx_elf.cpp
2025-03-20 09:48:00 -07:00
John Reiser ff75a462a4 Fighting over .e_shentsize
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
2025-03-18 13:48:19 -07:00
John Reiser e0b6ff1924 More checking in unpack()
https://github.com/upx/upx/issues/898
	modified:   p_lx_elf.cpp
2025-03-18 08:40:08 -07:00
John Reiser 1c5fae74e0 Fix recovery of readlink() when /proc/self/exe is missing
https://github.com/upx/upx/issues/897
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/arm.v4a-linux.elf-fold.S
           plus generated .h
2025-03-16 12:37:57 -07:00
John Reiser 6f650ca16f mips memfd_create() and syscall error handling
https://github.com/upx/upx/issues/895
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
           plus generated .h .dump .map
2025-03-13 08:07:26 -07:00
Markus F.X.J. Oberhumer c2da21ba4e CI updates 2025-03-05 12:13:21 +01:00
John Reiser 903ca50391 Workaround valgrind-3.24.0 botch of 'notrack' on i386
https://github.com/upx/upx/issues/890
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
           plus generated .h .map
2025-03-02 14:30:50 -08:00
John Reiser 70f1ab8cb7 Nice message for ancient Linux lacking memfd_create
... or O_TMPFILE for recovery using /dev/shm
https://github.com/upx/upx/issues/889
	modified:   stub/src/upxfd_linux.c
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
           plus generated  .h  .map  .dump
2025-03-02 11:46:17 -08:00
John Reiser 6998449715 Remove inline syscalls from MIPS stubs
They were a maintenance headache, especially for error handling.
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/include/linux.h
	modified:   stub/src/mips.r3000-expand.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/upxfd_android.c
2025-03-02 11:32:49 -08:00
John Reiser fb0f6c6a00 Escape hatch needs 'notrack' to enter
modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-fold.S
2025-03-02 11:22:05 -08:00
John Reiser dbde75028c Avoid corrupted P_hdr
https://issues.oss-fuzz.com/u/1/issues/398127991
	modified:   p_lx_elf.cpp
2025-03-02 11:12:08 -08:00
John Reiser 90d86ea59e Prevent leak even if corrupted input
https://issues.oss-fuzz.com/u/1/issues/42531955
	modified:   pefile.cpp
2025-02-27 17:10:52 -08:00
John Reiser 64891286ba Unpack: better checking of bounds for DT_HASH
https://issues.oss-fuzz.com/u/1/issues/398075916
	modified:   p_lx_elf.cpp
2025-02-22 07:55:14 -08:00
John Reiser e52a3ceb48 Unpack: Entire ElfXX_Ehdr must be present in de-compressed Ehdr+Phdrs
https://issues.oss-fuzz.com/u/1/issues/397728078
(previous commit: https://issues.oss-fuzz.com/u/1/issues/397500915)
	modified:   p_lx_elf.cpp
2025-02-22 07:55:14 -08:00
John Reiser 8cce9cf641 Detect bad b_info.method
https://issues.oss-fuzz.com/u/1/issues?q=upx
	modified:   p_lx_elf.cpp
	modified:   p_unix.cpp
	modified:   packhead.cpp
	modified:   packhead.h
2025-02-22 07:55:14 -08:00
Markus F.X.J. Oberhumer 896dff9619 src/check: some toolchains are buggy 2025-02-22 06:43:28 +01:00
Markus F.X.J. Oberhumer 84a0347df1 testsuite: update checksums caused by version bump 2025-02-21 00:12:41 +01:00
Markus F.X.J. Oberhumer fc5e44f391 all: post-release version bump 2025-02-20 23:56:24 +01:00
Markus F.X.J. Oberhumer 8bf49aa4f2 all: prepare for release 2025-02-20 16:02:44 +01:00
Markus F.X.J. Oberhumer b8079bb6eb CI updates 2025-02-19 16:45:44 +01:00
John Reiser 5dcad7a387 Mention ELF work
modified:   NEWS
2025-02-18 08:26:30 -08:00
John Reiser 83e5f74b3d Compiler different type checking
modified:   p_lx_elf.cpp
2025-02-17 09:39:55 -08:00
John Reiser 3d402134f5 Better checking of DT_GNU_HASH during de-compression
https://issues.oss-fuzz.com/u/1/issues/396167884
	modified:   p_lx_elf.cpp
2025-02-17 09:14:19 -08:00
John Reiser b8b64a3e0f Fuzz nuisance: wild p_info for de-compression
https://issues.oss-fuzz.com/u/1/issues/383200048
	modified:   p_lx_elf.cpp
2025-02-17 08:26:17 -08:00
John Reiser c0bf7bf9ab Old powerpc* kernels lack MFD_EXEC
For example: Debian 3.16.43-2+deb8u5 (2017-09-19)
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/Makefile
	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
           plus generated .h, .dump, .map
2025-02-16 15:33:58 -08:00
John Reiser 0144f81c28 Cleanup stub for arm64 shared library
modified:   stub/arm64-linux.elf-so_entry.h
	modified:   stub/src/arm64-linux.elf-so_entry.S
2025-02-16 08:41:50 -08:00
John Reiser 78f4959521 Fix de-compression of ELF shared libraries
Reset ph.method on each b_info.b_method.
Use file_image[] as ReadOnly, subsuming fi->seek()+read().
Use lowmem[0, +xct_off) for changing values.
Work on un_DT_INIT().
https://github.com/upx/upx/issues/882

	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2025-02-15 19:35:21 -08:00
John Reiser eff1ef2d70 Fix amd64 shared libraries
Inspired by https://github.com/upx/upx/issues/880
(https://github.com/microsoft/mimalloc.git on Linux)
but still need test case.
	modified:   p_lx_elf.cpp
	modified:   stub/amd64-linux.elf-so_entry.h
	modified:   stub/src/amd64-linux.elf-so_entry.S
2025-02-13 17:22:37 -08:00
John Reiser 782b07c752 PPC64 check ehdri.e_ident[EI_DATA], not elfout
modified:   p_lx_elf.cpp
2025-02-12 08:56:18 -08:00
John Reiser bd67677389 Honor dos_header_t.e_cparhdr for small header
... and cleanup PackDjgpp2::readFileHeader()
https://github.com/upx/upx/issues/881

	modified:   p_djgpp2.cpp
	modified:   p_djgpp2.h
2025-02-11 10:29:53 -08:00
John Reiser 8c9e04daaf Propagate .e_ident[EI_ABIVERSION]
Linux on bare metal (and explicit qemu) seems not to care,
but qemu-user-binfmt gives ENOEXEC (Exec format error)
        https://github.com/upx/upx/issues/876
2025-02-07 19:24:46 -08:00
John Reiser bddc05e787 Fix elf_lookup() defenses against fuzzed DT_HASH
modified:   p_lx_elf.cpp
2025-02-01 13:22:26 -08:00
John Reiser a49d023bd0 Detect too-short Mach_command, also be careful in recovery
fuzzing from leon.weiss AT @ruhr-uni-bochum.de
https://github.com/upx/upx/issues/875
https://github.com/upx/upx/issues/874
	modified:   p_mach.cpp
2025-01-31 11:34:48 -08:00
John Reiser 7b06ba0b78 Detect empty DT_STRTAB
https://github.com/upx/upx/issues/872
fuzzing from leon.weiss AT @ruhr-uni-bochum.de
	modified:   p_lx_elf.cpp
2025-01-31 11:32:48 -08:00
John Reiser 344b73dab0 invert_pt_dynamic defends against missing DT_STRTAB or DT_STRSIZ
https://github.com/upx/upx/issues/872
fuzzing from leon.weiss AT @ruhr-uni-bochum.de
	modified:   p_lx_elf.cpp
2025-01-30 11:42:09 -08:00
John Reiser 0870514194 elf_lookup must defend against bad chain in hash table
https://github.com/upx/upx/issues/871
fuzzing from leon.weiss AT @ruhr-uni-bochum.de
2025-01-30 10:56:45 -08:00
Markus F.X.J. Oberhumer 0a61ffea3a submodules: update for new versions 2025-01-30 00:05:15 +01:00
Markus F.X.J. Oberhumer fbc650791d CI updates 2025-01-29 22:19:21 +01:00
Markus F.X.J. Oberhumer 4b41aa1226 CI updates 2025-01-29 16:11:03 +01:00
Markus F.X.J. Oberhumer 3fd68d3ec6 CI updates 2025-01-27 18:11:44 +01:00
John Reiser d41ceb0d31 ARM64: move Psync closer to PAGE_MASK
and use 'bic' instead of 'and'
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/src/arm64-linux.elf-so_fold.S
2025-01-26 18:43:14 -08:00
John Reiser aee970e80b Allow empty .rsrc Section in PE file
https://github.com/upx/upx/issues/869
	modified:   pefile.cpp
2025-01-24 07:45:05 -08:00
Markus F.X.J. Oberhumer ef8a24ba53 CI updates. Closes #862. 2025-01-21 21:16:01 +01:00
Markus F.X.J. Oberhumer 2edf91d315 testsuite: update checksums caused by version bump 2025-01-17 22:06:55 +01:00
Markus F.X.J. Oberhumer 9fe377b288 all: version bump 2025-01-17 21:50:38 +01:00
Markus F.X.J. Oberhumer 996ca8d17d all: welcome 2025 2025-01-17 21:18:55 +01:00
Markus F.X.J. Oberhumer b356595eb5 CI updates 2025-01-17 21:15:43 +01:00
Markus F.X.J. Oberhumer e4668e5328 CI updates 2025-01-08 12:57:52 +01:00
John Reiser a846e483be clang-format uglifies again
modified:   p_w64pe_amd64.cpp
2025-01-02 12:05:59 -08:00
John Reiser f6e3df69eb stub/amd64-win64.pe.h matches upx-v4.2.4
so that anti-virus checkers of apps for 64-bit Windows that are newly-
compressed by upx should not complain about new matches with malware.
This costs a few bytes and a small fraction of cycles in NRV2
de-compressors, but is considered to be a tolerable concession
to the cesspool environment of software for Microsoft Windows.
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_w64pe_amd64.cpp   see code comments
	modified:   stub/amd64-win64.pe.h
	modified:   stub/src/arch/amd64/lzma_d.S   see code comments
	modified:   stub/src/arch/amd64/nrv2b_d.S
	modified:   stub/src/arch/amd64/nrv2d_d.S
	modified:   stub/src/arch/amd64/nrv2e_d.S
	modified:   stub/tmp/amd64-win64.pe.bin.dump
2025-01-02 11:47:34 -08:00
John Reiser 1a6c1f0589 Fix unpackExtent() of non-compressible extent (PT_LOAD)
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/amd64-linux.elf-so_entry.S
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-bsd.elf-main.c
	modified:   stub/src/i386-darwin.macho-main.c
	modified:   stub/src/i386-darwin.macho-upxmain.c
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf.interp-main.c
	modified:   stub/src/i386-linux.elf.shell-main.c
	modified:   stub/src/i386-openbsd.elf-main.c
	modified:   stub/src/powerpc-darwin.macho-main.c
	modified:   stub/src/powerpc-darwin.macho-upxmain.c
	modified:   stub/src/powerpc64-darwin.macho-main.c
            plus generated *.h  *.map  *.dump
2024-12-30 16:49:31 -08:00
John Reiser e3e5d8a3a5 Try again for Android Elfxx_Shdr
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2024-12-23 11:20:26 -08:00
John Reiser 505f6b7373 Remove PROT_WRITE from de-compressed folded code.
Safer; required for SELinux Enforcing mode;
but inhibits breakpoint debugging.
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-entry.S
2024-12-23 10:52:07 -08:00
John Reiser 7d907d9d65 is_asl handles per-file opt->o_unix.android_shlib
Also slide_sh_offset() handles so_slide.
TODO: if asl_delta, then relocate sh_offset that is above xct_off.
PT_DYNAMIC.p_offset and {.dynamic}.sh_offset must match; etc.

	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2024-12-17 17:17:24 -08:00
John Reiser d00ba4b465 Forgotten file
new file:   src/amd64-linux.elf-so_entry.lds
2024-12-12 11:13:12 -08:00
John Reiser d4deb2a100 Psync: msync demands page-aligned first argument
modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/src/amd64-linux.elf-fold.S
	modified:   src/stub/src/amd64-linux.elf-main2.c
	modified:   src/stub/src/amd64-linux.elf-so_fold.S
	modified:   src/stub/src/amd64-linux.elf-so_main.c
	modified:   src/stub/src/arm.v4a-linux.elf-entry.S
	modified:   src/stub/src/arm.v4a-linux.elf-fold.S
	modified:   src/stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   src/stub/src/arm64-linux.elf-fold.S
	modified:   src/stub/src/arm64-linux.elf-so_fold.S
	modified:   src/stub/src/i386-linux.elf-fold.S
	modified:   src/stub/src/i386-linux.elf-main2.c
	modified:   src/stub/src/i386-linux.elf-so_entry.S
	modified:   src/stub/src/i386-linux.elf-so_fold.S
	modified:   src/stub/src/i386-linux.elf-so_main.c
	modified:   src/stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   src/stub/src/powerpc-linux.elf-fold.S
	modified:   src/stub/src/powerpc64-linux.elf-fold.S
            plus stubs *.h *.dump *.map
2024-12-12 10:50:30 -08:00
John Reiser 5999b0a959 Unused get_page_mask but satisfies external for upxfd_*.c
modified:   stub/src/i386-linux.elf-entry.S
2024-12-10 17:10:27 -08:00
John Reiser e2f1e6697a Stubs for shared libraries on amd64-linux.elf and arm64-linux.elf
modified:   stub/Makefile
	modified:   stub/src/amd64-linux.elf-so_entry.S
	modified:   stub/src/amd64-linux.elf-so_fold.S
	modified:   stub/src/arm64-linux.elf-so_entry.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
	modified:   stub/src/upxfd_linux.c
2024-12-10 16:49:35 -08:00
Markus F.X.J. Oberhumer baee96347d CI updates 2024-12-11 07:54:48 +01:00
John Reiser f60d8f6d18 Fix MIPS stubs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/Makefile
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/tmp/mips.r3000-linux.elf-entry.bin.dump
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-entry.bin.dump
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
2024-12-09 14:26:00 -08:00
John Reiser d3300e9564 Sync stubs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
2024-12-09 13:33:21 -08:00
John Reiser 877390a2ba FIx MIPS stubs
modified:   stub/Makefile
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/upxfd_android.c
	modified:   stub/src/upxfd_linux.c
2024-12-09 13:26:22 -08:00
John Reiser 5afe2af365 EINVAL whitespace
modified:   src/stub/src/i386-linux.elf-so_main.c
2024-12-07 09:46:42 -08:00
John Reiser 5028d559c5 msync for *-so_fold.S
Android 14  returnes -EINVAL but can be ignored
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
2024-12-07 09:39:45 -08:00
John Reiser deda4f1bae Sync stubs
modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v4a-linux.elf-so_entry.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-so_entry.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-linux.elf-so_entry.h
	modified:   stub/i386-linux.elf-so_fold.h
            plus *.dump *.map
2024-12-07 08:56:34 -08:00
John Reiser 927a9d10a7 zig -musleabihf default -mdouble-float conflicts -msoft-float
modified:   .github/workflows/ci.yml
2024-12-07 08:53:30 -08:00
John Reiser ad96cee14c Unify prep_SELinux and upx_so_main
Also va_top, not hi_offset
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/upxfd_android.c
2024-12-07 08:43:04 -08:00
John Reiser f95bb4953f CI updates: target ".2.3.4" invalid; "*-linux-musl" appends "eabi"
modified:   ci.yml
2024-12-05 11:30:05 -08:00
John Reiser 8c594de432 Sync stubs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v4a-linux.elf-so_entry.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-so_entry.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-linux.elf-so_entry.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
            plus *.dump *.map
2024-12-05 11:08:41 -08:00
John Reiser 330ac2443c help_umf.S for MIPS and PPC
modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/mips.r3000-linux.elf-help_umf.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-help_umf.S
	new file:   stub/src/powerpc-linux.elf-help_umf.S
2024-12-05 11:06:09 -08:00
John Reiser ebe6272ac7 whitespace
modified:   stub/src/arm.v4a-linux.elf-so_fold.S
2024-12-05 08:25:02 -08:00
John Reiser 982e732b74 Allow re-ordering of functions in upxfd_android.c and upxfd_linux.c
Compiler has a mind of its own.
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	new file:   stub/src/amd64-linux.elf-help_umf.S
	modified:   stub/src/arm.v4a-expand.S
	new file:   stub/src/arm.v4a-linux.elf-help_umf.S
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	new file:   stub/src/arm.v5a-linux.elf-help_umf.S
	new file:   stub/src/arm64-linux.elf-help_umf.S
	modified:   stub/src/arm64-linux.elf-so_entry.S
	new file:   stub/src/armeb.v4a-linux.elf-help_umf.S
	new file:   stub/src/i386-linux.elf-help_umf.S
	modified:   stub/src/i386-linux.elf-so_main.c
	new file:   stub/src/mips.r3000-linux.elf-help_umf.S
	new file:   stub/src/mipsel.r3000-linux.elf-help_umf.S
	modified:   stub/src/upxfd_android.c
2024-12-04 17:00:37 -08:00
John Reiser 27de5f42bb Sync stubs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.elf-so_entry.h
	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v4a-linux.elf-so_entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-so_entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
            also *.dump, *.map
2024-12-03 11:52:13 -08:00
John Reiser 37dff58289 powerpc-linux.elf-entry.S does not need UMF_LINUX
... because it calls memfd_create directly, not via upx_mmap_and_fd.
Perhaps MIPS, foo?
	modified:   p_lx_elf.cpp
2024-12-03 11:50:21 -08:00
John Reiser fc9d90c231 Revamp building stubs for MIPS
modified:   stub/Makefile
2024-12-03 10:37:19 -08:00
John Reiser 68b31d31c3 msync() and UMF_LINUX fiddling
modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-so_fold.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-entry.lds
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
	modified:   stub/src/mips.r3000-linux.elf-entry.lds
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.lds
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/upxfd_linux.c
2024-12-03 10:36:14 -08:00
John Reiser f7f08be312 get_te64_32() fetches 64 bits, checks and returns 32
modified:   packer.h
2024-12-03 10:28:01 -08:00
John Reiser d14901548a Unique label sysgo_incl; fix #define that might capture trailing '//'
modified:   stub/src/include/linux.h
2024-12-03 10:21:07 -08:00
John Reiser 6ebdf92d40 Update ZIG version; fix extra leading space
Thomas Legris spotted the syntax error of extra space.
	modified:   .github/workflows/ci.yml
2024-12-03 10:17:36 -08:00
John Reiser abced6720b clang-format {silly)
modified:   packer.h
2024-12-02 08:08:51 -08:00
John Reiser f4604db164 Stub msync() on PF_X before munmap()
modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main2.c
	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-main2.c
	modified:   stub/src/include/linux.h
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
	modified:   stub/src/upxfd_android.c
	modified:   stub/src/upxfd_linux.c
2024-11-30 13:58:40 -08:00
John Reiser 8327c390cf Stack 0x10 aligned at all times
modified:   stub/src/arm64-expand.S
2024-11-30 13:57:46 -08:00
John Reiser bd251c0dbd Stub for 64-bit shlib
modified:   stub/Makefile
	modified:   stub/src/amd64-expand.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-so_entry.S
	modified:   stub/src/amd64-linux.elf-so_fold.S
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/arm64-expand.S
	modified:   stub/src/upxfd_linux.c
2024-11-28 19:10:27 -08:00
John Reiser d04209d30f Unify 32-bit and 64-bit ::buildLinuxLoader
modified:   p_lx_elf.cpp
2024-11-28 19:09:46 -08:00
John Reiser 8782778eb3 stub *-linux.elf-entry.S often must define label upx_mmap_and_fd
modified:   p_lx_elf.cpp
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/i386-linux.elf-entry.S
2024-11-26 19:43:14 -08:00
John Reiser c8515ae862 Unify PackLinuxElf64::pack2_shlib* with 32-bit
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2024-11-26 16:44:35 -08:00
John Reiser a2fa417af9 Unify 64-bit upx_main() stub for shlib with 32-bit i386
modified:   stub/src/amd64-linux.elf-so_main.c
2024-11-26 16:43:02 -08:00
John Reiser 93f420939e ElfW()
modified:   src/i386-linux.elf-so_main.c
2024-11-25 11:52:43 -08:00
John Reiser 88cd02d750 get_te64_32() gets 4-bit value, then detects 32-bit overflow
modified:   packer.h
2024-11-25 10:45:54 -08:00
John Reiser a35e50c02a ZIG_DIST_VERSION: 0.14.0-dev.2271+f845fa04a
modified:   ci.yml
2024-11-21 13:06:06 -08:00
John Reiser 566c1eebd2 sync stubs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2024-11-21 11:20:32 -08:00
John Reiser 65c3195b39 Cleanup stub for mips and powerpc
modified:   stub/Makefile
	modified:   stub/src/powerpc-expand.S
	modified:   stub/src/powerpc-linux.elf-fold.S
2024-11-20 15:28:41 -08:00
John Reiser 76b0b4ce9c Fix mips stub for ELF2 main program
modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/mips.r3000-expand.S
	modified:   stub/src/upxfd_linux.c
2024-11-20 15:02:32 -08:00
John Reiser 02b9ac9764 Name it upx_main2() for clarity
modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/powerpc64-linux.elf-fold.S
2024-11-20 15:00:11 -08:00
John Reiser 17b94cdfe5 Cleanup remaining *.lds linker scripts for stubs
modified:   stub/src/arm64-linux.elf-fold.lds
	modified:   stub/src/mips.r3000-linux.elf-fold.lds
	modified:   stub/src/mipsel.r3000-linux.elf-fold.lds
	modified:   stub/src/powerpc-linux.elf-fold.lds
	modified:   stub/src/powerpc64-linux.elf-fold.lds
	modified:   stub/src/powerpc64le-linux.elf-fold.lds
2024-11-20 14:52:22 -08:00
John Reiser 83166e21a5 PackLinuxElf64::unpack forgot some get_te*
Also use is_LOAD where ever possible.
	modified:   p_lx_elf.cpp

	modified:   ../NEWS
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2024-11-20 07:46:24 -08:00
John Reiser b4ea89f9d6 check-whitespace, clang-format
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/i386-linux.elf-so_entry.S
2024-11-19 09:13:44 -08:00
John Reiser 00706f0ccc Sync stubs ("make testsuite" passes)
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v4a-linux.elf-so_entry.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-so_entry.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-bsd.elf-fold.h
	modified:   stub/i386-bsd.elf.execve-fold.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-linux.elf-so_entry.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf.execve-fold.h
	modified:   stub/i386-linux.elf.interp-fold.h
	modified:   stub/i386-linux.elf.shell-fold.h
	modified:   stub/i386-netbsd.elf-fold.h
	modified:   stub/i386-openbsd.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	deleted:    stub/src/upxfd_create.c
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
	modified:   stub/tmp/i386-bsd.elf-fold.map
	modified:   stub/tmp/i386-bsd.elf.execve-fold.map
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/i386-linux.elf.execve-fold.map
	modified:   stub/tmp/i386-linux.elf.interp-fold.map
	modified:   stub/tmp/i386-linux.elf.shell-fold.map
	modified:   stub/tmp/i386-netbsd.elf-fold.map
	modified:   stub/tmp/i386-openbsd.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2024-11-19 08:55:31 -08:00
John Reiser 3798dde3aa Fix stubs in arm,mips,powerpc for upx_mmap_and_fd
modified:   stub/Makefile
	modified:   stub/src/arm.v4a-expand.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/mips.r3000-expand.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/upxfd_linux.c
2024-11-19 08:44:48 -08:00
John Reiser 5bf2258505 filter strategy option to build no loader at all
modified:   packer.cpp
2024-11-18 16:17:37 -08:00
John Reiser 33b9c68677 upx_fd_android.c
modified:   stub/src/upxfd_android.c
2024-11-18 16:15:06 -08:00
John Reiser 58d9b00a0a Revamp 32-bit stub/src/*-linux.elf-so_main.c
... including better error checking of system calls
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-so_entry.S
	modified:   stub/src/i386-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-so_main.c
2024-11-18 16:12:44 -08:00
John Reiser 7ef018fed0 Option --android-oid for Android < 10
modified:   main.cpp
	modified:   options.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.h
2024-11-18 16:06:45 -08:00
John Reiser 3d9fc7ab53 Clarify call to upx_compress(); NFC
modified:   p_unix.cpp
2024-11-18 16:04:48 -08:00
John Reiser 3d6b2e4617 Cleanup stub/*.lds linker scripts
modified:   Makefile
	modified:   src/amd64-linux.elf-fold.lds
	modified:   src/amd64-linux.elf-so_fold.lds
	modified:   src/arm.v4a-linux.elf-entry.lds
	modified:   src/arm.v4a-linux.elf-fold.lds
	modified:   src/arm.v4a-linux.elf-so_entry.lds
	modified:   src/arm.v4a-linux.elf-so_fold.lds
	modified:   src/arm.v5a-linux.elf-entry.lds
	modified:   src/arm.v5a-linux.elf-fold.lds
	modified:   src/arm.v5a-linux.elf-so_entry.lds
	modified:   src/arm.v5a-linux.elf-so_fold.lds
	modified:   src/arm64-linux.elf-fold.lds
	modified:   src/arm64-linux.elf-so_fold.lds
	modified:   src/armeb.v4a-linux.elf-entry.lds
	modified:   src/armeb.v4a-linux.elf-fold.lds
	modified:   src/i386-bsd.elf-fold.lds
	modified:   src/i386-linux.elf-fold.lds
	modified:   src/i386-linux.elf-so_entry.lds
	modified:   src/i386-linux.elf-so_fold.lds
	modified:   src/i386-linux.elf.execve-fold.lds
	modified:   src/i386-linux.elf.interp-fold.lds
	modified:   src/i386-linux.elf.shell-fold.lds
	modified:   src/mips.r3000-linux.elf-fold.lds
	modified:   src/mipsel.r3000-linux.elf-fold.lds
	modified:   src/powerpc-linux.elf-fold.lds
	modified:   src/powerpc64-linux.elf-fold.lds
	modified:   src/powerpc64le-linux.elf-fold.lds
	new file:   src/upxfd_linux.c
2024-11-18 16:00:36 -08:00
John Reiser 886e325cbf EXP_TAIL goes after de-compressors, and before UMF_LINUX
modified:   p_lx_elf.cpp
	modified:   stub/src/i386-expand.S
2024-11-14 19:22:28 -08:00
John Reiser 60bdffee84 make_hatch() has uniform calling sequence
... so factor out the calls to make_hatch
	modified:   src/i386-linux.elf-so_main.c
2024-11-14 11:19:10 -08:00
John Reiser a9dc43f7fb PackLinuxElf32::generateElfHdr, PackLinuxElf64::buildLinuxLoader
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2024-10-26 10:53:28 -07:00
John Reiser 0cc0e51d5d PackLinuxElf64::canPack_Shdr
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2024-10-26 10:02:14 -07:00
John Reiser 14d75b222f -DWINDOWS_BACK=1 for PE
modified:   stub/Makefile
2024-10-26 09:52:12 -07:00
John Reiser b10d2b7365 lodsb is OK to use in branch filter
modified:   stub/src/arch/i386/bxx.S
2024-10-26 09:50:38 -07:00
John Reiser 8aa3679323 upx_mmap_and_fd
modified:   stub/src/upxfd_create.c
2024-10-26 09:49:26 -07:00
John Reiser 3403b87cb7 More Control Flow Integrity (Intel)
More ENDBRxx for CALL *%RDX for 'getbit'.
amd64: LEA xxx(%rip),%reg and STRCON section,
    instead of CALL; .asciz "..."; POP %reg
(Not for PE due to WINDOWS_BACK binary compatibility.)
i386 string constants still use call-.asciz-pop because no (%rip)
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/amd64-linux.elf-so_entry.S
	modified:   stub/src/amd64-linux.shlib-init.S
	modified:   stub/src/amd64-win64.pe.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-so_entry.S
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.map *.dump
2024-09-20 14:48:30 -07:00
John Reiser d55fdf2205 ZIG_DIST_VERSION of 2024-09-17
also https://github.com/upx/upx/issues/847

	modified:   ../.github/workflows/ci.yml
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/i386-darwin.macho-entry.S
           plus generated *.h *.map *.dump
2024-09-17 01:55:08 -07:00
John Reiser 7cb3f40dab WIP: variable page size for xfind_pages(); debug arm32 Android shlib
modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/i386-linux.elf-main2.c
           plus generated *.h *.dump *.map
2024-08-29 16:55:18 -07:00
John Reiser 65c362efce MSVC lacks stpcpy()
modified:   p_lx_elf.cpp
2024-08-26 18:59:55 -07:00
John Reiser 8065eebca3 --android-shlib for arm32 and i386
... including work-around if no memfd_create() on early Android 32-bit
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.dump *.map
2024-08-25 15:16:29 -07:00
John Reiser 7f062c7ca5 Variable page size: spread the word by using 'page_' instead of 'PAGE_'
modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	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
           plus genereated *.h *.map
2024-08-25 15:16:29 -07:00
John Reiser 0adad4a053 ELF2 after successful ANDROID_TEST of upxfd_android.c on i386 and arm32
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.dump *.map
2024-08-25 15:16:29 -07:00
John Reiser cb39e6e0b8 ELF2: stub for i386 shared library
WIP: stub is debugged, but compressed input needs work
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/i386-linux.elf-so_entry.S
	modified:   stub/src/i386-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/include/linux.h
           plus generated *.h *.dump
2024-08-25 15:16:29 -07:00
John Reiser 94eebc3ee5 ELF2: arm32 shared libraries; runs on Android 14 under TermUX
NYI: complex DT_INIT (R_RELR, etc.)
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/arm.v4a-expand.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser 5d5f4d1765 Elf2: Android on ARM 64-bit and 32-bit main program runs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser ed0665407a More: prefer movzbl over movb fetch to register
Avoids hardware failure of writing 0x00 instead of the fetched byte.
1 cycle faster, 1 byte larger (but often recouped later when OR of 32-bits).
Avoid changing win*pe.S for now.

	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/amd64-darwin.dylib-entry.S
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-expand.S
	modified:   stub/src/amd64-linux.shlib-init.S
	modified:   stub/src/arch/amd64/nrv2b_d.S
	modified:   stub/src/arch/amd64/nrv2d_d.S
	modified:   stub/src/arch/amd64/nrv2e_d.S
	modified:   stub/src/arch/i386/nrv2b_d32-easy.S
	modified:   stub/src/i386-darwin.macho-entry.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser 3869a67180 Intel CET (Control-flow Enforcement Technology)
{endbr64, endbr32} at target of computed jmp/call; 'notrack' at source
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arch/amd64/macros.S
	modified:   stub/src/arch/i386/macros.S
	modified:   stub/src/i386-expand.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main2.c
2024-08-25 15:16:29 -07:00
John Reiser 7e75491e88 Macho" begin catch-up to ELF by defining labels eof_n2*
modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
2024-08-25 15:16:29 -07:00
John Reiser ca33d66816 Sync stub checksums; and i386-linux and arm64-linux generated files
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
2024-08-25 15:16:29 -07:00
John Reiser 055e3db80a i386-linux stub: Use current __NR_uname; pacify memcheck
modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
2024-08-25 15:16:29 -07:00
John Reiser 620ddf1228 arm64: typo in daisy-chain when selecting de-compression method
modified:   stub/src/arm64-expand.S
2024-08-25 15:16:29 -07:00
John Reiser d71fe3eda0 Sync stub checksums (and generated files)
Many *.h, *.dump, *.map
2024-08-25 15:16:29 -07:00
John Reiser bff5049a98 developer documentation
modified:   p_lx_elf.cpp
2024-08-25 15:16:29 -07:00
John Reiser 536b2c2475 i386 LzmaDecode (lzma_d_c*.S) compiled code exited not at the end
... so the build recipe required acrobatics to make it "fall through"
	modified:   stub/src/arch/i386/Makefile.extra
	new file:   stub/src/arch/i386/fall-through.sed
	modified:   stub/src/arch/i386/lzma-multi_d.S
	modified:   stub/src/arch/i386/lzma_d_cf.S
	modified:   stub/src/arch/i386/lzma_d_cs.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/i386-expand.S
2024-08-25 15:16:29 -07:00
John Reiser 7a3033c150 MFD_EXEC is unknown in older Ubuntu linux
modified:   stub/src/include/linux.h
	modified:   stub/src/upxfd_android.c
2024-08-25 15:16:29 -07:00
John Reiser 05db054fb9 developer documentation
modified:   stub/src/i386-linux.elf-so_fold.S
2024-08-25 15:16:29 -07:00
John Reiser 8aa445e2fc i386 stub: prefer movzbl over movb fetch [stragglers]
modified:   stub/src/arch/i386/nrv2d_d32-easy.S
	modified:   stub/src/arch/i386/nrv2e_d32-easy.S
2024-08-25 15:16:29 -07:00
John Reiser 3658136b82 whitespace
modified:   stub/src/powerpc64-linux.elf-fold.S
2024-08-25 15:16:29 -07:00
John Reiser 64419ca4f4 Sync checksums from testsuite (i386 and powerpc64le)
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
2024-08-25 15:16:29 -07:00
John Reiser 913cddec61 Generated files
modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
2024-08-25 15:16:29 -07:00
John Reiser 25e6a31004 i386 stub: prefer movzbl over movb fetch
32-bit mode on x86_64 hardware can fail movb fetch to register
by writing 0x00 randomly instead of the fetched byte.
Note that most CPU can write only 32 or 64 bits to the register file,
so writing just 8 or 16 bits incurs a 1-cycle penalty in order to
form 32 bits by Read-Modify-Write of the destination register.
	modified:   stub/src/arch/i386/nrv2b_d32-easy.S
	modified:   stub/src/i386-expand.S
2024-08-25 15:16:29 -07:00
John Reiser 3d58035b41 i386 stub filters 0x49 and 0x46 really are different (but similar!)
modified:   filter/filter_impl.cpp
	modified:   p_lx_elf.cpp
	modified:   stub/src/arch/i386/bxx.S
2024-08-25 15:16:29 -07:00
John Reiser b94a150685 PowerPC64 stub: fix register assignments
modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/powerpc64-linux.elf-entry.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
2024-08-25 15:16:29 -07:00
John Reiser 22717c15af sync checksums after podman rebuild
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
2024-08-25 15:16:29 -07:00
John Reiser cb07fc2abc podman stubs rebuild
Looks like all differences are in generated *.h *.map *.dump .
	modified:   stub/amd64-linux.kernel.vmlinux.h
	modified:   stub/i386-bsd.elf-entry.h
	modified:   stub/i386-bsd.elf.execve-entry.h
	modified:   stub/i386-darwin.dylib-entry.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-dos32.djgpp2.h
	modified:   stub/i386-dos32.tmt.h
	modified:   stub/i386-dos32.watcom.le.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf.execve-entry.h
	modified:   stub/i386-linux.elf.interp-entry.h
	modified:   stub/i386-linux.elf.shell-entry.h
	modified:   stub/i386-linux.kernel.vmlinux.h
	modified:   stub/i386-linux.kernel.vmlinuz.h
	modified:   stub/i386-linux.shlib-init.h
	modified:   stub/i386-netbsd.elf-entry.h
	modified:   stub/i386-win32.pe.h
	modified:   stub/src/arch/i386/lzma_d_cf.S
	modified:   stub/src/arch/i386/lzma_d_cs.S
	modified:   stub/tmp/amd64-linux.kernel.vmlinux.bin.dump
	modified:   stub/tmp/i386-bsd.elf-entry.bin.dump
	modified:   stub/tmp/i386-bsd.elf.execve-entry.bin.dump
	modified:   stub/tmp/i386-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/i386-dos32.djgpp2.bin.dump
	modified:   stub/tmp/i386-dos32.tmt.bin.dump
	modified:   stub/tmp/i386-dos32.watcom.le.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/i386-linux.elf.execve-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf.interp-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf.shell-entry.bin.dump
	modified:   stub/tmp/i386-linux.kernel.vmlinux.bin.dump
	modified:   stub/tmp/i386-linux.kernel.vmlinuz.bin.dump
	modified:   stub/tmp/i386-linux.shlib-init.bin.dump
	modified:   stub/tmp/i386-netbsd.elf-entry.bin.dump
	modified:   stub/tmp/i386-win32.pe.bin.dump
2024-08-25 15:16:29 -07:00
John Reiser ea2a190bd1 ELF2 main programs pass src/testsuite and upx-testsuite-v2
Decompressing lzma required many adjustments.
Backwards compatibility probably is broken for
    stub/amd64-win64.pe.h
    stub/arm64-win64.pe.h
Also: shared libraries need memfd_create.
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/scripts/xstrip.py
	modified:   stub/src/amd64-expand.S
	modified:   stub/src/arch/amd64/lzma_d.S
	modified:   stub/src/arch/arm/v4a/lzma_d.S
	modified:   stub/src/arch/arm/v4t/macros.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/powerpc/32/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/arm.v4a-expand.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/src/arm64-expand.S
	modified:   stub/src/i386-expand.S
	modified:   stub/src/mips.r3000-expand.S
	modified:   stub/src/powerpc-expand.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64-expand.S
	modified:   stub/src/powerpc64-linux.elf-entry.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser e6f3c1b3da un-DEBUG
modified:   stub/src/arm.v4a-linux.elf-main2.c
2024-08-25 15:16:29 -07:00
John Reiser 22f732aa4e ARM 32-bit: centralize definition of bkpt, bkpt_th opcodes
modified:   stub/src/arch/arm/v4a/macros.S
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
2024-08-25 15:16:29 -07:00
John Reiser 5e531d7cca PowerPC register mixups
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
2024-08-25 15:16:29 -07:00
John Reiser 0deae5f0b8 ARM_OLDABI is no longer handled by #define
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/armeb.v4a-linux.elf-entry.S
	modified:   stub/src/armeb.v4a-linux.elf-fold.S
2024-08-25 15:16:29 -07:00
John Reiser 9ff4187fb3 filters 0x50, 0x51 use same code for unfilter
modified:   stub/src/arm.v4a-expand.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
2024-08-25 15:16:29 -07:00
John Reiser 6a1e70bf40 i386 filters 0x46 and 0x49 are the same
modified:   filter/filter_impl.cpp
	modified:   stub/src/arch/i386/bxx.S
2024-08-25 15:16:29 -07:00
John Reiser d097218a45 mips.r3000, a mips-1 cpu, still has load-delay slots
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/mips.r3000-expand.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
2024-08-25 15:16:29 -07:00
John Reiser cc87a2c867 ELF2 for mips 32-bit main programs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/include/linux.h
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/arch/mips/r3000/lzma_d.S
	modified:   stub/src/arch/mips/r3000/macros.ash
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-main2.c
	modified:   stub/src/arm.v4a-linux.elf-so_fold.lds
	modified:   stub/src/arm.v5a-linux.elf-so_fold.lds
	modified:   stub/src/arm64-linux.elf-so_fold.lds
	modified:   stub/src/i386-expand.S
	modified:   stub/src/i386-linux.elf-entry.lds
	modified:   stub/src/i386-linux.elf-main2.c
	modified:   stub/src/i386-linux.elf-so_fold.lds
	new file:   stub/src/mips.r3000-expand.S
	new file:   stub/src/mips.r3000-linux.elf-entry.lds
	modified:   stub/src/mips.r3000-linux.elf-fold.S
	modified:   stub/src/mips.r3000-linux.elf-fold.lds
	new file:   stub/src/mips.r3000-linux.elf-main2.c
	new file:   stub/src/mipsel.r3000-expand.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	new file:   stub/src/mipsel.r3000-linux.elf-entry.lds
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.lds
	new file:   stub/src/mipsel.r3000-linux.elf-main2.c
	modified:   stub/src/mipsel.r3000-linux.shlib-init.S
	modified:   stub/src/powerpc-linux.elf-fold.lds
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser b26ba9c4d3 ELF2 stragglers from stub make
modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2024-08-25 15:16:29 -07:00
John Reiser 88c94d1cc0 ELF2 for powerpc (32-bit) main programs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/arch/powerpc/32/macros.S
	modified:   stub/src/i386-linux.elf-main2.c
	new file:   stub/src/powerpc-expand.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.lds
	new file:   stub/src/powerpc-linux.elf-main2.c
	modified:   stub/src/powerpc64-linux.elf-fold.S
           plus generated *.h *.map *.dump

 interactive rebase in progress; onto ac82d473
 Last commands done (17 commands done):
    pick 1b9ddea5 ELF2 arm32-linux unmap_all_pages
    pick 1f372e54 ELF2 for powerpc (32-bit) main programs
 Next commands to do (10 remaining commands):
    pick 5f5849a9 ELF2 stragglers from stub make
    pick 2ba8b5da ELF2 for mips 32-bit main programs
 You are currently rebasing branch 'jreiser-ELF2' on 'ac82d473'.

 Changes to be committed:
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/p_lx_elf.cpp
	modified:   src/stub/Makefile
	modified:   src/stub/powerpc-linux.elf-entry.h
	modified:   src/stub/powerpc-linux.elf-fold.h
	modified:   src/stub/powerpc64-linux.elf-fold.h
	modified:   src/stub/powerpc64le-linux.elf-fold.h
	modified:   src/stub/src/arch/powerpc/32/macros.S
	modified:   src/stub/src/i386-linux.elf-main2.c
	new file:   src/stub/src/powerpc-expand.S
	modified:   src/stub/src/powerpc-linux.elf-entry.S
	modified:   src/stub/src/powerpc-linux.elf-fold.S
	modified:   src/stub/src/powerpc-linux.elf-fold.lds
	new file:   src/stub/src/powerpc-linux.elf-main2.c
	modified:   src/stub/src/powerpc64-linux.elf-fold.S
	modified:   src/stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   src/stub/tmp/powerpc-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64le-linux.elf-fold.map
2024-08-25 15:16:29 -07:00
John Reiser 6cda0b6016 ELF2 arm32-linux unmap_all_pages
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser 66dc1d90d8 ELF2 for arm32
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	new file:   stub/src/arm.v4a-linux.elf-entry.lds
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-fold.lds
	new file:   stub/src/arm.v4a-linux.elf-main2.c
	new file:   stub/src/arm.v4a-linux.elf-so_entry.lds
	new file:   stub/src/arm.v5a-linux.elf-entry.lds
	new file:   stub/src/arm.v5a-linux.elf-fold.lds
	new file:   stub/src/arm.v5a-linux.elf-main2.c
	new file:   stub/src/arm.v5a-linux.elf-so_entry.lds
	new file:   stub/src/armeb.v4a-expand.S
	new file:   stub/src/armeb.v4a-linux.elf-entry.lds
	modified:   stub/src/armeb.v4a-linux.elf-fold.lds
	new file:   stub/src/armeb.v4a-linux.elf-main2.c
	new file:   stub/src/armeb.v4a-linux.elf-so_main2.c
	modified:   stub/src/i386-linux.elf-main2.c
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser f7cab0cf71 ELF2 for i386-linux main programs
OpenBSD and NetBSD main programs probably need work.
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/i386-linux.elf-entry.S
	new file:   stub/src/i386-linux.elf-entry.lds
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-fold.lds
	new file:   stub/src/i386-linux.elf-main2.c
	new file:   stub/src/i386-linux.elf-so_entry.lds
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser 83e2df4c46 Fix pwerpc64 lzma stub
modified:   stub/src/arch/powerpc/64/lzma_d.S

 interactive rebase in progress; onto ac82d473
 Last commands done (13 commands done):
    pick 821c9dcc ELF2: FIx powerpc64* lzma
    pick ad3d6786 Fix pwerpc64 lzma stub
 Next commands to do (14 remaining commands):
    pick 8389340b ELF2 for i386-linux main programs
    pick 921d6ad3 ELF2 for arm32
 You are currently rebasing branch 'jreiser-ELF2' on 'ac82d473'.

 Changes to be committed:
	modified:   src/stub/powerpc64-linux.elf-fold.h
	modified:   src/stub/src/arch/powerpc/64/lzma_d.S
	modified:   src/stub/tmp/powerpc64-linux.elf-fold.map
2024-08-25 15:16:29 -07:00
John Reiser 31216ed1b2 ELF2: FIx powerpc64* lzma
also follow-ons for https://github.com/upx/upx/issues/834
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc64-expand.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
           plus generated *.h *.map *.dump

 interactive rebase in progress; onto ac82d473
 Last commands done (12 commands done):
    pick d6a29e58 CI updates
    pick 821c9dcc ELF2: FIx powerpc64* lzma
 Next commands to do (15 remaining commands):
    pick ad3d6786 Fix pwerpc64 lzma stub
    pick 8389340b ELF2 for i386-linux main programs
 You are currently rebasing branch 'jreiser-ELF2' on 'ac82d473'.

 Changes to be committed:
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/powerpc64-linux.elf-fold.h
	modified:   src/stub/powerpc64le-linux.elf-fold.h
2024-08-25 15:16:29 -07:00
John Reiser e9930bb2bc ELF2: Move section EXP_TAIL to catch case of no matching de-compressor
Also adjust blocksize for large gap (.p_align - .p_filesz)
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-expand.S
	modified:   stub/src/arm64-expand.S
	modified:   stub/src/powerpc64-expand.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser c8a0540fd2 ELF2: FIx powerpc64* lzma
also follow-ons for https://github.com/upx/upx/issues/834
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc64-expand.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser a9b7a0cb27 ELF2: use "gcc -E" instead of /lib/cpp
modified:   Makefile
2024-08-25 15:16:29 -07:00
John Reiser c0ff491972 ELF2 for PowerPC64 forgot to add new files
new file:   src/powerpc64-expand.S
	new file:   src/powerpc64-linux.elf-main2.c
	new file:   src/powerpc64le-expand.S
	new file:   src/powerpc64le-linux.elf-main2.c
2024-08-25 15:16:29 -07:00
John Reiser 146c105961 ELF2 for PowerPC64
(MacOS temporarily disabled)
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/arch/powerpc/64/macros.S
	modified:   stub/src/arch/powerpc/64le/bxx.S
	modified:   stub/src/arch/powerpc/64le/macros.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	new file:   stub/src/dollar-dollar.sed
	modified:   stub/src/powerpc64-linux.elf-entry.S
	modified:   stub/src/powerpc64-linux.elf-fold.S
	modified:   stub/src/powerpc64-linux.elf-fold.lds
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.lds
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser 35fca2062e ELF2 arm64: fix exit from lzma de-compressor
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   linker.cpp
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arm64-expand.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:29 -07:00
John Reiser 2c4e5c7a47 arm64-expand code for nrv* EOF at de-compress is not quite uniform
WINDOWS_BACK requirement also interferes.
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	modified:   stub/src/arm64-expand.S
           plus generated *.h, *.map
2024-08-25 15:16:29 -07:00
John Reiser e561da33bd ELF2 64-bits: Use /dev/shm (O_TMPFILE) if memfd_create fails
Such as Ubuntu-20.04, Linux kernel 5.15.0-67, #74-20.04.1, 2023-02-22
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/Makefile
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/upxfd_android.c
           plus generated *.h *.map *.dump
2024-08-25 15:16:28 -07:00
John Reiser 5f6bdb0a8f ELF2 for arm64 main programs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/Makefile
	modified:   stub/src/amd64-expand.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arch/amd64/lzma_d.S
	modified:   stub/src/arch/amd64/nrv2b_d.S
	modified:   stub/src/arch/amd64/nrv2d_d.S
	modified:   stub/src/arch/amd64/nrv2e_d.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/macros.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	modified:   stub/src/arm64-expand.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
           plus generated *.h *.map *.dump
2024-08-25 15:16:28 -07:00
John Reiser 6276a4a7c4 ELF2 for arm64 main programs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main2.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-fold.lds
	new file:   stub/src/arm64-linux.elf-main2.c
           plus generated *.h *.dump *.map
2024-08-25 15:16:28 -07:00
John Reiser 4fa50b96ad Disable macos-12 from running upx-packed [temporary]
macOS-12.7.5 lldb complains "Bad executable" for any packed.
	modified:   .github/workflows/ci.yml
2024-08-25 15:16:28 -07:00
John Reiser 5aef158ff0 ELF2: Fix EINVAL when PT_LOAD does not start on page boundary
modified:   stub/src/amd64-linux.elf-main2.c
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
           plus generated .h .map
2024-08-25 15:16:28 -07:00
John Reiser 4054ac192a ELF2: memcheck avoids extra safety bytes
modified:   stub/src/amd64-linux.elf-entry.S
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
           plus generated .h and .dump
2024-08-25 15:16:28 -07:00
John Reiser febe8e4d9e whitespace
modified:   stub/src/arch/amd64/lzma_d.S
2024-08-25 15:16:28 -07:00
John Reiser c924c32d54 ELF2: fix lzma on amd64-linux.elf-*
New -DWINDOWS_BACK so that amd64-win64.pe.h does not change.
This hides a real bug (unchecked), but would change anti-virus status.
	modified:   src/stub/src/amd64-expand.S
	modified:   src/stub/src/amd64-linux.elf-entry.S
	modified:   src/stub/src/amd64-linux.elf-fold.S
	modified:   src/stub/src/arch/amd64/lzma_d.S
	modified:   src/stub/Makefile
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
           plus generated *.h, *.map, *.dump
2024-08-25 15:16:28 -07:00
John Reiser 743eb5cc26 whitespace
modified:   p_lx_elf.cpp
2024-08-25 15:16:28 -07:00
John Reiser f4585cdf77 Sync stubs
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
2024-08-25 15:16:28 -07:00
John Reiser c36977f0b1 ELF: amd64-linux main programs use 2-step de-compressor
The first $ARCH to move to 2-step de-compressor for ELF main programs.
De-compressor uses memfd_create to comply with strictest SELinux
settings (no PROT_WRITE on any PROT_EXEC page).
First step de-compressor always uses NRV2B to de-compress the second step,
and the second step can use a different de-compressor for each PT_LOAD.
	modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	modified:   stub/src/amd64-linux.elf-fold.lds
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	new file:   stub/src/amd64-linux.elf-main2.c

	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-fold.map
2024-08-25 15:16:28 -07:00
Markus F.X.J. Oberhumer 44e4bd0b54 CI updates 2024-08-19 07:55:57 +02:00
Markus F.X.J. Oberhumer 1427b8137a CI updates 2024-08-13 11:32:29 +02:00
Markus F.X.J. Oberhumer a9cb354225 CI and cmake updates 2024-08-07 13:37:38 +02:00
Markus F.X.J. Oberhumer b4db17ab3c cmake update 2024-07-31 18:56:32 +02:00
Markus F.X.J. Oberhumer ba969fb9f2 CI updates 2024-07-31 09:24:33 +02:00
Markus F.X.J. Oberhumer 87ac252c8d CI updates 2024-07-30 17:22:52 +02:00
Markus F.X.J. Oberhumer ada9081ea2 CI updates 2024-07-28 18:01:54 +02:00
Markus F.X.J. Oberhumer d6a29e582f CI updates 2024-07-25 13:08:15 +02:00
Markus F.X.J. Oberhumer 03c4184067 all: misc cleanups 2024-07-23 12:24:09 +02:00
Markus F.X.J. Oberhumer 0a82280f20 cmake update 2024-07-19 11:13:04 +02:00
Markus F.X.J. Oberhumer a7fa2f87c5 cmake update 2024-07-17 12:06:41 +02:00
Markus F.X.J. Oberhumer 3a11a5a82e CI updates 2024-07-13 12:49:02 +02:00
John Reiser 08a38af553 Workaround bug in Alpine Linux
"empty" DT_GNU_HASH lacked hasharr[0] when n_bucket==1,
which upx correctly detected as malformed.
	modified:   p_lx_elf.cpp
2024-07-02 11:24:27 -07:00
Markus F.X.J. Oberhumer 043a54cf3e all: minor cleanups 2024-07-10 10:34:58 +02:00
Markus F.X.J. Oberhumer 16c8f6d160 src: portability updates 2024-07-07 14:50:27 +02:00
Markus F.X.J. Oberhumer 285472bc78 submodules: update for new versions 2024-07-07 14:16:49 +02:00
Markus F.X.J. Oberhumer a77adcd4c7 src: new ACC version 2024-07-01 18:25:54 +02:00
John Reiser cebd4392f2 Fix checksum error de-compressing ELF with large .p_align and small blocksize
https://github.com/upx/upx/issues/836
	modified:   p_unix.cpp
2024-07-05 19:06:14 -07:00
John Reiser 64a3de5a7a FIX PT_GNU_HASH when "empty"
... such as a main program with no exported globals
https://github.com/upx/upx/issues/834
	modified:   p_lx_elf.cpp
2024-06-28 09:04:05 -07:00
Markus F.X.J. Oberhumer 261609f706 CI updates 2024-06-26 11:45:35 +02:00
Markus F.X.J. Oberhumer 17cf73001c CI updates 2024-06-21 18:19:59 +02:00
Markus F.X.J. Oberhumer ad566d793a CI updates 2024-06-20 10:49:09 +02:00
Markus F.X.J. Oberhumer b499ed3d20 CI updates 2024-06-19 00:20:35 +02:00
John Reiser de8de9c0f0 Option --unmap-all-pages completely avoids /proc/self/exe
https://github.com/upx/upx/issues/749
2024-06-18 10:18:32 -07:00
John Reiser 3b36dce5c2 Mention PT_MIPS_ABIFLAGS forwarding
https://github.com/upx/upx/issues/788
	modified:   NEWS
2024-06-17 08:50:54 -07:00
Markus F.X.J. Oberhumer dcd8dfd5fc CI: add zigcc linux-mips soft-float targets 2024-06-17 10:28:53 +02:00
Markus F.X.J. Oberhumer 78f3b6297c src/pefile.cpp: default to strict reloc checks 2024-06-17 09:35:31 +02:00
Markus F.X.J. Oberhumer a49fe3b04a CI: remove zigcc linux-mips workaround 2024-06-17 08:55:21 +02:00
Markus F.X.J. Oberhumer f23cc7daa3 CI update: remove macos-11 runner 2024-06-15 18:16:58 +02:00
John Reiser cafd9d7ace Sync stub checksums
modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
2024-06-14 14:49:54 -07:00
John Reiser 1b6c120864 64-bit phdrx[], PT_NOTE, PT_GNU_STACK
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2024-06-13 15:32:51 -07:00
John Reiser 99afc50ebf PT_MIPS_ABIFLAGS, PT_MIPS_REGINFO
Also re-org of PT_HOTE and other non-PT_LOAD Elf32_Phdrs
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2024-06-13 09:58:20 -07:00
John Reiser 3286f7c5ba De-compression of PT_MIPS_ABIFLAGS
modified:   p_lx_elf.cpp
2024-06-11 20:03:44 -07:00
John Reiser 72ccca9faf PT_MIPS_ABIFLAGS, compression side only, 32-bit only
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2024-06-11 15:02:13 -07:00
Markus F.X.J. Oberhumer 3c294d9721 all: minor cleanups 2024-06-14 15:15:55 +02:00
Markus F.X.J. Oberhumer 1aff5f5bb7 all: misc cleanups 2024-06-07 22:29:57 +02:00
John Reiser 937ae4c5e0 Avoid crash on outrageous fuzzed input
https://github.com/upx/upx/issues/828
	modified:   p_lx_elf.cpp
2024-06-04 15:43:11 -07:00
John Reiser 056865f59a Detect bad placement of LINK segment
https://github.com/upx/upx/issues/827
	modified:   p_mach.cpp
2024-06-04 08:55:46 -07:00
John Reiser c58246b43c Detect compressed length too short
https://github.com/upx/upx/issues/827
	modified:   p_unix.cpp
2024-06-04 08:32:26 -07:00
Markus F.X.J. Oberhumer 3495d1affd all: minor cleanups 2024-05-28 10:26:39 +02:00
Markus F.X.J. Oberhumer b0ce072370 src: fix compilation on older compilers; update tests 2024-05-27 20:59:12 +02:00
Markus F.X.J. Oberhumer 9f4d18baac src: yet more constexpr updates 2024-05-27 07:03:03 +02:00
Markus F.X.J. Oberhumer f65c8f8c6f src: more work on constexpr 2024-05-26 18:22:29 +02:00
Markus F.X.J. Oberhumer e0633b89bb CI updates 2024-05-26 12:36:41 +02:00
Markus F.X.J. Oberhumer c3341ce4dc src: add support for constexpr bele.h 2024-05-26 02:27:51 +02:00
Markus F.X.J. Oberhumer 43f9b90c92 cmake update 2024-05-24 09:17:37 +02:00
Markus F.X.J. Oberhumer 6ee45dcdcd CI updates 2024-05-22 22:23:40 +02:00
Markus F.X.J. Oberhumer 344246725b src: more upx::max cleanups 2024-05-22 09:49:20 +02:00
John Reiser 57763ca1e2 ELF stubs: go_lang different placement of DT_STRTAB, DT_SYMTAB
https://github.com/upx/upx/issues/825
	modified:   p_lx_elf.cpp
2024-05-21 17:14:21 -07:00
Markus F.X.J. Oberhumer 40b7e24fcc src: introduce upx::max and friends; updates for clang-19 git snapshot 2024-05-15 14:06:05 +02:00
Markus F.X.J. Oberhumer 9e0f16a629 submodules: update for new versions 2024-05-15 12:32:36 +02:00
Markus F.X.J. Oberhumer 33f4f3a5a1 all: minor clang-tidy cleanups 2024-05-12 08:35:04 +02:00
Markus F.X.J. Oberhumer 07a3b75b3e submodules: update for new versions 2024-05-12 08:33:16 +02:00
Markus F.X.J. Oberhumer bdea2539d1 cmake: use recommended CMAKE install variables
The documentation of GNUInstallDirs explicitly recommends to
*NOT* use the CMAKE_INSTALL_FULL_<dir> variants.
2024-05-11 22:12:29 +02:00
Markus F.X.J. Oberhumer ed3d7b0c45 all: minor cleanups 2024-05-11 22:07:08 +02:00
Markus F.X.J. Oberhumer cba44c45fc src: introduce ptr_get_address() 2024-05-11 17:37:15 +02:00
Markus F.X.J. Oberhumer 07b533f95b submodules: update for new versions 2024-05-11 13:17:43 +02:00
Markus F.X.J. Oberhumer 7b0a79dec5 all: update LZMA SDK license information
The LZMA SDK was placed in the public domain as of
version 4.62 (December 2008).

  https://www.7-zip.org/sdk.html

And according to https://sourceforge.net/p/sevenzip/discussion/45797/thread/685169cf/

  "Are older LZMA versions in the public domain?"
  "Yes, you can use old versions of LZMA SDK as public domain."
    -- Igor Pavlov, 2011-06-21
2024-05-11 12:52:26 +02:00
Markus F.X.J. Oberhumer befd01aa96 CI updates 2024-05-10 10:30:59 +02:00
Markus F.X.J. Oberhumer 1cc263624d submodules: update for new versions 2024-05-10 10:04:13 +02:00
Markus F.X.J. Oberhumer 4daa2c1cde testsuite: update checksums caused by version bump 2024-05-09 12:50:03 +02:00
Markus F.X.J. Oberhumer 7081c57571 all: post-release version bump 2024-05-09 12:44:51 +02:00
Markus F.X.J. Oberhumer 3757579ffc all: prepare for release 2024-05-09 12:03:12 +02:00
Markus F.X.J. Oberhumer 2962dc351b CI updates 2024-05-09 10:21:39 +02:00
Markus F.X.J. Oberhumer c04c685469 src: restrict upx::atomic_exchange to pointer-size for now 2024-05-08 23:08:33 +02:00
Markus F.X.J. Oberhumer 72c9769953 src: avoid warnings when compiling with llvm-mingw-nightly 2024-05-08 22:22:13 +02:00
Markus F.X.J. Oberhumer 42759b94bd all: more clang-tidy cleanups 2024-05-08 15:12:57 +02:00
Markus F.X.J. Oberhumer aa9e69f03e submodules: update for new versions 2024-05-08 15:09:56 +02:00
Markus F.X.J. Oberhumer 0f3939df15 src: pacify clang-tidy 2024-05-07 14:46:02 +02:00
RainRat 62265a1bc9 fix typos 2024-05-07 01:41:41 -07:00
Markus F.X.J. Oberhumer 76b2cec8ee src: fix compilation with clang 2024-05-07 12:33:55 +02:00
Markus F.X.J. Oberhumer 3d82f0cfe1 src: introduce upx::atomic_exchange; cleanups 2024-05-07 10:05:44 +02:00
John Reiser e5546bc8b0 32-bit ELF escape hatch when no fit on last executable page
... about 1/1000 (4/PAGE_SIZE) chance
	modified:   src/stub/src/i386-linux.elf-main.c
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
   plus all 32-bit elf-fold.h, elf-fold.map
2024-05-06 09:42:13 -07:00
Markus F.X.J. Oberhumer 6fc0a00ac8 all: update for clang-tidy-18 2024-05-06 05:40:22 +02:00
Markus F.X.J. Oberhumer 3e5ba5c064 CI updates 2024-05-05 09:35:35 +02:00
John Reiser 4c32a8e3d4 Fix attempted recovery from corrupted b_info
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66271&q=label%3AProj-upx
	modified:   p_lx_elf.cpp
2024-05-04 10:35:39 -07:00
John Reiser 2ea316d754 Detect sizeofcmds too small
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66330&q=label%3AProj-upx
	modified:   p_mach.cpp
2024-05-04 10:10:37 -07:00
John Reiser 548227a55b mb_dt_offsets.clear() prevents undef from corrupted input
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66344&q=label%3AProj-upx
	modified:   p_lx_elf.cpp
2024-05-04 09:56:34 -07:00
John Reiser a831a20910 unpackExtent detects corrupted compression method
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66338&q=label%3AProj-upx
	modified:   p_unix.cpp
2024-05-04 09:43:47 -07:00
John Reiser 811f66de84 Check gnu_shift during unpack
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66273&q=label%3AProj-upx
	modified:   p_lx_elf.cpp
2024-05-04 09:05:48 -07:00
Markus F.X.J. Oberhumer 84d806328b CI updates 2024-05-02 23:31:10 +02:00
Markus F.X.J. Oberhumer 285d4c4c65 submodules: update for new versions 2024-05-02 19:41:50 +02:00
Markus F.X.J. Oberhumer 8506f5b17c testsuite: update checksums caused by version change 2024-05-02 19:38:46 +02:00
Markus F.X.J. Oberhumer a87fd56b3e all: update version 2024-05-02 18:51:55 +02:00
Markus F.X.J. Oberhumer f0cb30e2b9 all: minor cleanups 2024-05-02 18:50:23 +02:00
Markus F.X.J. Oberhumer 038743c694 CI updates 2024-05-02 03:21:27 +02:00
John Reiser 0e6cef99a0 Guard against empty PT_NOTE
https://github.com/upx/upx/issues/817
	modified:   p_lx_elf.cpp
2024-05-01 10:09:52 -07:00
John Reiser 92c925fe95 New i386/lzma-multi_d.S enables unpacking more than one block
Used by p_lx_exe.cpp; others keep old i386/lzma_d.S
which allows only one block, but avoids trouble with
anti-virus utilities for some OS.
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	new file:   src/stub/src/arch/i386/lzma-multi_d.S
	modified:   src/stub/src/arch/i386/lzma_d.S
	modified:   src/stub/src/i386-bsd.elf.execve-entry.S
	modified:   src/stub/src/i386-linux.elf.execve-entry.S
    plus stub/*.h, *.dump

    Notable:
	modified:   src/stub/i386-dos32.djgpp2.h
	modified:   src/stub/i386-dos32.tmt.h
	modified:   src/stub/i386-dos32.watcom.le.h
	modified:   src/stub/i386-win32.pe.h
2024-05-01 10:09:52 -07:00
John Reiser 4562d5459d Some non-ELF --lzma stubs assumed only one block, and <= 0.5MiB
Fixed for p_lx_exc.cpp; others remain a mystery.
https://github.com/upx/upx/issues/816
2024-05-01 10:09:52 -07:00
Markus F.X.J. Oberhumer 8393ded1b3 CI updates 2024-05-01 13:11:12 +02:00
Markus F.X.J. Oberhumer b0dc483165 CI updates 2024-04-29 07:53:21 +02:00
Markus F.X.J. Oberhumer 3c0ca81311 CI updates 2024-04-29 06:24:45 +02:00
Markus F.X.J. Oberhumer 157a63a023 CI updates 2024-04-28 22:18:47 +02:00
John Reiser 80e22a7e38 Fix --preserve-build-id
https://github.com/upx/upx/issues/815
	modified:   p_lx_elf.cpp
2024-04-27 08:21:48 -07:00
Markus F.X.J. Oberhumer ddf2da3d76 cmake: run tests in parallel; misc/podman: add 30-rebuild-stubs.sh 2024-04-26 10:36:01 +02:00
Markus F.X.J. Oberhumer 0e6478a60f submodules: update for new versions 2024-04-26 09:51:10 +02:00
Markus F.X.J. Oberhumer aed2c085b8 misc: update mimic_ctest.sh 2024-04-25 10:56:24 +02:00
Markus F.X.J. Oberhumer a7592b2ca2 all: enhance tests 2024-04-25 03:19:59 +02:00
John Reiser 265c100845 PowerPC64 nrv2d decompressor
https://github.com/upx/upx/issues/813
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/src/arch/powerpc/64le/nrv2d_d.S

	modified:   src/stub/powerpc64-darwin.dylib-entry.h
	modified:   src/stub/powerpc64-darwin.macho-entry.h
	modified:   src/stub/powerpc64-linux.elf-entry.h
	modified:   src/stub/powerpc64le-linux.elf-entry.h
	modified:   src/stub/powerpc64le-linux.kernel.vmlinux.h
2024-04-24 14:37:09 -07:00
John Reiser 84e8288f61 Propagate yesterday's fix to stub decoding on PowerPC
https://github.com/upx/upx/issues/813
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/src/arch/powerpc/32/nrv2d_d.S
	modified:   src/stub/src/arch/powerpc/32/nrv2e_d.S
	modified:   src/stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   src/stub/src/arch/powerpc/64le/nrv2d_d.S

	modified:   src/stub/powerpc-darwin.dylib-entry.h
	modified:   src/stub/powerpc-darwin.macho-entry.h
	modified:   src/stub/powerpc-linux.elf-entry.h
	modified:   src/stub/powerpc-linux.kernel.vmlinux.h
	modified:   src/stub/powerpc64-darwin.dylib-entry.h
	modified:   src/stub/powerpc64-darwin.macho-entry.h
	modified:   src/stub/powerpc64-linux.elf-entry.h
	modified:   src/stub/powerpc64le-linux.elf-entry.h
	modified:   src/stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   src/stub/tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   src/stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   src/stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   src/stub/tmp/powerpc-linux.kernel.vmlinux.bin.dump
	modified:   src/stub/tmp/powerpc64-darwin.dylib-entry.bin.dump
	modified:   src/stub/tmp/powerpc64-darwin.macho-entry.bin.dump
	modified:   src/stub/tmp/powerpc64-linux.elf-entry.bin.dump
	modified:   src/stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   src/stub/tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2024-04-24 10:36:55 -07:00
Markus F.X.J. Oberhumer c69b4561fb src: initialize some fields to suppress harmless valgrind errors 2024-04-24 12:36:22 +02:00
John Reiser 6db0af8d04 PowerPC cannot branch on CArry; requires contortions
https://github.com/upx/upx/issues/813
	modified:   src/stub/src/arch/powerpc/32/nrv2b_d.S
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh

	modified:   src/stub/powerpc-darwin.dylib-entry.h
	modified:   src/stub/powerpc-darwin.macho-entry.h
	modified:   src/stub/powerpc-linux.elf-entry.h
	modified:   src/stub/powerpc-linux.kernel.vmlinux.h
	modified:   src/stub/src/i386-linux.elf-main.c
	modified:   src/stub/tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   src/stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   src/stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   src/stub/tmp/powerpc-linux.kernel.vmlinux.bin.dump
2024-04-23 17:40:07 -07:00
Markus F.X.J. Oberhumer 842d2cbb0d testsuite: update checksums 2024-04-21 19:46:05 -07:00
John Reiser 9fb64ded10 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
2024-04-21 19:46:05 -07:00
Markus F.X.J. Oberhumer 9d26713b1a Add experimental (and undocumented) --help-verbose and --help-short options. 2024-04-21 14:20:18 +02:00
Markus F.X.J. Oberhumer eb3c55b5cb all: add more tests 2024-04-21 12:17:38 +02:00
Markus F.X.J. Oberhumer 896596f672 cmake update 2024-04-20 21:08:09 +02:00
Markus F.X.J. Oberhumer e4de14612f CI updates 2024-04-20 12:29:32 +02:00
Markus F.X.J. Oberhumer 1d2b276425 all: improve tests 2024-04-16 15:20:56 +02:00
Markus F.X.J. Oberhumer 35c6a200ad CI updates 2024-04-14 02:15:26 +02:00
Markus F.X.J. Oberhumer 90a7faa15e CI updates 2024-04-10 10:52:48 +02:00
John Reiser 91f5fe1c0e arm64 --nrv2d instruction confusion
https://github.com/upx/upx/issues/806

ARM Architecture Reference Manual
    ARMv8, for ARMv8-A architecture profile
Section C6.2.47, page C6-595 (note the 'invert'!)
    CINC <Wd>, <Wn>, <cond>
    is equivalent to
    CSINC <Wd>, <Wn>, <Wn>, invert(<cond>)

	modified:   src/stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh

	modified:   src/stub/arm64-darwin.macho-entry.h
	modified:   src/stub/arm64-linux.elf-entry.h
	modified:   src/stub/arm64-linux.elf-so_fold.h
	modified:   src/stub/arm64-linux.shlib-init.h
	modified:   src/stub/arm64-win64.pe.h
2024-04-07 14:01:19 -07:00
John Reiser d48a7d303d Sync checksums for testsuite_1 (-release)
modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
2024-04-06 18:37:34 -07:00
John Reiser bb816f0c74 arm64 --nrv2d preserve sign when decoding offset
https://github.com/upx/upx/issues/806
	modified:   src/stub/arm64-darwin.macho-entry.h
	modified:   src/stub/arm64-linux.elf-entry.h
	modified:   src/stub/arm64-linux.elf-so_fold.h
	modified:   src/stub/arm64-linux.shlib-init.h
	modified:   src/stub/arm64-win64.pe.h
	modified:   src/stub/src/arch/arm64/v8/nrv2d_d32.S
2024-04-06 16:16:28 -07:00
John Reiser 93abe97ea5 powerpc64le --nrv2d register conflict
modified:   stub/powerpc64-darwin.dylib-entry.h
	modified:   stub/powerpc64-darwin.macho-entry.h
	modified:   stub/powerpc64-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S

https://github.com/upx/upx/issues/806
2024-04-06 16:16:28 -07:00
Markus F.X.J. Oberhumer 97cf29ffbb all: enhance CMake tests; assorted updates 2024-04-06 15:47:46 +02:00
Markus F.X.J. Oberhumer ed35613d64 misc/podman/rebuild-stubs: upgrade to ubuntu-24.04 2024-04-05 20:04:23 +02:00
Markus F.X.J. Oberhumer f5ec8363b4 CI updates 2024-04-05 18:16:29 +02:00
Markus F.X.J. Oberhumer 87956de092 CI updates 2024-04-04 03:01:03 +02:00
Markus F.X.J. Oberhumer 0f9315383c cmake: only enable UBSAN for clang versions >= 9 2024-04-02 09:21:56 +02:00
Markus F.X.J. Oberhumer 3538d796a7 CI updates 2024-04-02 08:05:43 +02:00
Markus F.X.J. Oberhumer 24f3824524 CI updates and minor cleanups 2024-04-01 20:31:05 +02:00
Markus F.X.J. Oberhumer 70b20d7d89 CI updates 2024-03-29 12:11:41 +01:00
Markus F.X.J. Oberhumer 7b21a0620b CI updates 2024-03-28 20:21:11 +01:00
John Reiser 3949af6d3c Unpacking detects and defends against malicious ELF 2024-03-28 07:48:55 -07:00
Markus F.X.J. Oberhumer d1f62e3ab4 testsuite: update checksums caused by version bump 2024-03-28 19:51:57 +01:00
Markus F.X.J. Oberhumer 6e644fa480 all: post-release version bump 2024-03-28 19:47:04 +01:00
Markus F.X.J. Oberhumer 5bef968068 all: prepare for release 2024-03-27 13:57:30 +01:00
Markus F.X.J. Oberhumer 543cfe0a73 submodules: update for new versions 2024-03-26 15:46:48 +01:00
Markus F.X.J. Oberhumer 3ba91b8072 cmake update 2024-03-26 15:38:20 +01:00
Markus F.X.J. Oberhumer a27a9e6000 all: and yet more cleanups; NFCI 2024-03-25 11:07:40 +01:00
Markus F.X.J. Oberhumer 7e839e6962 all: more cleanups; NFCI 2024-03-23 20:18:28 +01:00
Markus F.X.J. Oberhumer 809a1b3dae submodules: update for new versions 2024-03-22 01:40:51 +01:00
Markus F.X.J. Oberhumer 9b80628f84 src/pefile.cpp: support relocs of large files
Use 5-byte entries instead of 4-byte entries to fully preserve "pos".

And add some symbolic constants.

Partially based on a patch by John.
2024-03-22 00:46:17 +01:00
Markus F.X.J. Oberhumer a21a006fe9 all: yet more minor cleanups 2024-03-19 16:03:37 +01:00
Markus F.X.J. Oberhumer 54d16a458a CI updates; cleanups 2024-03-16 17:46:40 +01:00
Markus F.X.J. Oberhumer cfc5f42ef2 testsuite: update checksums caused by version change 2024-03-12 18:16:52 +01:00
Markus F.X.J. Oberhumer e3d24238e4 all: update version 2024-03-12 18:12:43 +01:00
Markus F.X.J. Oberhumer 56e7b36959 src: new ACC version 2024-03-12 18:11:46 +01:00
Markus F.X.J. Oberhumer f29791470f all: yet more cleanups 2024-03-10 16:23:06 +01:00
Markus F.X.J. Oberhumer 52d9b53b74 all: minor cleanups 2024-03-08 11:52:44 +01:00
Markus F.X.J. Oberhumer 839a78f2e0 Better fix for previous commit to avoid out-of-bounds pointer. 2024-02-27 11:20:29 +01:00
John Reiser 680ce0a7af find_dt_ndx defends against overrun
https://github.com/upx/upx/issues/790
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66344&q=label%3AProj-upx
	modified:   p_lx_elf.cpp
2024-02-26 14:32:02 -08:00
Markus F.X.J. Oberhumer 06b0de9c77 CI: work-around zig cc mips bad codegen for hard-float 2024-02-17 16:34:11 +01:00
Markus F.X.J. Oberhumer 76b0b7b1ae all: clang-format 2024-02-14 21:29:51 +01:00
John Reiser fabda4df3a R_PPC64_REL24 is reallly "PC-rel. 26 bit, word aligned:
Just like R_PPC_REL24
	modified:   linker.cpp
2024-02-14 11:43:20 -08:00
Markus F.X.J. Oberhumer fdcdaf596a all: pacify clang-tidy, CI and cmake updates 2024-02-14 15:14:47 +01:00
Markus F.X.J. Oberhumer be44cefbe7 CI updates 2024-02-13 18:29:07 +01:00
Markus F.X.J. Oberhumer c1050e624b submodules: update for new versions 2024-02-13 16:49:08 +01:00
Markus F.X.J. Oberhumer ae6d3b9bff all: more assorted cleanups 2024-02-09 14:48:47 +01:00
John Reiser 25aa0e2e46 un_asl_dynsym() should skip when !dynstr
https://github.com/upx/upx/issues/785
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66302
	modified:   p_lx_elf.cpp
2024-02-08 19:32:03 -08:00
Markus F.X.J. Oberhumer 8f7578eef1 CI: enable valgrind 2024-02-04 13:54:37 +01:00
Markus F.X.J. Oberhumer 29ce4807fb all: minor updates 2024-02-04 13:37:00 +01:00
John Reiser 41f6945be1 Fix auxv_up() to avoid SIGSEGV under valgrind
https://github.com/upx/upx/issues/784
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
           plus all generated stub/*-linux.elf-fold.{h,map}
2024-02-03 13:58:53 -08:00
Markus F.X.J. Oberhumer 718ec468ff all: more assorted cleanups; NFCI 2024-02-02 10:17:16 +01:00
John Reiser d429801498 Avoid &file_image[file_size] because some Standards object
modified:   p_lx_elf.cpp
2024-02-01 11:41:04 -08:00
Markus F.X.J. Oberhumer 024091e6b5 src: fix previous bounds checking commit 2024-01-31 20:52:19 +01:00
Markus F.X.J. Oberhumer d849e9de98 src: add some bounds checking to MemBufferBase 2024-01-31 16:48:55 +01:00
John Reiser c0e40da2ab more checking of Mach_header when unpacking for MachOS
https://github.com/upx/upx/issues/783
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65532
	modified:   p_mach.cpp
2024-01-27 14:16:53 -08:00
John Reiser dff3766501 Detect too-large bit-shift in elf_lookup of DT_GNUHASH
https://github.com/upx/upx/issues/782
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65776
	modified:   p_lx_elf.cpp
2024-01-27 13:38:25 -08:00
John Reiser 2767ec54e1 more checking of PackUnix::p_info at unpack
https://github.com/upx/upx/issues/781
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65864
	modified:   p_unix.cpp
2024-01-27 13:06:59 -08:00
John Reiser ac72c02793 check nbucket earlier in DT_HASH on ELF
https://github.com/upx/upx/issues/780
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66079
	modified:   p_lx_elf.cpp
2024-01-27 11:42:25 -08:00
John Reiser 69c51eee4d better checking of DT_STRSZ for ELF
https://github.com/upx/upx/issues/779
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66064
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2024-01-27 11:11:07 -08:00
John Reiser ff5a4eeb96 ELF versus --brute: addStubEntrySections() needs ph_forced_method()
https://github.com/upx/upx/issues/770
	modified:   p_lx_elf.cpp
2024-01-25 17:17:32 -08:00
John Reiser b48f870701 Detect circular DT_HASH and DT_GNUHASH lookup
https://github.com/upx/upx/issues/775
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65811&q=label%3AProj-upx
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65840&q=label%3AProj-upx
2024-01-25 15:05:53 -08:00
John Reiser 10807ebdc2 Unpack 8-byte b_info only if (ph.version <= 11): 2001 or earlier
*x86 only: .e_entry too low
https://github.com/upx/upx/issues/774
	modified:   p_lx_elf.cpp
2024-01-25 09:06:46 -08:00
Markus F.X.J. Oberhumer 5d649f83ec all: assorted cleanups 2024-01-24 20:53:14 +01:00
Markus F.X.J. Oberhumer 65b25adceb submodules: update for new versions 2024-01-24 20:49:33 +01:00
John Reiser d615985b8a elf_find_table_size() did not check for empty table
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65765&q=label%3AProj-upx
https://github.com/upx/upx/issues/771
	modified:   p_lx_elf.cpp
2024-01-18 19:11:12 -08:00
Markus F.X.J. Oberhumer b019440980 testsuite: update checksums caused by version year bump 2024-01-13 20:08:08 +01:00
John Reiser 38ed4b2017 arm32, arm64 ABI for -static must preserve register 0
Also arm32 forgot to unmap the expanded de-compressor via the escape hatch.

https://github.com/upx/upx/issues/758
https://github.com/upx/upx/issues/768
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	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-main.c
	modified:   stub/src/amd64-linux.elf-main.c
          plus associated *.h *.map *.dump
2024-01-12 15:39:18 -08:00
John Reiser 2ad0d51226 PeFile::rebuildImports(): Allow strlen() up to the very end of a logical block
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65650
https://github.com/upx/upx/issues/769
	modified:   pefile.cpp
2024-01-11 09:57:57 -08:00
John Reiser e4a611bcae PeFile ::readPeHeader should check ih.subsystem.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65526
https://github.com/upx/upx/issues/767
	modified:   pefile.cpp
2024-01-10 16:28:17 -08:00
John Reiser f3728d99b9 Check ph.method in PackMachBase::unpack
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65553
https://github.com/upx/upx/issues/766
	modified:   p_mach.cpp
2024-01-10 16:04:08 -08:00
John Reiser b87f60a917 Check Mach_fat_arch.align
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65558
https://github.com/upx/upx/issues/765
	modified:   p_mach.cpp
2024-01-10 15:31:37 -08:00
John Reiser 28f26da6ab Need more care in PackMachBase::canUnpack()
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65532
https://github.com/upx/upx/issues/764
	modified:   p_mach.cpp
2024-01-10 15:14:54 -08:00
John Reiser d3e780d617 Unpacking ELF requires e_phnum at least 2
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65535
https://github.com/upx/upx/issues/763
	modified:   p_lx_elf.cpp
2024-01-10 14:07:58 -08:00
John Reiser d549c2b5c9 More care when recovering from slid b_info
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65531
https://github.com/upx/upx/issues/762
	modified:   p_lx_elf.cpp
2024-01-10 13:38:18 -08:00
John Reiser f310ce376e Beware fuzzer setting compressed size too small
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65519
https://github.com/upx/upx/issues/761
	modified:   p_unix.cpp
2024-01-10 11:20:47 -08:00
John Reiser 553fc9b1fb invert_pt_dynamic: Compilers differ, unsigned vs. signed
modified:   p_lx_elf.cpp
2024-01-10 10:33:33 -08:00
John Reiser 6dde9f7dc0 find_overlay_offset() did not check carefully enough
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65518
https://github.com/upx/upx/issues/760
	modified:   p_unix.cpp
2024-01-10 10:05:28 -08:00
John Reiser 3dca1175e5 invert_pt_dynamic() needs better checking for malformed input
https://github.com/upx/upx/issues/759
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65510
	modified:   p_lx_elf.cpp
2024-01-10 09:41:12 -08:00
John Reiser 09c5e38322 arm64-linux.elf ABI owns x0 at execve()?
https://github.com/upx/upx/issues/758
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/tmp/arm64-linux.elf-fold.map
2024-01-09 12:17:01 -08:00
John Reiser fe6f1f0bb6 arm64-linux.elf-fold.S typo (eyesight)
https://github.com/upx/upx/issues/743
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/arm64-linux.elf-fold.h
	modified:   src/stub/src/arm64-linux.elf-fold.S
2024-01-09 10:01:07 -08:00
Markus F.X.J. Oberhumer 250c656b9e testsuite: update checksums caused by version bump 2024-01-04 03:18:19 +01:00
Markus F.X.J. Oberhumer 9a0b5b65b8 all: remove unused scripts 2024-01-04 03:09:48 +01:00
Markus F.X.J. Oberhumer 57b2fb4c62 all: post-release version bump 2024-01-04 02:52:22 +01:00
Markus F.X.J. Oberhumer 099c3d829e all: prepare for release. 2024-01-03 18:43:18 +01:00
Markus F.X.J. Oberhumer a1a6d02b6f all: tired of CI updates 2024-01-03 18:01:56 +01:00
Markus F.X.J. Oberhumer f2ad7fb9c4 testsuite: update checksums caused by version bump 2024-01-03 18:00:07 +01:00
Markus F.X.J. Oberhumer 1bcf709fcf all: bump version date 2024-01-03 17:54:43 +01:00
Markus F.X.J. Oberhumer 47fc230893 all: welcome 2024 2024-01-03 17:47:25 +01:00
Markus F.X.J. Oberhumer be05d85570 submodules: update for new versions 2024-01-03 17:44:57 +01:00
Markus F.X.J. Oberhumer f598fa13a9 clang-format 2024-01-03 17:36:43 +01:00
Markus F.X.J. Oberhumer 568859d16f CI updates 2024-01-03 17:31:16 +01:00
Markus F.X.J. Oberhumer b5ed0a637b CI updates 2023-12-29 10:02:46 +01:00
Markus F.X.J. Oberhumer 17eff0aed4 CI updates 2023-12-29 05:45:00 +01:00
Markus F.X.J. Oberhumer 0a3f048eed CI updates 2023-12-29 05:14:03 +01:00
Markus F.X.J. Oberhumer 3cde897557 Improve testsuite. 2023-12-28 21:44:53 +01:00
Markus F.X.J. Oberhumer 0500e7d016 CI updates; cxxlib.h cleanups 2023-12-28 04:42:41 +01:00
Markus F.X.J. Oberhumer 778663ae69 CI updates 2023-12-21 23:01:52 +01:00
Markus F.X.J. Oberhumer 636cefb9f3 cmake update 2023-12-20 18:49:34 +01:00
Markus F.X.J. Oberhumer 1236776aa2 cmake update 2023-12-20 12:16:25 +01:00
Markus F.X.J. Oberhumer 51a6a5cca5 src: rename ptr_reinterpret_cast to ptr_static_cast; misc cleanups 2023-12-20 11:44:01 +01:00
Markus F.X.J. Oberhumer 3326c86e91 cmake update 2023-12-19 16:11:23 +01:00
Markus F.X.J. Oberhumer b0dbc3fe39 submodules: update for new versions 2023-12-19 16:10:32 +01:00
Markus F.X.J. Oberhumer decc1efb74 CI updates 2023-12-17 07:35:39 +01:00
Markus F.X.J. Oberhumer 2cf1c32d18 CI updates 2023-12-13 18:52:55 +01:00
Markus F.X.J. Oberhumer fc6e3840b7 CI updates 2023-12-09 08:52:25 +01:00
Markus F.X.J. Oberhumer 5e85c1a11b submodules: update for new versions 2023-12-09 08:34:48 +01:00
Markus F.X.J. Oberhumer 468bfce599 submodules: update for new versions 2023-12-02 01:52:32 +01:00
Markus F.X.J. Oberhumer 1e6e4043ed CI updates and minor cleanups. 2023-12-02 01:48:26 +01:00
John Reiser 67564513d2 Update because of age and evolution.
modified:   elf-to-mem.txt
2023-11-30 11:10:24 -08:00
John Reiser ed2633bf95 Honor .p_align <= 64K; else assume 4K is also available
https://github.com/upx/upx/issues/737
	modified:   p_lx_elf.cpp
2023-11-26 11:46:12 -08:00
Markus F.X.J. Oberhumer 3e70021406 all: more minor cleanups 2023-11-26 18:30:47 +01:00
Markus F.X.J. Oberhumer bf8dd31914 all: minor cleanups 2023-11-21 20:29:54 +01:00
John Reiser d4e94f5086 Fix varying page size on arm64
https://github.com/upx/upx/issues/734
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
          ... plus associated stub/*.h etc
2023-11-17 15:10:31 -08:00
John Reiser ae77fd60bb initial headway is limited by both file_size and mhcmdi.sizeofcmds
https://github.com/upx/upx/issues/732
	modified:   p_mach.cpp
2023-11-17 07:28:21 -08:00
Markus F.X.J. Oberhumer e79c790264 CI updates 2023-11-17 11:50:52 +01:00
Markus F.X.J. Oberhumer 46029bb8a0 CI updates 2023-11-15 13:06:29 +01:00
Markus F.X.J. Oberhumer f74c225338 CI updates 2023-11-14 19:15:34 +01:00
Markus F.X.J. Oberhumer c479fe32b3 cmake update 2023-11-13 11:29:17 +01:00
Markus F.X.J. Oberhumer dc23ee0ad2 submodules: update for new versions 2023-11-08 11:48:39 +01:00
Markus F.X.J. Oberhumer a5c32db01b CI updates 2023-11-08 11:25:23 +01:00
Markus F.X.J. Oberhumer d7142312c9 CI updates 2023-11-08 10:08:19 +01:00
Markus F.X.J. Oberhumer 283ab0e7ea CI updates and assorted cleanups 2023-11-06 19:29:40 +01:00
Markus F.X.J. Oberhumer b6dd61cea8 CI updates 2023-11-05 09:03:38 +01:00
Markus F.X.J. Oberhumer 11970d276d CI updates 2023-11-04 06:30:07 +01:00
Markus F.X.J. Oberhumer d618716ec1 Minify .clang-format
Remove all settings that currently do not have any effect.
2023-11-03 17:56:12 +01:00
Markus F.X.J. Oberhumer 4f0f977f04 CI updates and cleanups 2023-11-03 17:52:46 +01:00
Markus F.X.J. Oberhumer 2c4b1d8a8c submodules: update for new versions 2023-11-03 16:46:57 +01:00
Markus F.X.J. Oberhumer b2810c6deb testsuite: update checksums caused by version bump 2023-11-01 15:12:39 +01:00
Markus F.X.J. Oberhumer ceb2b56b71 all: post-release version bump 2023-11-01 15:07:18 +01:00
Markus F.X.J. Oberhumer d14fa5f8a4 all: prepare for release 2023-11-01 12:00:03 +01:00
Markus F.X.J. Oberhumer 79263a52ac submodules: update for new versions 2023-11-01 11:40:28 +01:00
Markus F.X.J. Oberhumer ecb3f83e83 CI updates 2023-11-01 11:28:35 +01:00
Markus F.X.J. Oberhumer f6aedb35ce CI updates 2023-11-01 10:06:27 +01:00
Markus F.X.J. Oberhumer 3b7d25ac49 CI updates 2023-11-01 08:48:27 +01:00
Markus F.X.J. Oberhumer e964d4acf3 src/util: change TriBool logic to use a bool template parameter 2023-10-31 12:24:44 +01:00
Markus F.X.J. Oberhumer e306085b81 CI updates 2023-10-31 11:49:18 +01:00
Markus F.X.J. Oberhumer b094ad4f2b CI updates 2023-10-31 10:34:55 +01:00
Markus F.X.J. Oberhumer 19c6b969ab src/options: fix bad TriBool ThirdValue for pefile compress_resources 2023-10-30 21:36:36 +01:00
Markus F.X.J. Oberhumer acfda848cd src/check: add some more tribool checks 2023-10-30 20:29:05 +01:00
John Reiser 52400e2561 /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/
2023-10-30 08:23:52 -07:00
Markus F.X.J. Oberhumer f62576a2be CI updates and minor cleanups 2023-10-30 14:15:35 +01:00
Markus F.X.J. Oberhumer 19bf9f59e9 src: clang-format stub/tools/armpe/armpe_tester.c 2023-10-30 13:07:20 +01:00
Markus F.X.J. Oberhumer fadf7cfc7b src: work on packed_struct cleanup 2023-10-30 12:55:07 +01:00
Markus F.X.J. Oberhumer ec0c9399fa src: clang-format conf.h 2023-10-30 12:30:58 +01:00
Markus F.X.J. Oberhumer 37b923245d all: various cleanups 2023-10-30 12:17:51 +01:00
Markus F.X.J. Oberhumer 38a676f6f7 src: introduce upx::ptr_reinterpret_cast 2023-10-29 16:52:24 +01:00
Markus F.X.J. Oberhumer cd1df6f6b1 all: update version 2023-10-29 15:37:13 +01:00
Markus F.X.J. Oberhumer 4a24fe8c53 CI updates and cleanups 2023-10-29 15:12:33 +01:00
Markus F.X.J. Oberhumer 6dac3dd248 CI updates 2023-10-27 09:24:06 +02:00
Markus F.X.J. Oberhumer 37d393cbc8 src: prefer using SetFileTime() on Windows 2023-10-27 06:58:14 +02:00
Markus F.X.J. Oberhumer 27f155374a testsuite: update checksums caused by version bump 2023-10-26 12:28:52 +02:00
Markus F.X.J. Oberhumer 8102137ad7 all: post-release version bump 2023-10-26 12:25:13 +02:00
Markus F.X.J. Oberhumer 9c46f4653f all: prepare for release 2023-10-26 11:09:48 +02:00
Markus F.X.J. Oberhumer 29b4752d0e src: add some noexcept 2023-10-26 00:28:36 +02:00
Markus F.X.J. Oberhumer 2724039c09 submodules: update for new versions 2023-10-26 00:23:57 +02:00
Markus F.X.J. Oberhumer 6ae4e88475 cmake: fix Xcode generator build 2023-10-25 06:47:09 +02:00
Markus F.X.J. Oberhumer facabd68d7 all: more minor cleanups 2023-10-24 23:56:55 +02:00
Markus F.X.J. Oberhumer 18f043015e all: minor cleanups 2023-10-24 22:54:54 +02:00
Markus F.X.J. Oberhumer ab259a1af9 src/pefile: try to clean up reloc handling 2023-10-24 11:47:23 +02:00
Markus F.X.J. Oberhumer 1dd96a7628 src/pefile: stricter reloc checks; cleanups 2023-10-23 14:26:37 +02:00
Markus F.X.J. Oberhumer 1ee7ecb1f0 all: prefer using utimensat() 2023-10-22 13:29:26 +02:00
Markus F.X.J. Oberhumer 67548a4d9a src: minor cleanups 2023-10-22 00:45:06 +02:00
Markus F.X.J. Oberhumer 9fbe95ad48 all: cleanups 2023-10-21 11:22:18 +02:00
dependabot[bot] 91c15b2475 build(deps): bump crate-ci/typos from 1.16.19 to 1.16.20
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.16.19 to 1.16.20.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/35a8bc67870d6c0b7407683319ae175577e24261...c004e98018d8621614d1ca516eed8ca2d04b365a)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-18 16:00:48 +00:00
Markus F.X.J. Oberhumer c9550b48d8 all: disable packing macOS binaries for now 2023-10-18 07:04:00 +02:00
Markus F.X.J. Oberhumer a1d090a6fd src/stub: add a "clang-format off" directive 2023-10-15 10:55:15 +02:00
Markus F.X.J. Oberhumer 4870765e1b all: disable packing macOS binaries for now 2023-10-15 10:15:46 +02:00
Markus F.X.J. Oberhumer d8be2ed276 src/pefile.cpp: cleanup reloc handling and add more checks 2023-10-14 19:24:44 +02:00
Markus F.X.J. Oberhumer 2b371e99bd src/util: minor xspan enhancements 2023-10-14 05:58:47 +02:00
Markus F.X.J. Oberhumer 005e39871b CI updates 2023-10-13 00:49:01 +02:00
Markus F.X.J. Oberhumer 96dd9eeb44 CI updates 2023-10-13 00:01:00 +02:00
John Reiser 65b06f6046 More LZMA inSize (srclen) defense
https://github.com/upx/upx/issues/717

	modified:   stub/src/amd64-darwin.dylib-entry.S  fixed
	modified:   stub/src/amd64-darwin.macho-entry.S  fixed
	modified:   stub/src/amd64-linux.elf-so_entry.S  comment-only
	modified:   stub/src/i386-linux.elf-so_entry.S  comment-only

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-linux.elf-so_entry.h
	modified:   stub/tmp/amd64-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-so_entry.bin.dump

Find+fix steps that were performed:
1. Find all 'add' instructions that compute "eof".
NRV run-time decompressors ignore srclen, so 'add' can be ignored for them.

$ cd upx-devel4/src/stub
$ grep -sr 'add.*eof' src  |  grep -v 'nrv2._d.*.S'  |  sort
src/amd64-darwin.dylib-entry.S:        addq src,lsrc; push lsrc  // &input_eof
src/amd64-darwin.macho-entry.S:        addq src,lsrc; push lsrc  // &input_eof
src/amd64-linux.elf-entry.S:        addq src,lsrc; push lsrc  // &input_eof
src/amd64-linux.elf-so_entry.S:        addq src,lsrc; push lsrc  // MATCH_05  &input_eof
src/amd64-linux.elf-so_main.c:            void *mfd_addr = Pmap(0, sizeof(code), PROT_READ|PROT_EXEC, MAP_PRIVATE, mfd, 0);
src/amd64-linux.shlib-init.S:        addq src,lsrc; push lsrc  // &input_eof
src/arch/amd64/lzma_d.S://      addq src,lsrc; push lsrc  // &input_eof
src/i386-expand.S:    add src,%ecx; push %ecx  // MATCH_52  eof_src
src/i386-linux.elf-so_entry.S:        add src,lsrc; push lsrc  // MATCH_05  &input_eof

2.  Case-by-case inspection

src/amd64-darwin.dylib-entry.S:        addq src,lsrc; push lsrc  // &input_eof
    restoring 'subq' is added in this commit

src/amd64-darwin.macho-entry.S:        addq src,lsrc; push lsrc  // &input_eof
    restoring 'subq' is added in this commit

src/amd64-linux.elf-entry.S:        addq src,lsrc; push lsrc  // &input_eof
    a restoring 'subq' is already next

src/amd64-linux.elf-so_entry.S:        addq src,lsrc; push lsrc  // MATCH_05  &input_eof
    lsrc is dead for inlined nrv2b

src/amd64-linux.elf-so_main.c:            void *mfd_addr = Pmap(0, sizeof(code), PROT_READ|PROT_EXEC, MAP_PRIVATE, mfd, 0);
    .c code

src/amd64-linux.shlib-init.S:        addq src,lsrc; push lsrc  // &input_eof
    restoring 'subq' is already next

src/arch/amd64/lzma_d.S://      addq src,lsrc; push lsrc  // &input_eof
    comment that explains preceding actions in ELFMAINX; a restoring 'subq' is already next

src/i386-expand.S:    add src,%ecx; push %ecx  // MATCH_52  eof_src
    %ecx is dead

src/i386-linux.elf-so_entry.S:        add src,lsrc; push lsrc  // MATCH_05  &input_eof
    lsrc is dead for inlined nrv2b
2023-10-12 10:41:13 -07:00
John Reiser 0515be4334 LZMA on AMD64 had bug in calling sequence, leading to random exit(127)
LzmaDecode randomly decided that the input had ended in the middle,
because of error in interface between ELFMAINX and the decoder.

Thanks to Kevin Gosse!
https://github.com/upx/upx/pull/716
https://github.com/MichalStrehovsky/PublishAotCompressed/issues/11
2023-10-06 14:14:32 -07:00
Markus F.X.J. Oberhumer e32de83758 CI updates 2023-10-05 12:23:17 +02:00
Markus F.X.J. Oberhumer e767461f65 src: more clang-format 2023-10-05 11:53:02 +02:00
Markus F.X.J. Oberhumer 632c7c4826 all: assorted cleanups; introduce undocumented '--sysinfo' option 2023-10-05 03:51:27 +02:00
Markus F.X.J. Oberhumer 7f9d381c7b CI updates 2023-09-30 10:46:39 +02:00
Markus F.X.J. Oberhumer 4d5d6661d5 submodules: update for new versions 2023-09-30 09:44:58 +02:00
John Reiser b0b87eda02 check-whitespace
modified:   stub/src/upxfd_android.c
2023-09-28 12:49:14 -07:00
John Reiser f63a673a8b Prepare to emulate memfd_create() on 32-bit Android (ARM and i386)
modified:   stub/src/include/linux.h
	new file:   stub/src/upxfd_android.c
	new file:   stub/src/upxfd_create.c
2023-09-28 12:44:49 -07:00
John Reiser 290dd0c5d2 Git straggler
modified:   src/stub/tmp/i386-linux.elf-entry.bin.dump
2023-09-28 12:09:32 -07:00
John Reiser 194bf2b852 Common prototypes for mmap and ftruncate
modified:   src/stub/src/include/linux.h
	modified:   src/stub/src/amd64-linux.elf-so_main.c
	modified:   src/stub/src/i386-linux.elf-so_main.c
	modified:   src/stub/src/i386-linux.elf.execve-main.c
	modified:   src/stub/src/i386-linux.elf.interp-main.c
	modified:   src/stub/src/i386-linux.elf.shell-main.c
2023-09-28 12:07:04 -07:00
John Reiser d6d5e7ae3d For Android emulator: align i386 LEXEC020 binfo
modified:   src/stub/src/i386-linux.elf-entry.S
	modified:   src/p_lx_elf.cpp

	modified:   src/stub/i386-linux.elf-entry.h
	modified:   misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
2023-09-28 12:02:28 -07:00
Markus F.X.J. Oberhumer 39a6cc4b5f src: improve memory sanitizer handling 2023-09-26 15:15:55 +02:00
Markus F.X.J. Oberhumer a24de15060 submodules: update for new versions 2023-09-26 15:15:55 +02:00
Markus F.X.J. Oberhumer eb021accd1 CI updates 2023-09-25 13:47:43 +02:00
Markus F.X.J. Oberhumer 98a77dde00 CI updates 2023-09-22 17:33:22 +02:00
John Reiser 854988bc5f Detect AlreadyPacked even when trailing PackHeader has been lopped.
This is heuristic, but strong.
https://github.com/upx/upx/issues/712
	modified:   p_lx_elf.cpp
	modified:   p_unix.h
2023-09-21 14:12:18 -07:00
John Reiser bfeed2ab9a MAP_PRIVATE to capture memfd pages before closing the fd
https://github.com/upx/upx/issues/710

	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c

	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_fold.h
2023-09-20 13:12:04 -07:00
Markus F.X.J. Oberhumer d11fc71e79 CI updates 2023-09-20 11:24:55 +02:00
Markus F.X.J. Oberhumer f1703fa322 CI updates 2023-09-19 11:47:15 +02:00
Markus F.X.J. Oberhumer 06675acc67 all: cosmetic cleanups 2023-09-18 15:19:37 +02:00
Markus F.X.J. Oberhumer 57ad6bc37d CI updates 2023-09-11 06:52:57 +02:00
dependabot[bot] 0192b0b7e4 build(deps): bump actions/checkout from 3 to 4 (#707)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 18:54:02 +02:00
Markus F.X.J. Oberhumer 3b098b845a CI updates 2023-09-06 12:48:30 +02:00
Markus F.X.J. Oberhumer ac398f1ffe CI updates 2023-09-06 01:48:20 +02:00
Markus F.X.J. Oberhumer 92dfb9c83c testsuite: add file system test suite test_symlinks.sh 2023-09-06 00:09:44 +02:00
Markus F.X.J. Oberhumer 38d6cb090c src/packer.cpp: fix bug in constructor introduced during cleanup
Introduced in 10e759f1f1
2023-09-05 21:09:17 +02:00
Markus F.X.J. Oberhumer e93172bd33 src/work.cpp: clean up get_open_flags() 2023-09-05 06:09:13 +02:00
Markus F.X.J. Oberhumer 30fcca4b64 src: optimize preserve_link: only if the file has actual link-count >= 2 2023-09-05 05:50:47 +02:00
Markus F.X.J. Oberhumer 4f6320d3aa src: add new option --link to preserve hard links; use with care 2023-09-04 22:34:21 +02:00
Markus F.X.J. Oberhumer 62dbf8485f src: sort cleanups 2023-09-04 07:28:48 +02:00
John Reiser 9331ed39d4 32-bit Android lacks memfd_create, and has varying __NR_ftruncate
https://github.com/upx/upx/issues/700
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S

	modified:   stub/arm.v4a-linux.elf-so_entry.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_entry.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
2023-09-02 15:31:32 -07:00
Markus F.X.J. Oberhumer 35dd9cfd22 src: retract libc qsort() requirements 2023-09-02 16:15:57 +02:00
Markus F.X.J. Oberhumer 0ac6c36af2 src: add a check for libc qsort(); cleanups 2023-09-01 11:59:29 +02:00
Markus F.X.J. Oberhumer 3c4b959f78 all: update clang-format settings 2023-09-01 11:29:51 +02:00
Markus F.X.J. Oberhumer a00687b092 src/p_mach.cpp: make sort order deterministic 2023-09-01 11:11:00 +02:00
Markus F.X.J. Oberhumer bb6b087862 src: implement upx_shellsort() 2023-09-01 10:49:47 +02:00
John Reiser bfb438dc89 Sync stubs
modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-08-31 13:34:49 -07:00
John Reiser cd3f69c290 Explicit write() can subsume ftruncate()
modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c
2023-08-31 13:25:53 -07:00
Markus F.X.J. Oberhumer d54315392e src: add support for NO_COLOR environment variable 2023-08-31 12:31:31 +02:00
Markus F.X.J. Oberhumer cfa8107ab9 src: make sort order deterministic, next try
We cannot compare pointers as they may point to qsort-local objects.
And we must make sure that cmp(a,b) always agrees with cmp(b,a).
2023-08-30 16:41:59 +02:00
Markus F.X.J. Oberhumer f4e5b29708 src: make sort order deterministic 2023-08-28 02:08:34 +02:00
Markus F.X.J. Oberhumer d65fea1147 src/bele.h: try to detect possible size-mismatches 2023-08-28 00:23:53 +02:00
Markus F.X.J. Oberhumer 25a3c109c1 CI updates 2023-08-27 13:30:51 +02:00
John Reiser b526eed346 Detect "no Shdrs" earlier when already packed
https://github.com/upx/upx/issues/699
	modified:   p_lx_elf.cpp
2023-08-23 19:52:35 +02:00
John Reiser 59c6a71b72 More use of ph_forced_method()
modified:   p_lx_elf.cpp
2023-08-23 19:52:35 +02:00
John Reiser c7a2a0faa1 Document path to mach-o/loader.h on Apple CommandLineTools
modified:   p_mach_enum.h
2023-08-23 19:52:35 +02:00
John Reiser bfb5ea50a9 Temporary
modified:   p_lx_elf.cpp
2023-08-23 19:52:35 +02:00
John Reiser 149d84edca --brute versus forced_method(ph.method)
https://github.com/upx/upx/issues/694  (partial)
	modified:   p_lx_elf.cpp
2023-08-23 19:52:35 +02:00
Markus F.X.J. Oberhumer 7636abc158 CI updates 2023-08-22 11:12:48 +02:00
Markus F.X.J. Oberhumer 6eace187e7 src: add a famous quote 2023-08-22 00:37:45 +02:00
Markus F.X.J. Oberhumer dd1838a7eb src: minor cleanups 2023-08-21 22:41:42 +02:00
Markus F.X.J. Oberhumer dd928cf956 src: update MemBuffer::getSizeForCompression() 2023-08-21 22:32:28 +02:00
Markus F.X.J. Oberhumer 38be230467 submodules: update for new versions 2023-08-21 22:28:25 +02:00
Markus F.X.J. Oberhumer 1f747a28a9 all: spell check 2023-08-17 12:55:38 +02:00
Markus F.X.J. Oberhumer 1a7732b285 CI update: add ASAN/MSAN/valgrind checks 2023-08-17 12:07:19 +02:00
Markus F.X.J. Oberhumer f8ea416a4d src/pefile.cpp: fix a pedantic ASAN error 2023-08-17 00:08:03 +02:00
Markus F.X.J. Oberhumer b9bf81d548 src/p_lx_elf.cpp: init o_binfo to avoid crash with MSAN build
This should be double-checked by @jreiser
2023-08-16 22:23:28 +02:00
Markus F.X.J. Oberhumer 8975e2a6b5 src: create util/cxxlib.h 2023-08-16 10:05:59 +02:00
Markus F.X.J. Oberhumer 394cd77bec all: cleanups 2023-08-16 01:06:52 +02:00
Markus F.X.J. Oberhumer a9ac4b5e23 src: introduce type tribool 2023-08-15 14:44:50 +02:00
Markus F.X.J. Oberhumer 10e759f1f1 src: minor cleanups 2023-08-11 13:32:53 +02:00
Markus F.X.J. Oberhumer 777d4f5279 src: refactoring: create packhead.h and move some methods 2023-08-11 03:57:20 +02:00
Markus F.X.J. Oberhumer c65c882ecc src: class Packer decomposition, introduce PackerBase 2023-08-10 20:40:27 +02:00
Markus F.X.J. Oberhumer a66ee9fafd CI update 2023-08-09 21:08:04 +02:00
Markus F.X.J. Oberhumer 757401dd0c CI and spell checks 2023-08-09 13:08:38 +02:00
Markus F.X.J. Oberhumer 11e3770864 CI updates 2023-08-08 15:57:45 +02:00
Markus F.X.J. Oberhumer fbb317e9c8 submodules: update for new versions 2023-08-08 12:54:11 +02:00
Markus F.X.J. Oberhumer 9d7698a359 testsuite: update checksums caused by version bump 2023-08-08 12:46:17 +02:00
Markus F.X.J. Oberhumer 44fd11f4dd all: post-release version bump 2023-08-08 12:43:47 +02:00
Markus F.X.J. Oberhumer 8779113131 all: prepare for release 2023-08-08 10:38:12 +02:00
Markus F.X.J. Oberhumer 26cfd0a616 all: minor cleanups 2023-08-08 10:34:12 +02:00
John Reiser 75e153dd99 More care in ::forward_Shdrs() and ::pack4()
Also, de-compressing arm64 shlib restores .init_array[0],
although supposedly *_RELATIVE relocation should overwrite.

https://github.com/upx/upx/issues/693
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2023-08-04 11:52:58 -07:00
Markus F.X.J. Oberhumer fa364d6ea3 all: final cleanups in preparation for release 2023-08-03 14:20:35 +02:00
Markus F.X.J. Oberhumer 13e5c13695 Fix functional change in commit 905bfacf44 2023-08-02 17:45:17 +02:00
John Reiser 43b3b54197 spell check typos
modified:   p_lx_exc.cpp
	modified:   p_mach.cpp
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/arch/mips/r3000/bits.ash
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm64-linux.shlib-init.S
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
2023-07-31 09:05:32 -07:00
John Reiser 3a16d4a12e Spell check; No-Functional-Change
modified:   p_lx_elf.cpp
2023-07-31 06:06:31 -07:00
Markus F.X.J. Oberhumer 50fc9235de misc: update podman test-qemu 2023-08-01 07:24:10 +02:00
Markus F.X.J. Oberhumer 70287d3c49 clang-tidy 2023-07-31 14:49:48 +02:00
John Reiser 41e9f7985f forward_Shdrs: elfout for main, lowmem for shlib
Especially Android.
https://github.com/upx/upx/issues/680
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2023-07-29 13:43:33 -07:00
John Reiser c3327977da Pwrite:
modified:   stub/src/amd64-linux.elf-so_fold.S

	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-07-29 13:42:20 -07:00
John Reiser 905bfacf44 Pacify clang-tidy 2023-07-26 17:21:39 -07:00
Markus F.X.J. Oberhumer 053e95033f all: improve C++ static analyzers 2023-07-26 22:28:47 +02:00
Markus F.X.J. Oberhumer 5a1203be0d submodules: update for new versions 2023-07-26 18:13:25 +02:00
John Reiser 745fef7425 fpad4, fpad8, and _Shdr hacking should guard against (!fo)
Also pacify some clang scan-build complaints.
	modified:   p_lx_elf.cpp
2023-07-26 07:27:12 -07:00
John Reiser c9d625a237 Use 'elfout' for changing ElfXX_Ehdr
https://github.com/upx/upx/issues/688
	modified:   p_lx_elf.cpp
2023-07-26 07:15:22 +02:00
John Reiser 334731f56b Sync stubs for powerpc64le-linux.elf/upx-3.95
How did this mismatch happen?
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
	modified:   stub/arm64-linux.elf-so_entry.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
2023-07-26 07:15:22 +02:00
John Reiser d5e7672a45 De-activate "bkpt" at entry
modified:   arm64-linux.elf-so_entry.S
2023-07-26 07:15:22 +02:00
Markus F.X.J. Oberhumer e702aa0252 Review 2023-07-26 07:15:22 +02:00
John Reiser 2684e815e0 Fix use of memfd_create for shlib stubs, espcially Android
Also relocation of init_array[0] for Elf32 shlib.
        https://github.com/upx/upx/issues/220
        https://github.com/upx/upx/issues/609
        https://github.com/upx/upx/issues/680

	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   p_lx_elf.cpp

	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/arm64-linux.elf-so_entry.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-so_fold.S

	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_entry.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-07-26 07:15:22 +02:00
John Reiser efbc93229a Un-debug amd64-linux.elf-so_main.c
modified:   stub/src/amd64-linux.elf-so_main.c

	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-07-26 07:15:22 +02:00
John Reiser 05539ad5b6 Fix stubs for shlib with only 2 PT_LOAD 2023-07-26 07:15:22 +02:00
John Reiser 670aae2e11 Check /proc/self/auxv exists
modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c

	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-07-26 07:15:22 +02:00
John Reiser e6ff68dc2c Turn on DEBUG for 64-bit shlib
modified:   src/stub/src/amd64-linux.elf-so_main.c

	modified:   src/stub/amd64-linux.elf-so_fold.h
	modified:   src/stub/arm64-linux.elf-so_fold.h
	modified:   src/stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-07-26 07:15:22 +02:00
Markus F.X.J. Oberhumer 641b116f04 Update .gitattributes. 2023-07-25 12:18:33 +02:00
Markus F.X.J. Oberhumer f81f7194ed submodules: update for new versions 2023-07-25 12:05:14 +02:00
Markus F.X.J. Oberhumer 161d20e614 CI: update 2023-07-24 14:47:32 +02:00
Markus F.X.J. Oberhumer fc4dcd46db CI and build updates 2023-07-22 16:12:13 +02:00
Markus F.X.J. Oberhumer 891dc87064 misc: upx_testsuite; move podman directories into subdirectory 2023-07-22 00:19:11 +02:00
Markus F.X.J. Oberhumer b866631448 misc: improve upx_testsuite; cmake update 2023-07-19 20:12:20 +02:00
John Reiser 672d69c68a Fix unpacking of upx-3.94-armeb_linux/upx
Getting past the code of the stub must deal with variances
between released versions.
	modified:   p_lx_elf.cpp
2023-07-18 16:56:39 -07:00
Markus F.X.J. Oberhumer 507c31ec14 CI and cmake updates 2023-07-18 07:21:51 +02:00
John Reiser 65cc40bdda Align escape hatch in powerpc64 main program
modified:   stub/src/amd64-linux.elf-main.c
	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh

	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2023-07-17 15:58:01 -07:00
John Reiser 067895fa5f Fix brk+munmap in folded stubs for main programs
qemu emulating a compressed ET_EXEC revealed an access to ElfXX_Phdr
on the discarded side of brk() during cleanup. qemu was more aggressive
than the Linux kernel implementation of brk().
        https://github.com/upx/upx/issues/683

	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/include/linux.h

	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh

	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-fold.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:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h

	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2023-07-17 07:21:56 +02:00
Markus F.X.J. Oberhumer 3f7f26c74b CI: update 2023-07-16 21:28:26 +02:00
Markus F.X.J. Oberhumer 9a6b5940cf CI: update 2023-07-16 15:14:19 +02:00
Markus F.X.J. Oberhumer 828f4a63bf src: add some "explicit"; cleanups 2023-07-16 07:37:31 +02:00
John Reiser 707fb55625 A fuzzer attacked i386-dos32.watcom.le 2023-07-06 20:25:14 -07:00
Markus F.X.J. Oberhumer 8d41ae09c8 all: misc updates 2023-07-12 18:59:08 +02:00
Markus F.X.J. Oberhumer 7ec0faca1e all: misc and noexcept updates 2023-07-09 17:36:24 +02:00
Markus F.X.J. Oberhumer 300fa29446 CI: update 2023-07-08 21:28:29 +02:00
Markus F.X.J. Oberhumer 6981f7b3ae misc: add misc/test-qemu-with-podman 2023-07-08 18:14:41 +02:00
Markus F.X.J. Oberhumer 682a1e97e4 src: add assert_noexcept() 2023-07-08 12:06:27 +02:00
Markus F.X.J. Oberhumer 1d71dd3851 all: clang-tidy updates 2023-07-08 10:51:02 +02:00
Markus F.X.J. Oberhumer 5edfda46e5 all: clang-tidy updates 2023-07-08 09:59:41 +02:00
Markus F.X.J. Oberhumer d7754a97c7 all: add support for clang-tidy 2023-07-07 23:13:08 +02:00
Markus F.X.J. Oberhumer c79aa6ad8a all: cosmetic updates 2023-07-06 18:03:37 +02:00
Markus F.X.J. Oberhumer 525e091472 src/console: disable win32 screen driver when running under Wine 2023-07-06 10:09:38 +02:00
Markus F.X.J. Oberhumer 16f6de677d misc: podman updates 2023-07-06 10:09:38 +02:00
John Reiser 12c36bab6c Linux EINVAL for zero-length mmap: mmap(, 0, ,,,)
https://github.com/upx/upx/issues/681
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c

	modified:   stub/src/i386-bsd.elf-main.c
	modified:   stub/src/i386-openbsd.elf-main.c

	modified:   ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/i386-bsd.elf-fold.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-netbsd.elf-fold.h
	modified:   stub/i386-openbsd.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/i386-bsd.elf-fold.map
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/i386-netbsd.elf-fold.map
	modified:   stub/tmp/i386-openbsd.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2023-07-06 10:09:07 +02:00
John Reiser c429859cbf Placate Android dlopen() some more.
https://github.com/upx/upx/issues/680
	modified:   p_lx_elf.cpp
2023-07-06 10:08:41 +02:00
John Reiser dc76b2af97 info(Android_penalty)
modified:   p_lx_elf.cpp
2023-06-26 09:09:47 -07:00
Markus F.X.J. Oberhumer b75e7687f4 all: CI and misc updates 2023-06-30 01:20:48 +02:00
Markus F.X.J. Oberhumer ece5af2895 CI: make sure that directories which contain whitespace do work 2023-06-28 18:18:36 +02:00
Markus F.X.J. Oberhumer 1aaa33552e all: move testsuite to misc/testsuite; CI updates 2023-06-27 14:27:19 +02:00
Markus F.X.J. Oberhumer f622871eb0 src: fix building under freebsd; updates 2023-06-27 12:59:24 +02:00
Markus F.X.J. Oberhumer 060b01260d CI: yet more updates 2023-06-25 19:40:09 +02:00
Markus F.X.J. Oberhumer 871f8a4793 src: new ACC version 2023-06-25 14:30:00 +02:00
Markus F.X.J. Oberhumer c54e03d0f2 CI: ongoing cleanups 2023-06-25 03:27:51 +02:00
Markus F.X.J. Oberhumer aaf3f75990 CI and cmake updates 2023-06-25 01:55:06 +02:00
Markus F.X.J. Oberhumer 512a26cee4 CI: update 2023-06-24 10:16:43 +02:00
John Reiser b4a793ed26 Make ::forward_Shdrs more friendly to Android dlopen()
https://github.com/upx/upx/issues/220
https://github.com/upx/upx/issues/609
2023-06-22 10:16:25 -07:00
Markus F.X.J. Oberhumer 5d2c74008e all: cmake and noexcept updates 2023-06-23 14:13:08 +02:00
Markus F.X.J. Oberhumer 7fafc68940 CI: update 2023-06-19 14:28:12 +02:00
Markus F.X.J. Oberhumer d1af2af499 all: yet more misc updates 2023-06-15 19:42:54 +02:00
Markus F.X.J. Oberhumer a5206eb696 CI: cleanups 2023-06-14 07:40:14 +02:00
Markus F.X.J. Oberhumer 1ff0d137ab all: misc updates 2023-06-13 16:42:14 +02:00
John Reiser 07aa65b55e Sync stubs
Dependency processing does not propagate this one:
src/stub/src/arm.v5a-darwin.macho-main.c:
   #include "amd64-darwin.macho-main.c"
	modified:   arm.v5a-darwin.macho-fold.h
	modified:   tmp/arm.v5a-darwin.macho-fold.map
2023-06-13 16:29:13 +02:00
John Reiser 0fadddec65 Force 'bkpt' on arm.v5a and below
fixup  https://github.com/upx/upx/issues/612
	modified:   stub/src/amd64-darwin.macho-main.c
2023-06-13 16:29:13 +02:00
John Reiser 1bebe53cef Allow more bytes for Mach_headers in /usr/lib/dyld on MacOS 13
Fixes initial complaint (HelloUPX4) in https://github.com/upx/upx/issues/612
	modified:   stub/amd64-darwin.macho-fold.h
	modified:   stub/arm64-darwin.macho-fold.h
	modified:   stub/src/amd64-darwin.macho-fold.S
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/tmp/amd64-darwin.macho-fold.map
	modified:   stub/tmp/arm64-darwin.macho-fold.map
2023-06-13 16:29:13 +02:00
John Reiser 43019c744c Document requirement for 'homebrew' when developing on MacOS
... else testsuite fails for "readlink -en" and 'sha256sum'
https://github.com/upx/upx/issues/676
	modified:   README.SRC
2023-06-13 16:29:13 +02:00
Markus F.X.J. Oberhumer c585774162 CI: disable self-test on macos-13 2023-06-10 11:02:19 +02:00
Markus F.X.J. Oberhumer 75e87a58da src: rework mem_clear() 2023-06-09 18:20:06 +02:00
Markus F.X.J. Oberhumer 19e84fea62 all: yet more minor updates 2023-06-09 14:12:05 +02:00
Markus F.X.J. Oberhumer db39f9c4dc all: CI and misc updates 2023-06-06 23:16:28 +02:00
Markus F.X.J. Oberhumer dae45ae0d4 all: bump version; cleanups 2023-05-28 14:06:11 +02:00
Markus F.X.J. Oberhumer efeffc6e01 submodules: update for new versions 2023-05-28 13:58:27 +02:00
Markus F.X.J. Oberhumer ebf0f2f68a all: more minor cleanups 2023-05-27 22:58:07 +02:00
Markus F.X.J. Oberhumer 09bd1d8c40 all: misc updates 2023-05-19 13:21:26 +02:00
Markus F.X.J. Oberhumer 40653e40a4 all: minor cleanups 2023-05-14 09:36:10 +02:00
Markus F.X.J. Oberhumer b3e4efbabe all: misc updates 2023-05-13 16:28:44 +02:00
John Reiser 279101d464 Fix checksum of non-compressible extents
https://github.com/upx/upx/issues/673
	modified:   src/p_unix.cpp
2023-05-13 16:28:22 +02:00
Markus F.X.J. Oberhumer f571feee72 CI: use gcc -static for macos builds 2023-05-10 20:42:26 +02:00
Markus F.X.J. Oberhumer 900afd1c8c all: minor updates 2023-05-10 20:20:39 +02:00
Markus F.X.J. Oberhumer 08a72d5251 Fix whitespace. 2023-05-10 20:19:22 +02:00
John Reiser 736a6cd955 Catch amd64 ET_EXEC with .e_entry < 0x400000
https://github.com/upx/upx/issues/673
	modified:   p_lx_elf.cpp
2023-05-10 20:17:22 +02:00
John Reiser 75ce5e5df3 Fix SIGSEGV due to name confusion in ::forward_Shdrs
https://github.com/upx/upx/issues/671
	modified:   p_lx_elf.cpp
2023-05-10 20:17:22 +02:00
Markus F.X.J. Oberhumer eaf2143162 CI: add macos-13 2023-05-03 10:06:22 +02:00
Markus F.X.J. Oberhumer f0bdb8dea1 submodules: update for new versions 2023-05-03 09:49:20 +02:00
John Reiser 60093cfff6 Merge branch 'devel4' of https://github.com/upx/upx into devel4 2023-04-30 15:19:44 -07:00
John Reiser 56bb7b53cb Synch *.h stub headers and testcase checksums
Shared libraries for amd64, i386, arm64, and arm should be
compatible with SELinux: no complaints of execmod or execmem.

https://github.com/upx/upx/issues/609
https://github.com/upx/upx/issues/220
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/amd64-linux.elf-so_entry.h
	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_entry.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-so_entry.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_entry.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_entry.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/tmp/amd64-linux.elf-so_entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
2023-04-30 15:12:29 -07:00
John Reiser 0cffeca102 arm32 shlib works with SELinux
modified:   stub/src/arch/arm/v4a/macros.S
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/arm64-linux.elf-so_entry.S
	modified:   stub/src/i386-linux.elf-so_main.c
2023-04-28 13:52:26 -07:00
John Reiser 937d4462ca SELinux for i386 shlib stub
modified:   stub/src/i386-linux.elf-so_entry.S
	modified:   stub/src/i386-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/include/linux.h
2023-04-27 18:49:35 -07:00
John Reiser db5a39572c Change stub for arm64 shlib to work with SELinux
modified:   stub/src/arm64-linux.elf-so_entry.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
2023-04-27 10:44:13 -07:00
John Reiser ecc9c67e1f Check return value from syscalls; leave debugging hint if error
modified:   stub/src/amd64-linux.elf-so_entry.S
2023-04-27 10:42:56 -07:00
John Reiser 0901ce1b68 amd64-linux.elf shlib now fully-SELinux compliant
modified:   stub/src/amd64-linux.elf-so_entry.S
	modified:   stub/src/amd64-linux.elf-so_fold.S
2023-04-26 13:06:48 -07:00
John Reiser be6e77379a SELinux forces memfd_create for .so on amd64, arm64
More coming for .so: so_entry.S, powerpc64, 32-bit
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/arm64-linux.elf-so_entry.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
2023-04-26 08:30:55 -07:00
Markus F.X.J. Oberhumer 726f5de778 src: minor cleanups 2023-04-26 08:13:32 +02:00
John Reiser 98b835e0a7 WIP: SELinux is expensive: +2KB in stub
Needs make_hatch()
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/amd64-linux.elf-so_fold.S

	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-04-24 19:40:57 -07:00
John Reiser 04ffb641a6 Compilers generate junk .sh_info
modified:   p_lx_elf.cpp
2023-04-24 19:37:25 -07:00
John Reiser 1b7233b673 whitespace
modified:   stub/src/amd64-expand.S
2023-04-24 19:35:52 -07:00
John Reiser eaa0f33473 Fix call to unfilter from amd64-expand
modified:   stub/src/amd64-expand.S

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-04-21 08:57:10 -07:00
Markus F.X.J. Oberhumer c03b382d61 src: some more "noexcept" 2023-04-20 20:58:19 +02:00
Markus F.X.J. Oberhumer e633694255 cmake: use MSVC_FRONTEND 2023-04-20 20:10:12 +02:00
Markus F.X.J. Oberhumer 278b25bad2 cmake: check CMAKE_C_COMPILER_FRONTEND_VARIANT 2023-04-20 14:54:14 +02:00
Markus F.X.J. Oberhumer f89f0838dc src: change UPX_CONFIG logic to permissive defaults 2023-04-20 14:13:36 +02:00
Markus F.X.J. Oberhumer b1729e3bcf src: cleanup MAX_ELF_HDR 2023-04-19 23:23:46 +02:00
Markus F.X.J. Oberhumer d1ab85a1a6 src: cleanup linker.h 2023-04-19 23:19:45 +02:00
John Reiser 7f5b64c91a Merge branch 'devel4' of https://github.com/upx/upx into devel4 2023-04-19 14:00:43 -07:00
John Reiser 78b68283c4 Fix .e_entry for PowerPC64
https://github.com/upx/upx/issues/668
	modified:   p_lx_elf.cpp
2023-04-19 13:58:52 -07:00
Markus F.X.J. Oberhumer 9e3b1c9f8a src: enable TE checks in packer.h; add some "noexcept" 2023-04-18 17:56:28 +02:00
Markus F.X.J. Oberhumer 5dc54c7adc Merge branch 'devel' into devel4 2023-04-18 17:15:57 +02:00
Markus F.X.J. Oberhumer 320e5b850f all: yet more cleanups
Changes include:
  - use standard names for PE constants
  - add some more "noexcept"
  - improve upx_is_integral type-trait
  - introduce is_same_all and is_same_any type-traits
  - prepare TE-size checks in packer.h
  - CI updates
2023-04-18 17:02:13 +02:00
John Reiser d8395d8c42 Fix usage of _te32/_te64/_te16 for Elf classes
How did it ever work?  UPX_RSIZE_MAX_MEM of 768MiB, Elf32_Off of only
32-bits, and preponderance of little-endian and small positive integers
hides many mis-uses of _te64/_te32.
ELF does not help: e_phnum, e_shnum, Elf32_Section, Elf64_Section are all
16-bit, but sh_info and sh_link are 32-bit.
Templatizing p_elf.h (following the example of p_mach.h) failed
because of complexity.  (Plus too many special cases of ELF where 32-bit
and 64-bit are not parallel.)
	modified:   p_lx_elf.cpp
	modified:   p_lx_sh.cpp
	modified:   p_mach.cpp
2023-04-17 13:19:06 -07:00
John Reiser a20c5a1e7f Align 64-bit forward_Shdr
//github.com/upx/upx/issues/220
	modified:   p_lx_elf.cpp
2023-04-12 14:54:49 -07:00
John Reiser 3bdfcaa541 Try to placate Android crapware, which cannot deal with null strings
From https://github.com/upx/upx/issues/220 :

Phone:
04-10 16:07:52.862 E/AndroidRuntime( 5178): java.lang.UnsatisfiedLinkError: dlopen failed: \
"/data/app/~~Nwb-iR6LHpHyrT37xe8HNg==/com.android.support-y0YbcwLn1b4sBRD09JGVAw==/lib/arm64/libMyLibName.so" \
has unsupported e_shentsize: 0x0 (expected 0x40)

Emulator:
04-10 09:57:38.746 E/AndroidRuntime( 6403): java.lang.UnsatisfiedLinkError: dlopen failed: \
"/data/app/~~sBBMDvh36TxwO4muxOJ3Bg==/com.android.support-8Lc6r2dLzTIW7SEHXLI0XQ==/lib/arm64/libMyLibName.so" \
has no section headers

	modified:   p_lx_elf.cpp
2023-04-11 13:41:54 -07:00
John Reiser 7b2faf2016 Elf64_Rela for shlib DT_INIT_ARRAY
Also allow PT_PHDR in shlibs.
Also page align lo end of mmap, like mprotect.
        https://github.com/upx/upx/issues/664
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c

	modified:   stub/src/amd64-linux.elf-so_fold.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-so_fold.S

	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-so_fold.h

	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map

	modified:   stub/src/arch/mips/r3000/macros.ash
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2023-04-11 11:00:48 -07:00
John Reiser 42902dabac 64-bit shlib with DT_INIT_ARRAY but no DT_INIT
https://github.com/upx/upx/issues/664
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2023-04-10 18:01:39 -07:00
John Reiser 14521eb6dd Allow pre-linking when compressing shared libraries
Such as Wine kernel32.dll etc.
https://github.com/upx/upx/issues/660
	modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-04-03 13:18:21 -07:00
John Reiser b9533f409c Sync testsuite checksums
modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2023-03-29 16:11:08 -07:00
John Reiser 4df68aafd2 Pprotect: mprotect but enlarge the interval to start on page boundary
https://github.com/upx/upx/issues/609
	modified:   src/stub/src/amd64-linux.elf-fold.S
	modified:   src/stub/src/amd64-linux.elf-main.c
	modified:   src/stub/src/amd64-linux.elf-so_fold.S
	modified:   src/stub/src/amd64-linux.elf-so_main.c
	modified:   src/stub/src/arm.v4a-linux.elf-fold.S
	modified:   src/stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   src/stub/src/arm64-linux.elf-fold.S
	modified:   src/stub/src/arm64-linux.elf-so_fold.S
	modified:   src/stub/src/i386-linux.elf-fold.S
	modified:   src/stub/src/i386-linux.elf-main.c
	modified:   src/stub/src/i386-linux.elf-so_fold.S
	modified:   src/stub/src/i386-linux.elf-so_main.c
	modified:   src/stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   src/stub/src/powerpc-linux.elf-fold.S
	modified:   src/stub/src/powerpc64le-linux.elf-fold.S

	modified:   src/stub/amd64-linux.elf-fold.h
	modified:   src/stub/amd64-linux.elf-so_fold.h
	modified:   src/stub/arm.v4a-linux.elf-fold.h
	modified:   src/stub/arm.v4a-linux.elf-so_fold.h
	modified:   src/stub/arm.v5a-linux.elf-fold.h
	modified:   src/stub/arm.v5a-linux.elf-so_fold.h
	modified:   src/stub/arm64-linux.elf-fold.h
	modified:   src/stub/arm64-linux.elf-so_fold.h
	modified:   src/stub/armeb.v4a-linux.elf-fold.h
	modified:   src/stub/i386-linux.elf-fold.h
	modified:   src/stub/i386-linux.elf-so_fold.h
	modified:   src/stub/mips.r3000-linux.elf-fold.h
	modified:   src/stub/mipsel.r3000-linux.elf-fold.h
	modified:   src/stub/powerpc-linux.elf-fold.h
	modified:   src/stub/powerpc64-linux.elf-fold.h
	modified:   src/stub/powerpc64le-linux.elf-fold.h

	modified:   src/stub/tmp/amd64-linux.elf-fold.map
	modified:   src/stub/tmp/amd64-linux.elf-so_fold.bin.dump
	modified:   src/stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   src/stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   src/stub/tmp/arm64-linux.elf-fold.map
	modified:   src/stub/tmp/armeb.v4a-linux.elf-fold.map
	modified:   src/stub/tmp/i386-linux.elf-fold.map
	modified:   src/stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   src/stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64le-linux.elf-fold.map
2023-03-29 15:46:58 -07:00
John Reiser c72ceaa979 MSVC
modified:   p_lx_elf.cpp
2023-03-26 11:29:19 -07:00
John Reiser 8ac79ca0ad whitespce
modified:   p_lx_elf.cpp
2023-03-26 11:16:36 -07:00
John Reiser e0bfaf1028 Merge branch 'devel4' of https://github.com/upx/upx into devel4 2023-03-26 11:06:22 -07:00
John Reiser b361b91ec7 Try to appease Android runtime loader; _Shdr vs _Phdr offsets
JNI FalalError called: Unable to load library:
    [dlopen failed: "/lib/arm/libunity.so"
    .dynamic section has invalid offset: 0x6d3e58,
    expected to match PT_DYNAMIC offset: 0x441e58]
https://github.com/upx/upx/issues/609
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2023-03-26 10:53:30 -07:00
John Reiser b5d1eba4c1 mprotect() requires page-aligned address
modified:   stub/amd64-linux.elf-so_fold.h
	modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/arm64-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/src/amd64-linux.elf-so_fold.S
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
	modified:   stub/src/i386-linux.elf-so_fold.S
	modified:   stub/tmp/amd64-linux.elf-so_fold.bin.dump
2023-03-26 07:26:53 -07:00
John Reiser ba447344d6 New strategy for de-compression stub for shared libraries
modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf-so_main.c
2023-03-26 07:25:32 -07:00
John Reiser 7b68aa7bdc Fix de-comression of shared libraries
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2023-03-26 07:23:08 -07:00
John Reiser 5d15e57294 De-compression for 32-bit shared libraries on i686, ARM
https://github.com/upx/upx/issues/609
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2023-03-23 16:29:25 -07:00
John Reiser 0bf8ff151e Un-debug stubs for 32-bit shared libraries
modified:   stub/arm.v4a-linux.elf-so_fold.h
	modified:   stub/arm.v5a-linux.elf-so_fold.h
	modified:   stub/i386-linux.elf-so_fold.h
	modified:   stub/src/arm.v4a-linux.elf-so_entry.S
2023-03-23 16:27:44 -07:00
John Reiser 06fae05910 32-bit ARM Android shlib: DT_INIT_ARRAY without DT_INIT
De-compressor needs to catch up.
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/i386-linux.elf-so_main.c
2023-03-22 10:44:17 -07:00
Markus F.X.J. Oberhumer f68ac8155b Merge branch 'devel' into devel4 2023-03-18 21:52:17 +01:00
Markus F.X.J. Oberhumer 15484aa296 all: more cleanups
Changes include:
  - extract headers.h from conf.h
  - use "byte" in some more places
  - unify "const" coding style
  - pefile.cpp: make sort order deterministic
  - simplify some other pefile.cpp code
  - CI updates
2023-03-18 21:27:34 +01:00
John Reiser 5b113a5041 Merge branch 'devel4' of https://github.com/upx/upx into devel4 2023-03-16 08:51:29 -07:00
John Reiser 1320e3efdb PackLinuxElf32::canPackOSABI() isolates canPack() from OSABI weirdness
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2023-03-16 08:30:06 -07:00
Markus F.X.J. Oberhumer d32f447bda Merge branch 'devel' into devel4 2023-03-15 22:34:05 +01:00
John Reiser b74c4e4ac1 Picky, picky static analyzer
https://github.com/upx/upx/actions/runs/4422867763/jobs/7755057541
	modified:   p_lx_elf.cpp
2023-03-15 09:05:02 -07:00
John Reiser 35333403ef Zero ElfXX_Ehdr.e_sh* info when removing ElfXX_Shdr
The aim is less confusion by static linkers: the _Shdr are gone!
https://github.com/upx/upx/issues/659
	modified:   p_lx_elf.cpp
2023-03-15 08:44:59 -07:00
Markus F.X.J. Oberhumer a627648249 all: assorted cleanups and updates
Changes include:
  - add a bunch of "noexcept", mostly to operators and forceinline
  - use "uchar"
  - use "charptr"
  - rename options_t to Options
  - add ptr_check_no_overlap()
  - rewrite p_exe.cpp, NFCI
  - clang-format help.cpp
  - spelling fixes
2023-03-15 00:19:55 +01:00
Markus F.X.J. Oberhumer 127fd095e7 CI: add spell-check.yml 2023-03-11 03:11:19 +01:00
John Reiser f8934c09ff F*ck MSVC
warning C4245: 'return': conversion from 'int' to 'unsigned int', signed/unsigned mismatch
    return ~0;  // in function declared as returning 'unsigned'.  The bits are the same!
	modified:   p_lx_elf.cpp
2023-03-09 12:00:56 -08:00
John Reiser 7a09c88e30 CI convention sucks
renamed:    MAX_ELF_HDR.cpp -> MAX_ELF_HDR.h
	modified:   p_lx_elf.cpp
2023-03-09 11:44:22 -08:00
John Reiser 17526d1132 Make it easier to change MAX_ELF_HDR consistently
https://github.com/upx/upx/issues/655

	new file:   MAX_ELF_HDR.cpp
	new file:   stub/src/MAX_ELF_HDR.S
	new file:   stub/src/MAX_ELF_HDR.c

	modified:   p_lx_elf.cpp
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-so_fold.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-so_fold.S
	modified:   stub/src/i386-bsd.elf-fold.S
	modified:   stub/src/i386-bsd.elf-main.c
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-so_main.c
	modified:   stub/src/i386-linux.elf.interp-fold.S
	modified:   stub/src/i386-linux.elf.interp-main.c
	modified:   stub/src/i386-linux.elf.shell-fold.S
	modified:   stub/src/i386-linux.elf.shell-main.c
	modified:   stub/src/i386-openbsd.elf-fold.S
	modified:   stub/src/i386-openbsd.elf-main.c
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2023-03-09 10:06:13 -08:00
John Reiser ff7939c1c0 invert_pt_dynamic, sort_DTxx_offsets, elf_find_table_size
https://github.com/upx/upx/issues/655
        modified:   p_lx_elf.cpp
        modified:   p_lx_elf.h
2023-03-09 09:24:35 -08:00
John Reiser 96c196b1be Final ph.u_len and ph.c_len reflect multiple compressed extents
https://github.com/upx/upx/issues/655
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   p_lx_elf.cpp
2023-03-09 09:06:06 -08:00
John Reiser adb0ca8250 Many changes for ELF shared libraries on Linux and Android
Handling more than 2 PT_LOAD (and thus more than 1 executable PT_LOAD)
required extensive changes.  But the bonus is the infrastructure
to support a different (de-)compression algorithm for each PT_LOAD.

https://github.com/upx/upx/issues/341   i386 .so decompression
https://github.com/upx/upx/issues/609   armv7 .so on Android
https://github.com/upx/upx/issues/625   amd64 .so execution
https://github.com/upx/upx/issues/654   armv7 .exe
Not yet: .so on MIPS, PowerPC, PowerPC64
2023-03-04 17:37:25 -08:00
Markus F.X.J. Oberhumer fa56a1d9cd submodules: update for new versions 2023-02-24 10:59:32 +01:00
Markus F.X.J. Oberhumer 3d691645a4 src: pefile: add checkMachine() 2023-02-21 20:33:40 +01:00
Markus F.X.J. Oberhumer e1edc5f50a src: use 'byte' instead of 'upx_byte'; NFCI 2023-02-21 19:27:23 +01:00
Markus F.X.J. Oberhumer 4a8efd2e2f src: rework optimizeReloc handling; cleanups 2023-02-21 15:19:24 +01:00
Markus F.X.J. Oberhumer 8d364c82e2 CI: add build for windows arm64ec 2023-02-12 19:27:56 +01:00
Markus F.X.J. Oberhumer c5059231dc all: rename win32/arm back to wince/arm 2023-02-12 18:58:11 +01:00
Markus F.X.J. Oberhumer f584c91386 all: canonicalize win32 and win64 file names 2023-02-10 09:49:29 +01:00
Markus F.X.J. Oberhumer b8d9c2b755 all: assorted updates and cleanups 2023-02-05 17:20:32 +01:00
Markus F.X.J. Oberhumer 163377d1a0 testsuite: update checksums caused by version bump 2023-01-30 13:44:18 +01:00
Markus F.X.J. Oberhumer 8944e90175 all: post-release version bump 2023-01-30 13:39:49 +01:00
Markus F.X.J. Oberhumer 33cdcb0e82 all: prepare for release 2023-01-30 11:18:06 +01:00
Markus F.X.J. Oberhumer ec870a5aeb submodules: update for new versions 2023-01-30 11:10:36 +01:00
Markus F.X.J. Oberhumer 0653bb5a72 src: some xspan cleanups 2023-01-30 11:03:11 +01:00
Markus F.X.J. Oberhumer 43b6ff29e3 all: bump tentative release date 2023-01-29 15:39:35 +01:00
Markus F.X.J. Oberhumer a444a8a704 src: pefile: fix overly tricky canUnpack0 logic 2023-01-29 12:40:00 +01:00
Markus F.X.J. Oberhumer 3fa18c1799 src: clang-format pefile 2023-01-29 12:34:05 +01:00
Markus F.X.J. Oberhumer 19147963b9 src: pefile: try to work-around a scan-build warning 2023-01-29 12:21:15 +01:00
Markus F.X.J. Oberhumer 5056215a1f all: more assorted cleanups 2023-01-29 11:39:57 +01:00
Markus F.X.J. Oberhumer 340b7614e2 submodules: update for new versions 2023-01-26 18:49:14 +01:00
Markus F.X.J. Oberhumer 8a1bd67a20 src: more valgrind integration 2023-01-26 08:50:30 +01:00
Markus F.X.J. Oberhumer a094df7b55 all: more cleanups; NFCI 2023-01-24 21:52:10 +01:00
Markus F.X.J. Oberhumer cc893dfc11 CI: add zigcc and scan-build 2023-01-22 22:07:35 +01:00
Markus F.X.J. Oberhumer 8ef17da082 all: cleanups 2023-01-22 18:44:31 +01:00
Markus F.X.J. Oberhumer 7993e619cd src: even more outstanding util/xspan renaming; NFC 2023-01-21 19:15:38 +01:00
Markus F.X.J. Oberhumer 1ab8d5fb3f src: remove currently unused submodules 2023-01-21 18:57:23 +01:00
Markus F.X.J. Oberhumer 213ac3ac73 all: better support for clang Static Analyzer (scan-build) 2023-01-19 19:17:26 +01:00
Markus F.X.J. Oberhumer 0a8876443a submodules: update for new versions 2023-01-19 19:16:11 +01:00
Markus F.X.J. Oberhumer f37a3bb9bb src: new ACC version 2023-01-19 06:26:06 +01:00
Markus F.X.J. Oberhumer 2632342f44 all: remove currently unused submodules 2023-01-19 03:32:49 +01:00
Markus F.X.J. Oberhumer 8efcf6f099 src: move console files into a subdir; NFC 2023-01-18 14:19:15 +01:00
Markus F.X.J. Oberhumer 58343fc78d src: more outstanding util/xspan renaming; NFC 2023-01-18 10:11:29 +01:00
Markus F.X.J. Oberhumer 6c41a4c9c8 src: move compress files into a subdir; clang-format some more files; NFC 2023-01-18 09:28:12 +01:00
Markus F.X.J. Oberhumer 334be287fc CI: add minimal-ci 2023-01-17 23:43:24 +01:00
Markus F.X.J. Oberhumer aa050e0001 cmake: compile compression libs with -O2 even in Debug mode 2023-01-16 09:47:39 +01:00
Markus F.X.J. Oberhumer cc994326a0 all: cleanups 2023-01-15 13:49:27 +01:00
Markus F.X.J. Oberhumer 58de07629e submodules: add vendor/rangeless 2023-01-15 03:23:22 +01:00
Markus F.X.J. Oberhumer 9f830e0c41 all: add zstd compression library 2023-01-13 22:25:15 +01:00
Markus F.X.J. Oberhumer c52d302f07 submodules: add vendor/zstd 2023-01-13 22:25:15 +01:00
Markus F.X.J. Oberhumer 44049ecf30 all: enable WITH_VALGRIND by default 2023-01-13 22:25:15 +01:00
Markus F.X.J. Oberhumer e1b5904196 submodules: add vendor/valgrind 2023-01-13 22:25:15 +01:00
Markus F.X.J. Oberhumer 88e692791a submodules: update for new version 2023-01-13 13:02:38 +01:00
Markus F.X.J. Oberhumer f00667ad7d all: minor cleanups, update some comments 2023-01-13 05:37:28 +01:00
Markus F.X.J. Oberhumer 696d0eec64 misc: update podman images 2023-01-06 01:48:32 +01:00
Markus F.X.J. Oberhumer 513b00a30e cmake: update for MSVC_IDE 2023-01-05 14:26:17 +01:00
Markus F.X.J. Oberhumer 0cb0dbf6d8 src: cleanup conf.h 2023-01-05 14:26:12 +01:00
Markus F.X.J. Oberhumer 9f00515da4 CI: fix windows build 2023-01-05 02:29:12 +01:00
Markus F.X.J. Oberhumer 72f31787f6 submodules: update for new versions 2023-01-05 02:02:31 +01:00
Markus F.X.J. Oberhumer cd686cb1d9 src: add boost-pfr 2023-01-05 00:57:05 +01:00
Markus F.X.J. Oberhumer d9657e9831 cmake and make: minor updates 2023-01-05 00:57:01 +01:00
Markus F.X.J. Oberhumer 72f3e9b25a all: require C++17 2023-01-03 15:11:11 +01:00
John Reiser 811b15a5b3 Fix crash with TLS init in i386 dll
https://github.com/upx/upx/issues/643
	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/i386-win32.pe.h
	modified:   src/stub/src/i386-win32.pe.S
	modified:   src/stub/tmp/i386-win32.pe.bin.dump
2023-01-12 18:35:04 -08:00
John Reiser ab00825f37 i386 shared library TLS init
https://github.com/upx/upx/issues/643
	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
	modified:   src/p_w32pe.cpp
	modified:   src/stub/i386-win32.pe.h
	modified:   src/stub/src/i386-win32.pe.S
	modified:   src/stub/tmp/i386-win32.pe.bin.dump
2023-01-12 14:34:06 -08:00
John Reiser e86d9179aa Sync testsuite
modified:   .github/travis_testsuite_1-expected_sha256sums.sh
	modified:   src/p_lx_elf.cpp
2023-01-09 10:51:47 -08:00
John Reiser 26d8e9c4c5 amd64-linux revamp for compressing shared libraries
Major changes: p_lx_elf.cpp and stub/src/amd64-linux.elf-so*.
(Includes run-time infrastructure for multiple de-compressors.)
	modified:   linker.cpp
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
	modified:   p_unix.h
	modified:   stub/Makefile
	modified:   stub/src/amd64-darwin.dylib-entry.S
	modified:   stub/src/amd64-darwin.macho-entry.S
	new file:   stub/src/amd64-expand.S
	modified:   stub/src/amd64-linux.elf-entry.S
	new file:   stub/src/amd64-linux.elf-so_entry.S
	new file:   stub/src/amd64-linux.elf-so_fold.S
	new file:   stub/src/amd64-linux.elf-so_fold.lds
	new file:   stub/src/amd64-linux.elf-so_main.c
	modified:   stub/src/amd64-linux.shlib-init.S
	modified:   stub/src/amd64-win64.pep.S
	modified:   stub/src/arch/amd64/nrv2b_d.S
	modified:   stub/src/arch/amd64/nrv2d_d.S
	modified:   stub/src/arch/amd64/nrv2e_d.S
           plus many generated stub/*.h and stub/tmp/*.bin.dump
2023-01-09 09:39:25 -08:00
John Reiser 5f3ebc8a7f clang-format
modified:   linker.cpp
2023-01-09 09:33:34 -08:00
John Reiser 425b1b44bc Initialize output_capacity for loader
modified:   pefile.cpp
2023-01-09 09:20:43 -08:00
John Reiser 39442e6282 initLoader() 4th parameter allows larger output size
modified:   packer.cpp
	modified:   packer.h
2023-01-05 15:28:12 -08:00
John Reiser 99575e1010 ElfLinker::output_capacity
modified:   linker.cpp
	modified:   linker.h
2023-01-05 15:25:34 -08:00
John Reiser 64aa7540e2 Sync copyright year 2023
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
	modified:   p_unix.h
2023-01-02 08:28:41 -08:00
Markus F.X.J. Oberhumer 3ff5dbd179 testsuite: update testsuite caused by version year change 2023-01-01 19:56:14 +01:00
Markus F.X.J. Oberhumer e25d04fb12 all: bump version date 2023-01-01 19:53:28 +01:00
Markus F.X.J. Oberhumer dd1d5a92d2 all: welcome 2023 2023-01-01 19:49:30 +01:00
Markus F.X.J. Oberhumer c6e0aad40b make: move extra builds to "build/extra/" subdirectories 2023-01-01 19:43:57 +01:00
Markus F.X.J. Oberhumer 99b795ceaa cmake: update for MinGW 2023-01-01 13:54:39 +01:00
Markus F.X.J. Oberhumer 33dc60df26 all: minor cleanups 2022-12-31 21:08:58 +01:00
John Reiser 619aeb54ff Pesky "upx -t" mode
https://github.com/upx/upx/issues/599
	modified:   p_lx_elf.cpp
2022-12-30 10:29:25 -08:00
John Reiser 77ba43328b Use my_page_size, which is 0x4000 (16KiB) on arm64
https://github.com/upx/upx/issues/628
	modified:   p_mach.cpp
2022-12-31 20:55:34 +01:00
John Reiser 01a30752c7 Mach-O: allow 256 ncmds and 32768 sizeofcmds
https://github.com/upx/upx/issues/642
	modified:   p_mach.cpp
	modified:   stub/src/i386-darwin.macho-upxmain.c
	modified:   stub/src/powerpc-darwin.macho-upxmain.c
2022-12-29 14:02:42 -08:00
John Reiser e56b748435 WIP fixing "upx -t" of shared library
modified:   p_lx_elf.cpp
2022-12-23 11:23:41 -08:00
Markus F.X.J. Oberhumer bb4cbdff44 src: fix m68k-atari build, prepare for std::atomic, port John's MemBuffer debug 2022-12-22 16:06:25 +01:00
Markus F.X.J. Oberhumer 0b47e474a7 make: update src/Makefile 2022-12-22 15:52:50 +01:00
Markus F.X.J. Oberhumer 8e85680eb4 all: minor updates 2022-12-21 22:09:05 +01:00
John Reiser fefce0d5c4 Cleanup "PT_LOAD gap recovery" during upx -d
https://github.com/upx/upx/issues/635
	modified:   p_lx_elf.cpp
2022-12-21 06:53:37 -08:00
Markus F.X.J. Oberhumer 0ac3cb2329 CI: update CI 2022-12-21 10:08:21 +01:00
Markus F.X.J. Oberhumer 708ab1dcd7 src: p_xxx_enum.h: trailing commas in enums are allowed since C++11 2022-12-20 23:34:36 +01:00
Markus F.X.J. Oberhumer 9b87ddb621 CI: run test-suite; remove obsolete scripts 2022-12-20 23:33:58 +01:00
Markus F.X.J. Oberhumer 5dc4eb4b03 CI: also test linux gcc-m32 builds 2022-12-20 12:10:39 +01:00
Markus F.X.J. Oberhumer a203c72281 make: update Makefile 2022-12-20 11:40:48 +01:00
Markus F.X.J. Oberhumer 6cf85cee6e src: minor compatibility fix 2022-12-20 11:40:22 +01:00
Markus F.X.J. Oberhumer 1eb6a40fdd src: restore lseek() error check in file.cpp 2022-12-20 11:51:31 +01:00
John Reiser 1bed77e4d3 'sizeof' returns size_t, which on i386 is not as wide as off_t
https://github.com/upx/upx/issues/629
https://github.com/upx/upx/issues/635
	modified:   p_lx_elf.cpp
2022-12-20 07:21:02 -08:00
John Reiser f2a68023fa MSVC error C4146: unary minus operator applied to unsigned type, result still unsigned
modified:   p_lx_elf.cpp
2022-12-19 16:14:48 -08:00
John Reiser 8ccffc40e3 A real typo that caused an error in "upx -d" de-compressing
modified:   p_lx_elf.cpp
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2022-12-19 15:45:27 -08:00
John Reiser dd8c1d0441 clang alignment
modified:   p_lx_elf.cpp
2022-12-19 14:31:26 -08:00
John Reiser f9f28ff176 More work on "upx -d" de-compression
https://github.com/upx/upx/issues/629
https://github.com/upx/upx/issues/635
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2022-12-19 13:49:43 -08:00
John Reiser 3649041195 Return value of FileBase::seek(, SEEK_CUR) was not FileBase::tell()
modified:   file.cpp
2022-12-19 13:37:24 -08:00
Markus F.X.J. Oberhumer c23c7a9379 all: minor updates 2022-12-15 16:20:22 +01:00
Markus F.X.J. Oberhumer 9934e33b99 src: pacify a clang scan-build warning in p_mach.cpp 2022-12-12 21:27:34 +01:00
Markus F.X.J. Oberhumer 9e75fdda66 src: pacify a -Wcast-align warning 2022-12-12 20:07:27 +01:00
Markus F.X.J. Oberhumer d873a26f41 all: clang-format-15.0.6 2022-12-12 19:25:31 +01:00
Markus F.X.J. Oberhumer 91aa5b55ab all: upgrade to upx-stubtools v20221212 2022-12-12 19:25:28 +01:00
Markus F.X.J. Oberhumer 3f460a76ce src: fix typo in options.cpp 2022-12-12 05:38:51 +01:00
Markus F.X.J. Oberhumer 7256ea3b32 make: update Makefile 2022-12-12 05:32:04 +01:00
John Reiser 4cdf77e16f Stupid MSVC 14.2, 14.3; obtuse clang 14.0.5 (and MemBuffer vs alignment)
MSVC: cannot say "if (0)" to get "check symtax+semantics, but do not emit code"
clang+MemBuffer: must fight too much to get pointer to wider-than-char
	modified:   src/p_lx_elf.cpp
2022-12-11 14:41:38 -08:00
John Reiser d89813e911 Implement de-compress of --android-shlib
64-bit (arm64, aarch64) only for now.  NYI: 32-bit (armv7).
(Also: implied catch-up with all changes by Markus in the meantime.)
https://github.com/upx/upx/issues/599

	modified:   src/p_lx_elf.cpp
	modified:   src/p_lx_elf.h
2022-12-11 13:46:44 -08:00
Markus F.X.J. Oberhumer 7c57b10cae all: minor cleanups 2022-12-02 16:46:16 +01:00
Markus F.X.J. Oberhumer 8d1a98e03b misc: update podman images, add build-all script 2022-11-27 23:50:22 +01:00
Markus F.X.J. Oberhumer 65a2da4b40 src: more clang-format 2022-11-27 22:03:20 +01:00
Markus F.X.J. Oberhumer 02f6786b2a src: new ACC version 2022-11-27 21:56:30 +01:00
Markus F.X.J. Oberhumer 9da4f7a6dc src: clang-format more files; cleanups; NFCI 2022-11-27 12:34:15 +01:00
John Reiser 510505a85c p_tmt: more sanity of input, cleanup MemBuffer usage
https://github.com/upx/upx/issues/632
	modified:   src/p_tmt.cpp
2022-11-24 10:28:03 -08:00
Markus F.X.J. Oberhumer 741cb3a136 misc: update podman images 2022-11-26 19:12:26 +01:00
Markus F.X.J. Oberhumer 9f5d67e27c src: clang-format various packers 2022-11-26 17:45:25 +01:00
Markus F.X.J. Oberhumer 93c6496ba8 src: add a xspan check to p_tmt.cpp and clang-format 2022-11-24 09:11:25 +01:00
John Reiser 779b648c5f invert_pt_dynamic: fix thinko; PackLinuxElf64help1 insist on ELF
https://github.com/upx/upx/issues/631
	modified:   src/p_lx_elf.cpp
2022-11-23 19:49:28 -08:00
Markus F.X.J. Oberhumer 9d5e06232d testsuite: update checksums caused by version bump 2022-11-22 21:36:32 +01:00
Markus F.X.J. Oberhumer b221c44466 src: re-add non-working PackMachPPC32 to PackMaster 2022-11-22 21:24:33 +01:00
Markus F.X.J. Oberhumer 665296f7cf src/util: minor xspan improvements 2022-11-22 21:21:26 +01:00
Markus F.X.J. Oberhumer 39778d5f47 cmake: default to relaxed options when building from source tarball 2022-11-22 20:54:12 +01:00
Markus F.X.J. Oberhumer 0af9bbb623 all: post-release version bump 2022-11-22 20:51:56 +01:00
Markus F.X.J. Oberhumer fdec47a83d all: prepare for release 2022-11-16 23:15:38 +01:00
Markus F.X.J. Oberhumer 7ff913bbd2 src: remove non-working PackMachPPC32 from PackMaster 2022-11-16 22:24:39 +01:00
Markus F.X.J. Oberhumer 94775bef9f src: remove non-working PackMachPPC64 from PackMaster; see issue #626 2022-11-16 20:41:31 +01:00
Markus F.X.J. Oberhumer 3cf102334f src: add option '--force-overwrite' 2022-11-16 12:52:53 +01:00
Markus F.X.J. Oberhumer 627e733a30 src: minor compress_lzma.cpp cleanups 2022-11-15 11:59:22 +01:00
Markus F.X.J. Oberhumer d31b80da5b cmake: improve tests 2022-11-14 13:21:07 +01:00
Markus F.X.J. Oberhumer eb231b65f3 src: clang-format compress_*.cpp; minor cleanup 2022-11-14 11:35:13 +01:00
Markus F.X.J. Oberhumer 59e3b1f98d all: cosmetic cleanups in NEWS and doc/Makefile 2022-11-11 05:32:59 +01:00
Markus F.X.J. Oberhumer 8b174bb272 submodules: update for new version 2022-11-10 17:34:02 +01:00
John Reiser 4199a44bef armeb stub: b_method as arg5 is 32-bit unsigned
https://github.com/upx/upx/issues/618
	modified:   src/stub/src/arch/arm/v4a/lzma_d.S

	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
        also src/stub/arm*-linux*.h, src/stub/tmp/*.bin.dump
2022-11-10 08:04:35 -08:00
Markus F.X.J. Oberhumer 777392c0fe src: add some compress doctest checks 2022-11-10 16:26:36 +01:00
Markus F.X.J. Oberhumer ede1fec5e7 submodules: update for new version 2022-11-10 16:25:33 +01:00
Markus F.X.J. Oberhumer 16de3e78a5 src: try to fix canUnpack() confusion - see packer.h 2022-11-10 06:00:53 +01:00
Markus F.X.J. Oberhumer d7508d8c09 src: pefile.cpp: replace "membuffer + x - y" with "membuffer + (x - y)"
This is needed because "membuffer + x" is now bounds-checked, and
the temporary addition would trigger an exception.
2022-11-10 00:40:41 +01:00
John Reiser 2a136c1c1d End users wish to avoid "double packing".
https://github.com/upx/upx/issues/622
	modified:   src/p_lx_elf.cpp
2022-11-09 15:39:16 -08:00
Markus F.X.J. Oberhumer 2578102be9 src: misc cleanups 2022-11-09 22:15:11 +01:00
Markus F.X.J. Oberhumer dadee7acfb doc: update NEWS to mention a user visible change 2022-11-09 21:47:28 +01:00
Markus F.X.J. Oberhumer 28f0bb4e11 src: fix pefile.cpp otls allocation not accounting for alignment. Closes #621. 2022-11-09 19:29:16 +01:00
Markus F.X.J. Oberhumer 824c8a8efb src: introduce raw_index_bytes() 2022-11-08 23:05:34 +01:00
John Reiser 37f27a1262 "gcc -Werror=format-security" is small-minded
... and does not perform constant propagation
	modified:   src/p_vmlinx.cpp
2022-11-08 13:36:28 -08:00
Markus F.X.J. Oberhumer 2b8a7a492a src/util: fix compilation when not using xspan 2022-11-08 20:38:52 +01:00
Markus F.X.J. Oberhumer db56bbb11b src/util: forward memset() in xspan_fwd.h 2022-11-08 20:34:44 +01:00
John Reiser 82d26f04a4 p_vmlinx was too eager
https://github.com/upx/upx/issues/622
	modified:   src/p_vmlinx.cpp
2022-11-08 10:30:48 -08:00
Markus F.X.J. Oberhumer 5045f7eb42 submodules: update for new versions 2022-11-08 17:33:56 +01:00
Markus F.X.J. Oberhumer 82a6ccac4d misc: add misc/cross-compile-upx-with-podman 2022-11-08 03:54:30 +01:00
Markus F.X.J. Oberhumer 2d74298001 make: update Makefiles 2022-11-08 03:52:43 +01:00
Markus F.X.J. Oberhumer ce21254ed2 all: misc cleanups 2022-11-06 08:35:00 +01:00
Markus F.X.J. Oberhumer 874250fe49 submodules: update for new versions 2022-11-06 08:34:06 +01:00
John Reiser c8a3acbba8 Static executable with 4 PT_LOAD has only ELF headers in first PT_LOAD
https://github.com/upx/upx/issues/615
2022-11-02 10:03:25 -07:00
Markus F.X.J. Oberhumer 81e11987a2 all: add UPX_VERSION_GIT_DESCRIBE 2022-11-02 10:35:40 +01:00
Markus F.X.J. Oberhumer 668cefec2f src: mention UPX_CONFIG_DISABLE_GITREV build config 2022-11-02 02:52:20 +01:00
Markus F.X.J. Oberhumer 212bc04257 cmake: run tests sequentially 2022-11-02 02:50:02 +01:00
Markus F.X.J. Oberhumer db401fd05e cmake: improve "make test" 2022-10-31 18:53:38 +01:00
Markus F.X.J. Oberhumer bebe72481c testsuite: update checksums 2022-10-29 19:16:57 +02:00
John Reiser 2b9e83256d SELinux execmod requires no PROT_EXEC when PROT_WRITE
modified:   src/stub/src/amd64-linux.elf-main.c

	modified:   src/stub/amd64-linux.elf-fold.h
	modified:   src/stub/arm64-linux.elf-fold.h
	modified:   src/stub/powerpc64-linux.elf-fold.h
	modified:   src/stub/powerpc64le-linux.elf-fold.h
	modified:   src/stub/tmp/amd64-linux.elf-fold.map
	modified:   src/stub/tmp/arm64-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64-linux.elf-fold.map
	modified:   src/stub/tmp/powerpc64le-linux.elf-fold.map
2022-10-28 13:04:17 -07:00
Markus F.X.J. Oberhumer 5763518cce misc: add misc/rebuild-stubs-with-podman to add upx-4.0.0 2022-10-28 20:03:30 +02:00
Markus F.X.J. Oberhumer 3e4c5bab72 testsuite: update checksums caused by version bump 2022-10-28 17:30:56 +02:00
Markus F.X.J. Oberhumer bce109ab54 all: post-release version bump 2022-10-28 17:10:52 +02:00
Markus F.X.J. Oberhumer 69ca635c4c all: prepare for 4.0.0 release 2022-10-28 10:38:03 +02:00
Markus F.X.J. Oberhumer e0bf460993 src: rename membuffer "Uncompression" to "Decompression" 2022-10-28 10:34:31 +02:00
Markus F.X.J. Oberhumer 29762a8a96 CI: small update 2022-10-28 07:51:00 +02:00
Markus F.X.J. Oberhumer c7ef08dc2d testsuite: update 2022-10-27 22:35:45 +02:00
John Reiser 50a6698715 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
2022-10-27 11:01:37 -07:00
Markus F.X.J. Oberhumer 7dd2cdea1e src: deprecate util/bptr.h 2022-10-27 17:52:15 +02:00
Markus F.X.J. Oberhumer af87f7f2bf doc: add missing NEWS entries 2022-10-27 18:10:29 +02:00
Markus F.X.J. Oberhumer 295889023f all: set next version back to 4.0.0, bump tentative release date, update
docs
2022-10-27 17:36:02 +02:00
Markus F.X.J. Oberhumer feef2e38cf all: final tweaks for release 2022-10-27 16:53:16 +02:00
Markus F.X.J. Oberhumer 80d30aab32 testsuite: update checksums caused by version change 2022-10-27 16:03:08 +02:00
Markus F.X.J. Oberhumer e910a9dc3e all: change version back to 3.99; docs: warn about know regressions and
clarify GPLv2+ COPYING
2022-10-27 16:00:25 +02:00
Markus F.X.J. Oberhumer 504224696c misc: update misc/rebuild-stubs-with-podman to install previous UPX versions 2022-10-27 15:35:59 +02:00
Markus F.X.J. Oberhumer e2acd666df CI: remove some obsolete stuff 2022-10-25 02:53:49 +02:00
Markus F.X.J. Oberhumer e5c0d998b7 src: fully deprecate src/Makefile; minor doc and CI cleanups 2022-10-25 01:48:45 +02:00
Markus F.X.J. Oberhumer 63f6fef964 all: don't use egrep or fgrep 2022-10-25 01:47:42 +02:00
Markus F.X.J. Oberhumer 983eb6d676 src: improve error message when using doctest options like '--dt-help'; add
doctest info to help.cpp
2022-10-25 01:47:38 +02:00
Markus F.X.J. Oberhumer 98fedef1a1 testsuite: update checksums 2022-10-24 12:56:49 +02:00
Markus F.X.J. Oberhumer 75a769759d src/stub: sync stubs 2022-10-24 12:56:49 +02:00
John Reiser 2354b01bad Adapt to libbfd: "no Shdrs" requires 0==.e_shentsize and 0==.e_shnum
modified:   p_lx_elf.cpp
2022-10-24 12:56:49 +02:00
John Reiser c331b9f1e2 Zero the tail of last RW page, even when variable page size
https://github.com/upx/upx/issues/611
	modified:   stub/src/amd64-linux.elf-main.c
2022-10-24 12:56:49 +02:00
John Reiser afeaeeddec munmap(, Phdr[C_TEXT=1].p_memsz); // not .p_vaddr
modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
2022-10-24 12:56:49 +02:00
John Reiser ab7ef9f511 Document the value of "brk #0" instruction
modified:   stub/src/arm64-linux.elf-entry.S
2022-10-24 12:56:49 +02:00
John Reiser d3ad6d25d8 PackLinuxElf64::asl_pack2_Shdrs() for better fit in logical flow
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2022-10-24 12:56:49 +02:00
John Reiser 2e29f9fa5f pack2() fixes for --android-shlib
WIP for https://github.com/upx/upx/issues/599
	modified:   p_lx_elf.cpp
2022-10-24 12:56:49 +02:00
John Reiser 5d9f71bb13 asl_pack1_Shdrs()
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2022-10-24 12:56:49 +02:00
John Reiser 82ed25bb44 Major fix 64-bit un_shlib_1() and unpack(), but not --android-shlib
Also canUnpack() is really a 'bool' which sets overlay_offset
when 'true'; confusing!
        https://github.com/upx/upx/issues/599 (partial)
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.h
2022-10-24 12:56:49 +02:00
Markus F.X.J. Oberhumer f57393c0e8 all: simplify include path handling; update src/Makefile 2022-10-24 12:56:35 +02:00
Markus F.X.J. Oberhumer b54cced19c src: add some tests for compress_zlib 2022-10-24 12:18:25 +02:00
Markus F.X.J. Oberhumer 60a0544314 all: bump tentative release date 2022-10-23 23:15:00 +02:00
Markus F.X.J. Oberhumer 283c1cf931 src: add --version-short option; support doctest --dt-XXX options; cleanups 2022-10-23 23:09:13 +02:00
Markus F.X.J. Oberhumer fff53efc05 src: add some more xspan tests 2022-10-20 14:06:20 +02:00
Markus F.X.J. Oberhumer 07d368adca all: misc cleanups 2022-10-20 02:09:05 +02:00
Markus F.X.J. Oberhumer 13276d93fa all: bump tentative release date 2022-10-18 21:07:48 +02:00
Markus F.X.J. Oberhumer 79b1b1a586 submodules: update for new version 2022-10-18 20:32:03 +02:00
Markus F.X.J. Oberhumer 2f083f3e56 submodules: update for new version 2022-10-14 11:21:19 +02:00
Markus F.X.J. Oberhumer 73b0b4db9d submodules: update for new version 2022-10-12 17:26:11 +02:00
Markus F.X.J. Oberhumer ca0e614b56 CI: update for new GitHub Actions deprecated set-output commands 2022-10-12 16:29:20 +02:00
John Reiser 72613d06a5 Look for PackHeader in the right place.
https://github.com/upx/upx/issues/606
	modified:   p_mach.cpp
2022-10-11 08:08:55 -07:00
John Reiser 48ad5513ff un_shlib_1() allows test mode ("-t") which has (nullptr == fo)
modified:   p_lx_elf.cpp
2022-10-07 12:52:21 -07:00
John Reiser 201d9f1346 Fix length when stub unmaps compressed input for main program
https://github.com/upx/upx/issues/606
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-fold.map
2022-10-07 09:53:29 +02:00
John Reiser 1e8f1f49d0 is_bad_linker_command() ignores LC_REQ_DYLD
https://github.com/upx/upx/issues/606
	modified:   p_mach.cpp
2022-10-06 10:15:10 -07:00
Markus F.X.J. Oberhumer 65707900bc src: remove more traces of fictional powerpc64le-darwin 2022-10-06 15:53:50 +02:00
Markus F.X.J. Oberhumer 39c5be43aa CI: add Visual Studio 2022 builds; updates 2022-10-06 15:35:51 +02:00
Markus F.X.J. Oberhumer c4437cb293 all: add support for a basic "make test" 2022-10-06 14:10:35 +02:00
Markus F.X.J. Oberhumer e2b86a49db src: fix recently introduced bug in unoptimzeReloc 2022-10-06 14:09:45 +02:00
Markus F.X.J. Oberhumer 8fe83be87f misc: update misc/rebuild-stubs-with-podman so that we can build
the full upx program in a container
2022-10-05 16:07:12 +02:00
Markus F.X.J. Oberhumer 17167d4905 CI: update macos-12 build 2022-10-05 02:05:20 +02:00
John Reiser 05ff7e35a1 Warn for big shell scripts, and send them to --force-execve.
Also propagte error code when execve() fails for compressed shell,
to avoid confusion of `hlt` ==> SIGSEGV.
https://github.com/upx/upx/issues/604
2022-10-05 01:30:32 +02:00
Markus F.X.J. Oberhumer f67cec4752 submodules: update for new version 2022-10-04 15:33:27 +02:00
Markus F.X.J. Oberhumer fd4882abcf CI: run close-stale-issues.yml once per week 2022-10-04 13:28:51 +02:00
Markus F.X.J. Oberhumer 0f42579e68 src: fix djgpp and musl builds 2022-10-02 20:00:30 +02:00
Markus F.X.J. Oberhumer 7398d8f68f src: enable -Wsuggest-override in src/conf.h 2022-09-27 18:17:28 +02:00
John Reiser ec33109b22 clang-10 requires the use of 'override'
Discovered during gitlab auto-build for https://github.com/upx/upx/issues/595
	modified:   Makefile
	modified:   p_armpe.h
	modified:   p_djgpp2.h
	modified:   p_lx_elf.h
	modified:   p_lx_exc.h
	modified:   p_lx_interp.h
	modified:   p_lx_sh.h
	modified:   p_mach.h
	modified:   p_ps1.h
	modified:   p_tmt.h
	modified:   p_unix.h
	modified:   p_vmlinx.h
	modified:   p_vmlinz.h
	modified:   p_w32pe.h
	modified:   p_w64pep.h
	modified:   pefile.h
2022-09-27 18:15:48 +02:00
Markus F.X.J. Oberhumer 2cfa4c1eb7 CI: update testsuite checksums caused by getVersion() bump 2022-09-27 18:15:48 +02:00
John Reiser a13b4d10d9 After upx-3.96, the de-compressing stub for ELF moved
... so unpack() of newly-compressed ELF by upx-3.96 now says
"CantUnpackException: need a newer version of UPX"
        https://github.com/upx/upx/issues/595
	modified:   p_lx_elf.h
	modified:   packer.h
2022-09-27 18:09:20 +02:00
Markus F.X.J. Oberhumer 36e94e58d0 stub: add mising powerpc64-darwin tmp dump files 2022-09-27 18:09:20 +02:00
John Reiser d0a52bd483 More cleanup of stubs for powerpc64le-darwin* which does not exist.
Only powerpc64-darwin (BigEndian, no suffix) exists.
https://github.com/upx/upx/issues/596
2022-09-27 15:58:35 +02:00
dependabot[bot] 38a1d3179b build(deps): bump actions/stale from 5 to 6
Bumps [actions/stale](https://github.com/actions/stale) from 5 to 6.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-22 17:07:26 +00:00
Markus F.X.J. Oberhumer 0d639d6386 CI: add macos job 2022-09-21 21:55:07 +02:00
Markus F.X.J. Oberhumer 4256057c27 src: add a mem_size() call hinted by GitHub CodeQL 2022-09-21 19:28:46 +02:00
Markus F.X.J. Oberhumer b720b47c12 CI: update testsuite caused by previous commit 2022-09-21 19:22:39 +02:00
John Reiser 55e4a4f086 Assembler local symbol ("1:") clobbered by code in .macro
https://github.com/upx/upx/issues/534
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/macros.S
2022-09-20 13:08:14 -07:00
Markus F.X.J. Oberhumer b4cb9f8b2f src: silence some bogus GitHub CodeQL warnings; add MemBuffer "+" overload 2022-09-17 07:53:14 +02:00
Markus F.X.J. Oberhumer 63298ebd6d src: silence clang-15 compiler warnings 2022-09-16 16:31:34 +02:00
Markus F.X.J. Oberhumer 73c816e468 doc: work on improving docs; add generated files to Git repo 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 0492e650ef submodules: update for new versions 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer b8b94ee89e src: more cleanups; NFCI 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 81176716d5 src: linker: fix a minor printf format issue detected by codeql 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 26e7ae00e9 CI: create codeql-analysis.yml 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer c75d7a685d src: major cleanups, introduce new eXtended Span class
- initial minimally invasive eXtended Span implementation
- rename ptr_diff to ptr_diff_bytes
- move some files to util subdir
- lots of cleanups
- start using the new checked pointers - this needs some real-world testing
2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 4318cc22ee src: cleanup option handling, add testcases; fixes #587 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 575cb720c6 doc: work on README 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 5db34fbf92 src: new ACC version 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 7cfef2f6bf CI: update testsuite checksums caused by version date bump 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 4603f1df4b src: bump tentative release date 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer c69fcfff9d src: doctest: start work on using doctest 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 70f14101ed doc: update README.SRC, mention misc/rebuild-stubs-with-podman 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer a9803459ed doc: move BUGS into doc subdirectory 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 43034e8e92 doc: remove outdated README.1ST 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer ef547034f6 misc: add misc/rebuild-stubs-with-podman files 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer e87fc60391 misc: update clang-format files 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 45e6e73d85 misc: move some scripts from src/stub/scripts to misc/scripts 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer be30c26dbb make: update src/Makefile 2022-09-16 13:26:13 +02:00
Markus F.X.J. Oberhumer 79e9b0762c CI: work on new cmake-based CI; updates 2022-09-16 13:26:10 +02:00
Markus F.X.J. Oberhumer a9a806c418 CI: remove obsolete travis_deploy.sh - superseded by GitHub Actions 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer c7d8b6fed1 make: add new top-level Makefile, now using CMake 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer a723efd225 make: remove top-level Makefile 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer cf429dfce4 cmake: add CMakeLists.txt for building with CMake 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer 3fcd64a0c0 misc: update files 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer 83cb38022b misc: add compile_flags.txt to support editors using clangd LSP 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer 93c04d1f66 misc: add .gitattributes for GitHub linguist 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer 3c47898cf4 make: adjust for new vendor/lzma-sdk location 2022-09-11 13:26:32 +02:00
Markus F.X.J. Oberhumer 61e1366122 submodules: add new upx-vendor submodules in directory "vendor" 2022-09-11 13:26:29 +02:00
Markus F.X.J. Oberhumer a20636fd63 submodules: remove submodule src/lzma-sdk 2022-09-04 04:24:39 +02:00
Markus F.X.J. Oberhumer aa8cdca0a9 src: consistently use TESTING for internal development tests 2022-09-04 04:24:39 +02:00
Markus F.X.J. Oberhumer 6931a3aa70 src: enable -Wzero-as-null-pointer-constant when using clang 2022-09-04 04:24:39 +02:00
Markus F.X.J. Oberhumer d001a63bce Welcome 2022. 2022-09-04 04:24:39 +02:00
Markus F.X.J. Oberhumer 0d3377f48b src: p_mach.cpp: disable -Wcast-align warning 2022-08-17 19:54:44 +02:00
John Reiser aeb04d97c8 powerpc64-darwin.macho (not powerpc64le-darwin.macho)
All Apple PowerPC are BigEndian only.
        https://github.com/upx/upx/issues/596
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   packmast.cpp
2022-09-03 12:39:50 -07:00
John Reiser eb68ab91cd PackDjgpp2::canPack() allows "loose" (non-contiguous) text,data,bss
Hack: grow text to eliminate gap; don't complain unless bss overlaps data
https://github.com/upx/upx/issues/45
	modified:   p_djgpp2.cpp
2022-08-29 11:37:46 +02:00
Markus F.X.J. Oberhumer ee242ba987 CI: improve workflows/close-stale-issues.yml 2022-08-27 21:04:56 +02:00
cui fliter 44a53736ff fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-08-23 19:20:21 +02:00
Markus F.X.J. Oberhumer 1b21fef081 CI: improve workflows/close-stale-issues.yml 2022-08-12 17:59:32 +02:00
Markus F.X.J. Oberhumer 5f9c50cd3e clang-format 2022-08-10 23:29:43 +02:00
Markus F.X.J. Oberhumer 793d8c1d2e Fix compilation with C++20. 2022-07-17 21:16:11 +02:00
Markus F.X.J. Oberhumer 81f868a0c6 Add .github/workflows/close-stale-issues.yml 2022-08-10 23:12:09 +02:00
John Reiser dadbbbdc64 Avoid trouble: disallow empty name of export directory
https://github.com/upx/upx/issues/425
	modified:   pefile.cpp
2022-08-13 12:25:30 -07:00
John Reiser bfd2153f2b Delete trailing space characters
https://github.com/upx/upx/pull/589
	modified:   pefile.cpp
2022-07-26 20:09:16 -07:00
S01den 077793fa5e Update pefile.cpp
I found a bug by participating to the Binary Golf Grand Prix 3 (https://tmpout.sh/bggp/3/) : upx text.exe segfaults when NumberOfSections in the IMAGE_FILE_HEADER is NULL, so 
if (memcmp(isection[0].name,"UPX",3) == 0) triggers a NULL pointer dereference causing a crash.
To fix it, just have to check if isection is NULL (which means NumberOfSections = 0) or not.
2022-07-27 01:54:01 +02:00
John Reiser acad3c3000 DT_INIT_ARRAY noes not pertain to DT_* for symbol table info
https://github.com/upx/upx/issues/586
	modified:   p_lx_elf.cpp
2022-07-02 20:52:18 -07:00
John Reiser 3b4627e17e Add filename to infoWarning("file coruupted")
modified:   p_mach.cpp
2022-06-01 08:34:23 -07:00
John Reiser 05976ee1a7 Try harder to de-compress corrupted Mach-o file.
https://github.com/upx/upx/issues/579
	modified:   p_mach.cpp
2022-05-31 11:52:10 -07:00
John Reiser c1311c78a3 Extra space to force "git commit" to force rebuild for tagging Issue
https://github.com/upx/upx/issues/577
	modified:   p_lx_elf.cpp
2022-05-30 15:19:18 -07:00
John Reiser 717150b7f3 Stupid MSVC: bad C4706: assignment within conditional expression
-    for (unsigned j=0; (k = dt_names[j]); ++j) {
+    for (unsigned j=0; ((k = dt_names[j]), k); ++j) {

The complaint was:
    p_lx_elf.cpp(5710) : warning C4706: assignment within conditional expression
which is INCORRECT, as shown in the change which is 100% equivalent.
The assignment occurs BEFORE the conditional expression.
	modified:   p_lx_elf.cpp
2022-05-30 15:09:34 -07:00
John Reiser a68c62d938 More placate compilers
https://github.com/upx/upx/issues/577
	modified:   p_lx_elf.cpp
2022-05-30 15:02:53 -07:00
John Reiser c11f8a569a Placate 'clang' -Wcast-align
https://github.com/upx/upx/issues/577
	modified:   p_lx_elf.cpp
2022-05-30 14:55:39 -07:00
John Reiser 03436d2415 Bug in handling DT_GNU_HASH table.
Fix includes a more-general and stronger heuristic to find the end of
GNU_HASH table when there is no ElfXX_Shdr for it.  64-bit only for now.
(This is needed to help prevent SIGSEGV when processing tampered .exe.)

https://github.com/upx/upx/issues/577
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2022-05-30 14:24:21 -07:00
John Reiser 4ae75375e0 LC_BUILD_VERSION etc for XCode 13+
https://github.com/upx/upx/issues/578
	modified:   p_mach.cpp
	modified:   p_mach_enum.h
2022-05-30 01:05:09 -07:00
John Reiser 2721ef0636 ElfLinker::init() allows symbols and relocations (but not Sections) to be empty
modified:   linker.cpp
	modified:   linker.h
2022-05-04 13:29:36 -07:00
John Reiser 7a232cb330 Allow qemu on host with smaller PAGE_SIZE. Sync stubs.
https://github.com/upx/upx/issues/571
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2022-03-25 09:13:10 -07:00
John Reiser 52f19ae330 Cleanup powerpc64le-linux.elf-*.S (forgotten when powerpc-linux.elf*.S)
https://github.com/upx/upx/issues/571
	modified:   stub/powerpc64-linux.elf-entry.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/tmp/powerpc64-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2022-03-24 19:14:56 -07:00
John Reiser 275477f914 ElfLinker::addSection omits "ABS*" and "UND*" sections
modified:   linker.cpp
2022-03-24 19:09:09 -07:00
John Reiser 2ed6755d5d Sync stubs
https://github.com/upx/upx/issues/570
	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
2022-03-22 19:27:27 -07:00
John Reiser 78c555b4a6 Handle old-style compressed main programs when de-compressing
modified:   p_lx_elf.cpp
2022-03-22 19:20:09 -07:00
John Reiser a127125707 Comment the breakpoint instructions for faster analysis by 'grep'
modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
2022-03-22 19:18:19 -07:00
John Reiser f853f91c5b Placate clang re: missing 'override'
modified:   file.h
2022-03-22 19:16:15 -07:00
John Reiser e7ca5c54ff Fix --brute for p_lx_elf.cpp, which compresses multiple pieces
Force all pieces to use the same de-compressor.
(Future: allow each PT_LOAD to choose its own.)
Has minor wobbles due to page alignment, and size of de-compressor.
64-bit only for now.
https://github.com/upx/upx/issues/570
https://github.com/upx/upx/issues/297
	modified:   p_lx_elf.cpp
	modified:   p_unix.cpp
	modified:   packer.cpp
	modified:   packer.h
2022-03-22 11:46:25 -07:00
John Reiser 663d6b466b WIP: clarify compressWithFilters; reduce size of obuf for PackLinuxElf64
modified:   p_lx_elf.cpp
	modified:   packer.cpp
	modified:   packer.h
2022-03-21 13:49:46 -07:00
John Reiser 0e2a9de2b2 Empty commit to force re-build Action
https://github.com/upx/upx/issues/568
2022-03-14 15:51:09 -07:00
John Reiser 34df0d6ef1 More empty HASH and/or GNU_HASH when Rust-musl
https://github.com/upx/upx/issues/568
	modified:   p_lx_elf.cpp
2022-03-12 14:21:51 -08:00
John Reiser 540164849b whitespace
https://github.com/upx/upx/issues/446
	modified:   macho-snip.c
2022-03-01 16:05:37 -08:00
John Reiser 252143d0bb WIP: smallest executable on Apple M1 (aarch64 or arm64)
Requirements for success after snipping a loader_command:
    "codesign -s - my_app" must succeed.
    "lldb my_app; process launch -s; continue" must succeed.

Optional loader_commands (macho-snip can remove these successfully):
    LC_UUID, LC_BUILD_VERSION, LC_SOURCE_VERISON,
    LC_DATA_IN_CODE (when 0==datasize)

Apple "strip -N" clears out LC_SYMTAB and LC_DYSYMTAB, but leaves
LC_DYLD_INFO_ONLY.export_size.  Perhaps this could be zero if
constructed that way; snipping seems tedious because codesign
requires that __LINKEDIT must have no gaps.

LC_FUNCTION_STARTS seems to be required by codesign.
codesign wants offsets that point into __LINKEDIT to be in order:
    LC_DYLD_INFO_ONLY, LC_FUNCTION_STARTS, LC_DATA_IN_CODE, LC_SYMTAB

MacOS seesm to require LC_LOAD_DYLINKER (else "zsh: Kiled"),
which seems to require LD_LOAD_DYLIB (else SIGABRT).

https://github.com/upx/upx/issues/446
----
        modified:   macho-snip.c
	modified:   udf.s
2022-03-01 15:06:58 -08:00
John Reiser 480ab51650 Evade poratbility constraints of UPX build system
when building a tool to investigate "minimal" Mach-O executable
on Apple MacOS Big Sur using Apple M1 hardware (aarch64).
https://github.com/upx/upx/issues/567
	modified:   stub/tools/macho-snip/Makefile
	modified:   stub/tools/macho-snip/macho-snip.c
	modified:   stub/tools/macho-snip/udf.s
2022-03-01 11:12:19 -08:00
John Reiser 972c76eb42 Tool for snipping loader_commands in Mach-O on Apple M1 (aarch64) on BigSur.
experimental!
https://github.com/upx/upx/issues/424
	new file:   macho-snip/Makefile
	new file:   macho-snip/macho-snip.c
	new file:   macho-snip/udf.s
2022-02-28 19:53:25 -08:00
John Reiser e5aeea9ed2 Check more carefully in invert_pt_dynamic()
https://github.com/upx/upx/issues/566
	modified:   p_lx_elf.cpp
2022-02-28 07:55:49 -08:00
John Reiser f204670008 Mach unpack checks for bad load_command in compressed input
https://github.com/upx/upx/issues/564
	modified:   p_mach.cpp
2022-02-25 10:17:04 -08:00
John Reiser 651155c64d Check Mach_header.ncmds at unpack
https://github.com/upx/upx/issues/563
	modified:   p_mach.cpp
2022-02-25 09:32:29 -08:00
John Reiser 660aee6d22 More checking for unpack of tampered Elf_Phdr
https://github.com/upx/upx/issues/562
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2022-02-25 09:23:55 -08:00
John Reiser a646231630 aligned_sotls, per Laszlo
https://github.com/upx/upx/issues/556
	modified:   pefile.cpp
2022-02-07 08:39:13 -08:00
John Reiser 1050de5171 Native alignment for the "load config" table
https://github.com/upx/upx/issues/556
	modified:   pefile.cpp
2022-01-15 06:45:47 -08:00
John Reiser b7a5b9437a Fix checking of sh_name versus shstrsec->sh_size
https://github.com/upx/upx/issues/509
	modified:   p_vmlinx.cpp
2022-01-01 14:20:18 -08:00
Kornel Pal 620955a724 PE: Fix has_oxrelocs (TLS always has oxrelocs) 2021-12-31 20:45:28 +01:00
John Reiser 2e64a277f8 Fix headway during optimizeReloc()
Later: "Assertion `(soxrelocs == 0) == !has_oxrelocs' failed."
https://github.com/upx/upx/issues/552
	modified:   packer.cpp
	modified:   packer.h
	modified:   pefile.cpp
2021-12-31 10:27:58 -08:00
John Reiser ea567a8b14 Check when optimizeRelocs()
https://github.com/upx/upx/issues/513
	modified:   packer.h
	modified:   packer.cpp
	modified:   pefile.cpp
	modified:   p_wcle.cpp
	modified:   p_tmt.cpp
2021-12-29 16:57:52 -08:00
John Reiser be23f93ee6 upx_uint8_t
https://github.com/upx/upx/issues/545
	modified:   p_mach.h
2021-12-27 08:49:05 -08:00
John Reiser fcdf0e92c1 Use upx_uint32_t, upx_uint64_t
Avoid complaints from x86_64-w64-mingw32-gcc (GCC) 9.3-win32 20200320
https://github.com/upx/upx/issues/545
	modified:   p_mach.h
2021-12-27 08:33:54 -08:00
John Reiser 2d6987252e is_bad_linker_command()
https://github.com/upx/upx/issues/545
	modified:   p_mach.cpp
2021-12-27 08:14:19 -08:00
John Reiser 4a9c46253e Validate input LC_ commands in order to defend against fuzzers
TODO: validate in ::unpack(), too
https://github.com/upx/upx/issues/545
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
2021-12-26 19:40:34 -08:00
John Reiser 5bcf9dd8af Do not complain for minimal DT_GNU_HASH as by Rust.
Also: .p_type is 32 bits only!

https://github.com/upx/upx/issues/525
	modified:   p_lx_elf.cpp
2021-12-25 12:39:31 -08:00
John Reiser 284adb203f Better checking of DT_HASH.nbuckets
https://github.com/upx/upx/issues/507
	modified:   p_lx_elf.cpp
2021-12-24 15:52:16 -08:00
John Reiser adafa841f7 Some PT_LOAD must have (p_flags & PF_X)
https://github.com/upx/upx/issues/511
	modified:   p_lx_elf.cpp
2021-12-24 15:32:19 -08:00
John Reiser fdc5d25d03 Require DT_STRSZ
https://github.com/upx/upx/issues/512
	modified:   p_lx_elf.cpp
2021-12-24 15:08:22 -08:00
John Reiser 294a7077de Announce support for EFI files (PE x86)
modified:   NEWS
2021-12-24 15:05:53 -08:00
Kornel Pal 990d0ec543 PE: Remove duplicate oxrelocs write 2021-12-22 05:07:54 +01:00
John Reiser bb90c4dff4 Sync PE stubs
modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2021-12-24 07:34:06 -08:00
Kornel Pal 00e3d992e8 Sync stubs 2021-12-22 03:05:53 +01:00
Kornel Pal 937bfa4e49 PE: Add support for EFI images 2021-12-22 03:05:24 +01:00
Kornel Pal 1d9c211eed PE: Make imports in decompressor stub optional 2021-12-22 03:00:17 +01:00
Kornel Pal 76ddf6b8da PE: Add position independent decompressor stub for i386 2021-12-22 02:58:09 +01:00
Kornel Pal 7f1f29b0d8 PE: Remove empty non-compressed section 2021-12-22 02:57:10 +01:00
Kornel Pal 222471744f PE: Remove file alignment restriction 2021-12-22 02:56:09 +01:00
Kornel Pal cc100be26e PE: Fix stripped relocation handling 2021-12-22 02:55:33 +01:00
Kornel Pal 966b571b7c PE: Use no red zone on AMD64 2021-12-16 06:59:26 +01:00
Kornel Pal f3e710394a PE: Set header size on 64-bit too 2021-12-16 06:57:39 +01:00
Kornel Pal bfd1f1fbfa PE: Fix relocation parsing and validation 2021-12-16 06:56:01 +01:00
Efreak a09146b5e0 unreferenced variable breaks build 2021-12-02 14:00:40 -08:00
John Reiser bbf2b08f48 Update testsuite with new signatures for i386-linux.elf
https://github.com/upx/upx/issues/540
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2021-12-03 08:53:08 -08:00
John Reiser e2dbc661f1 Sync stub
modified:   stub/i386-linux.elf-entry.h
2021-12-03 08:38:26 -08:00
John Reiser 7626e09f66 Fix jl ==> jb (unsigned compare)
modified:   stub/src/i386-linux.elf-entry.S
2021-12-03 08:27:23 -08:00
Kirill A. Korinsky 248a6980cf Revert -std=c++14
This commit reverts 648fa30f22 which was removed by d60c46371d which is fixed https://github.com/upx/upx/issues/440
2021-11-27 13:22:54 +01:00
John Reiser f956bfc797 Allow slack for non-GLIBC tool chains versus -Wzero-as-null-pointer-constant
https://github.com/upx/upx/pull/531
	modified:   conf.h
2021-11-27 06:58:38 -08:00
bitraid 6da79783ea PE: Handle empty imports 2021-05-15 21:41:31 +03:00
a1346054 22329e0ab2 trim excess whitespace 2021-08-22 11:23:41 +00:00
a1346054 a94b0329c9 update codestyle in travis scripts to conform to guidelines
* adds and fixes indentation in a few places
* removes redundant quotes
* adds quotes around some arguments to silence shellcheck warnings
* fixes spelling
2021-08-22 11:21:28 +00:00
a1346054 be8601f8cc use grep -E instead of egrep
egrep will go away at some point, and grep -E is standardized
2021-08-22 11:19:38 +00:00
John Reiser bd441e83ae WIP: de-compression of old-style shlib
modified:   p_lx_elf.cpp
2021-09-06 08:43:20 -07:00
John Reiser 02bd9cc403 IMAGE_SUBSYSTEM_EFI_APPLICATION
Beginning of support for compressing EFI files; lacks run-time decompressor.
https://github.com/upx/upx/issues/518
	modified:   p_armpe.cpp
	modified:   p_w32pe.cpp
	modified:   p_w64pep.cpp
	modified:   pefile.cpp
	modified:   pefile.h
2021-09-06 08:38:51 -07:00
John Reiser c9f6a3583c WIP 64-bit shlib
modified:   p_lx_elf.cpp
2021-08-07 06:45:01 -07:00
John Reiser 076aaf829a WIP: Elf64 shlib compress+decompress seems to work
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2021-07-05 13:47:19 -07:00
John Reiser 85f0c5a445 WIP: Elf64 shlib cleanup
modified:   file.cpp
	modified:   file.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-07-02 18:33:38 -07:00
John Reiser d5263a56ce WIP: handling shared library
modified:   p_lx_elf.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
2021-05-22 16:03:53 -07:00
John Reiser ef5b55b4d1 sync stubs
https://github.com/upx/upx/issues/441
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
2021-05-16 10:14:03 -07:00
Markus F.X.J. Oberhumer d65e65b2b1 Update CI. 2021-05-15 07:24:16 +02:00
Markus F.X.J. Oberhumer 6aa641e5aa Update submodules. 2021-05-15 06:03:48 +02:00
John Reiser 504839951a arm64 clear_cache at end of de-compress
https://github.com/upx/upx/issues/441
	modified:   stub/src/arch/arm64/v8/macros.S

	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2021-05-16 09:53:03 -07:00
bitraid d55746f62d PE: disable CFG and compress with --force 2021-05-01 18:05:27 +03:00
bitraid 144010295e Improve --strip-relocs
- Remove .reloc section
- Enable for 64-bit images
- Abort if explicitly set on unsupported image
- Use with --force to remove ASLR / apply when imagebase < default
2021-04-25 20:15:07 +03:00
John Reiser 181c752488 WIP: un_shlib_1
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-05-08 11:14:31 -07:00
John Reiser bd4aca5c12 generated stub files
https://github.com/upx/upx/issues/473
	modified:   stub/mips.r3000-linux.shlib-init.h
	modified:   stub/mipsel.r3000-linux.shlib-init.h
	modified:   stub/tmp/mips.r3000-linux.shlib-init.bin.dump
	modified:   stub/tmp/mipsel.r3000-linux.shlib-init.bin.dump
2021-05-07 11:15:41 -07:00
John Reiser ad6d73c875 /proc/self/auxv for AT_PAGESZ because musl calls _init with no args
https://github.com/upx/upx/issues/473
	modified:   mipsel.r3000-linux.shlib-init.S
2021-05-07 09:36:07 -07:00
bitraid c5cc83d424 Fix unoptimizeReloc() to process all relocs 2021-04-21 23:06:55 +03:00
bitraid fe949bdf67 Build: Enable wildcard argument expansion for msvc 2021-04-12 11:20:13 +03:00
John Reiser 766fe466d6 PAGE_SIZE varies: Apple M1 uses 16K
modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
2021-04-11 15:19:24 -07:00
John Reiser 333a288248 shlib: Don't compress below xct_off (except Elf headers)
modified:   p_lx_elf.cpp
2021-04-11 15:16:34 -07:00
John Reiser 613df414ed Fix off-by-1 in invert_pt_dynamic; SHT_NOBITS occupies no space
modified:   p_lx_elf.cpp
2021-04-11 15:09:55 -07:00
John Reiser be050693f2 PackLinuxElf::canUnpack must checkEhdr() for ELF input
https://github.com/upx/upx/issues/485
	modified:   p_lx_elf.cpp
2021-04-10 10:11:48 -07:00
goushibee bf957f435e fix issue 486 2021-04-07 15:40:13 +08:00
John Reiser 3a6f688265 Sync testsuite checksums for PE: fix SizeOfHeaders
https://github.com/upx/upx/pull/483
	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
2021-04-10 08:51:27 -07:00
Sebastien Rosset (serosset) 1084a7896c Add default goal 2021-04-03 13:08:01 -07:00
bitraid 9ea2b31541 PE: fix SectionHeadersSize of SizeOfHeaders value 2021-04-06 22:49:31 +03:00
Sebastien Rosset (serosset) 09da986742 build instructions 2021-04-03 11:57:05 -07:00
John Reiser cb70a5fef5 Enable usual grep for function definition
Developer convenience: no space between function name and left paren
	modified:   compress.cpp
2021-04-03 12:46:20 -07:00
John Reiser 4fa6a6aeef Sync testsuite checksums for PE: fix SizeOfHeaders
https://github.com/upx/upx/pull/477
	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
2021-04-02 19:37:29 -07:00
Markus F.X.J. Oberhumer ab31e8dde9 testsuite: change exit code to 98 for FATAL decompression checksum mismatchs. 2021-03-28 22:06:42 +02:00
Markus F.X.J. Oberhumer 53d7b5449f testsuite: change exit code to 99 for checksum mismatchs. 2021-03-28 21:49:32 +02:00
Markus F.X.J. Oberhumer d33a34f016 Revert some changes from previous commit to pacify clang
-Winconsistent-missing-override warnings.
2021-03-28 21:40:13 +02:00
Markus F.X.J. Oberhumer f6ff5a2805 Cleanups: start working on -Wsuggest-override, add some "final". NFCI. 2021-03-28 21:19:29 +02:00
bitraid 1518e5bc98 PE: fix SizeOfHeaders value of Optional Header field 2021-03-25 21:41:49 +02:00
John Reiser 78f48d65d5 Allow 0==nbucket for DT_HASH, DT_GNU_HASH
static linked 'Rust' program with no symbols
https://github.com/upx/upx/issues/476
2021-03-25 07:22:01 -07:00
John Reiser b81ec224b7 Fix headway argument to invert_pt_dynamic()
https://github.com/upx/upx/issues/473
	modified:   p_lx_elf.cpp
2021-03-25 07:10:40 -07:00
John Reiser 4be6cfebcd get_te32() when checking DT_GNU_HASH chains (MIPS .so)
https://github.com/upx/upx/issues/473
        modified:   p_lx_elf.cpp
2021-03-23 18:21:45 -07:00
John Reiser 98973dd8b9 get_te32() when checking DT_HASH chains (MIPS .so)
https://github.com/upx/upx/issues/473
	modified:   p_lx_elf.cpp
2021-03-23 06:45:01 -07:00
John Reiser 1218b6ff2a Check more in invert_pt_dynamic
https://github.com/upx/upx/issues/471
	modified:   p_lx_elf.cpp
2021-03-16 18:46:11 -07:00
John Reiser ba5c77c9e5 Reject if MZ and PE headers overlap
Overlap ('leanify', etc.) causes headaches.
https://github.com/upx/upx/issues/231
	modified:   p_w32pe.cpp
	modified:   p_w64pep.cpp
	modified:   pefile.cpp
2021-03-14 15:20:15 -07:00
jsm174 cbaedffce2 ci: make artifacts for all builds 2021-03-09 09:36:08 -05:00
John Reiser cb60603950 Turn off BUILD_TYPE_DEBUG to enable CI build amd64-win64-gcc-9 to pass.
modified:   Makefile
2021-03-07 09:33:16 -08:00
John Reiser 0a69e7803b Fix errors detected by "make run-testsuite".
total_out does not matter when option -t writes no output file.
Subtle error in generateElfHdr() [noted by address sanitizer].
New member function is_LOAD32() to avoid confusion with (1+ LO_PROC).
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-03-06 15:31:56 -08:00
John Reiser baa9090198 Change back to lzma-sdk d5bed9963d051c9e5690b12199eab6884a592c43
modified:   lzma-sdk
2021-03-06 12:05:23 -08:00
John Reiser e78a08b8fc change lzma-sdk to latest commit 44db23cc6d6b607986dace07b17fece1af925558 on its master 2021-03-06 10:46:40 -08:00
John Reiser 7e5e6012df PackMachFat::canPack handles case PackMachFat::CPU_TYPE_ARM64
modified:   p_mach.cpp
2021-03-06 09:59:51 -08:00
John Reiser 0a1d24d1d9 Remove nit from PackLinuxElf64::generateElfHdr [address sanitizer]
modified:   p_lx_elf.cpp
2021-03-05 16:33:25 -08:00
John Reiser 35555bfb8a WIP: PackLinuxElf64::unpack working for shared libraries (non-Android)
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_unix.cpp
2021-03-05 16:20:36 -08:00
John Reiser c9cb42df40 WIP: hacking un_shlib_1
modified:   p_lx_elf.cpp
2021-02-28 17:12:20 -08:00
John Reiser 2be03028f4 WIP: un_shlib_1
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2021-02-27 19:27:12 -08:00
John Reiser 214dd0a522 4 fewer bytes of code?
modified:   arm64-linux.elf-fold.h
	modified:   tmp/arm64-linux.elf-fold.map
2021-02-23 02:24:24 -08:00
John Reiser 182e0796df Split PackLinuxElf64::unpack for main program vs shared library
modified:   p_lx_elf.cpp
2021-02-22 16:15:03 -08:00
John Reiser fb844a8ed1 total_in, total_out move to PackUnix
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_lx_interp.cpp
	modified:   p_mach.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
2021-02-22 16:13:40 -08:00
John Reiser 6be3e747ca Remove unrelated debugging
modified:   stub/src/arm64-linux.elf-fold.S
2021-02-15 11:40:04 -08:00
John Reiser 23f63e4196 WIP unpacking ELF shared library
modified:   Makefile
	modified:   lzma-sdk
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_mach.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
	modified:   packer.cpp
	modified:   packer.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/tmp/arm64-linux.elf-fold.map
2021-01-15 14:11:09 -08:00
John Reiser fd6837b267 Another checkAlreadyPacked()
https://github.com/upx/upx/issues/463
	modified:   Makefile
	modified:   p_mach.cpp
2021-02-26 15:15:28 -08:00
John Reiser 1c29f921e0 getSizeForCompression worst cases
https://github.com/upx/upx/issues/463
	modified:   Makefile
	modified:   mem.cpp
2021-02-25 20:04:16 -08:00
John Reiser 1ab6e01de2 MacOS BigSur wants no MH_DYLDLINK for our MH_EXECUTE
https://github.com/upx/upx/issues/434
	modified:   p_mach.cpp
2021-02-14 13:23:19 -08:00
Markus F.X.J. Oberhumer 801618740c CI: fix current Ubuntu problem. 2021-02-01 13:06:49 +01:00
John Reiser 2469563b26 Mach_ARM64_thread_state padded to (0 mod 8)
https://github.com/upx/upx/issues/446  (partial)
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
2021-01-30 16:11:32 -08:00
John Reiser 00139caf43 More robust PackWcle::decodeFixups()
https://github.com/upx/upx/issues/455
	modified:   p_wcle.cpp
2021-01-23 15:37:52 -08:00
John Reiser 21d102c84f Better checking of Mach_header.ncmds, .sizeofcmds
Improves earlier fix.
https://github.com/upx/upx/issues/447
	modified:   p_mach.cpp
2021-01-23 13:52:54 -08:00
John Reiser f17d9967c2 Clarify comment in previous commit
modified:   main.cpp
2021-01-20 05:54:53 -08:00
Liam Murphy 0569ef37ba add comment explaining code as per PR review 2021-01-20 02:29:08 +00:00
Liam Murphy 984334c9a1 reset done_output_name counter upx_main() 2021-01-18 00:16:49 +00:00
John Reiser 34a25e61c7 "%zx" for ptrdiff_t in hex printf
modified:   p_wcle.cpp
2021-01-17 19:36:36 -08:00
John Reiser ed3f45953e Try not to run off the end of selfrel_fixups.
https://github.com/upx/upx/issues/455
	modified:   p_wcle.cpp
	modified:   packer.cpp
2021-01-17 19:21:32 -08:00
John Reiser 80de11bc5b Detect Mach_header.sizeofcmds==0
https://github.com/upx/upx/issues/448
	modified:   p_mach.cpp
2021-01-17 17:09:35 -08:00
Darío Hereñú c9fe84c9aa Typo fixed (line 61) 2021-01-09 14:04:47 -03:00
John Reiser 5f98bb0ab0 De-compress allows old-style LC_UNIXTHREAD with one LC_SEGMENT
https://github.com/upx/upx/issues/447
	modified:   p_mach.cpp
2021-01-15 15:03:26 -08:00
Markus F.X.J. Oberhumer d86d5314ba Modernize libc usage: more cleanups. 2021-01-05 22:03:29 +01:00
Markus F.X.J. Oberhumer 700c8730cf Modernize libc usage: stop using off_t, use modern printf.
C++ 14 is here, and old versions of MSVC and MSVCRT have
haunted us long enough.
2021-01-05 18:52:05 +01:00
Markus F.X.J. Oberhumer b4429e1a42 CI: add sanitizer builds. 2021-01-04 22:03:23 +01:00
Markus F.X.J. Oberhumer a8fa3ca5cf Use correct native types with "alignas(1)". 2021-01-04 21:13:49 +01:00
Markus F.X.J. Oberhumer 9aef7b0d6f Use C++ 14 alignas(), init some struct fields just because of good practice. 2021-01-04 21:02:07 +01:00
Markus F.X.J. Oberhumer 2575eef3c0 clang-format more files.
"Gofmt's style is nobody's favourite, but gofmt is everybody's favourite."
    - Rob Pike
2021-01-04 20:26:31 +01:00
Markus F.X.J. Oberhumer 8236276a90 Add and use .clang-format file. 2021-01-04 19:07:17 +01:00
Markus F.X.J. Oberhumer fdc68812c5 clang-format-10.0.1 files. 2021-01-04 17:27:48 +01:00
Markus F.X.J. Oberhumer 9db6d18d11 Now using upx-stubtools 20210104 with new clang-format-10.0.1. 2021-01-04 17:23:57 +01:00
Markus F.X.J. Oberhumer f962afe146 Various cosmetic updates and refactors. NFCI. 2021-01-04 17:20:57 +01:00
Markus F.X.J. Oberhumer adcd569852 Makefile: update default sanitizer flags. 2021-01-04 17:20:06 +01:00
Markus F.X.J. Oberhumer d045b7f223 Update bele.h to better work with modern compilers. 2021-01-02 16:45:58 +01:00
Markus F.X.J. Oberhumer 57cb6a7530 CI: add mingw64 build. 2021-01-02 01:03:24 +01:00
Markus F.X.J. Oberhumer baa1ed9be3 Update CI to use lastest zlib. Update Makefile. 2021-01-01 23:24:31 +01:00
Markus F.X.J. Oberhumer 16af6e1a29 Update testsuite checksums caused by version bump. 2021-01-01 20:52:07 +01:00
Markus F.X.J. Oberhumer 0af8998be6 Bump version date. 2021-01-01 20:45:11 +01:00
Markus F.X.J. Oberhumer c32f517fa5 Remove obsolete PROJECTS file. 2021-01-01 20:43:34 +01:00
Markus F.X.J. Oberhumer 9131d5216f Welcome 2021. 2021-01-01 20:39:22 +01:00
Markus F.X.J. Oberhumer fb14a7991d Fix Makefile breakage in previous commit. 2020-12-15 02:15:34 +01:00
Markus F.X.J. Oberhumer ff53862dab Extract upx_main() for compilation with -DWITH_GUI. 2020-12-14 22:10:07 +01:00
Markus F.X.J. Oberhumer 49245a20c5 Update Makefile and compiler checks so that users don't inadvertently
change mandatory compiler flags.
2020-12-14 20:53:54 +01:00
John Reiser 13bc031163 Check DT_REL/DT_RELA, DT_RELSZ/DT_RELASZ
https://github.com/upx/upx/issues/421
	modified:   p_lx_elf.cpp
2020-12-11 13:38:18 -08:00
John Reiser 0c18c1c35c Include --lzma as a compression tuning option in --help.
modified:   help.cpp
2020-12-11 12:34:38 -08:00
John Reiser 63dc19ce25 -std=c++14
modified:   Makefile
2020-12-11 11:38:38 -08:00
John Reiser 6871c2fc0a Tweak unoptimizeReloc again
modified:   packer.cpp
2020-12-10 19:56:02 -08:00
Markus F.X.J. Oberhumer 4ae3a8b2b0 Revert useless "fast exit" check from b2c00aa637. 2020-12-08 07:13:11 +01:00
Markus F.X.J. Oberhumer f2e562b5de Update CI. 2020-12-08 06:22:10 +01:00
Markus F.X.J. Oberhumer f7e2266c3f Start using some C++ 14 features. 2020-12-08 05:40:17 +01:00
Markus F.X.J. Oberhumer 361a3056cb Update submodules. 2020-12-08 05:40:07 +01:00
Markus F.X.J. Oberhumer ca0437556d Start using "noexcept". 2020-12-08 00:45:41 +01:00
Markus F.X.J. Oberhumer 51899957a9 Require C++ 14. Finally!
This is the default for gcc >= 6, clang >= 6 and MSVC >= 2019.
2020-12-07 23:05:13 +01:00
Markus F.X.J. Oberhumer 7b0b760d78 src/Makefile: add -Wsign-compare to warning flags to better match MSVC. 2020-12-07 23:04:37 +01:00
Markus F.X.J. Oberhumer 4f5866b5a7 Remove AppVeyor CI. 2020-12-07 23:04:01 +01:00
John Reiser a6b5033cf1 Fix overlap detection for PE unoptimizeReloc()
https://github.com/upx/upx/issues/438
	modified:   packer.cpp
2020-12-10 19:31:56 -08:00
John Reiser a6296ecd67 Avoid complaint from "gcc -Wsign-conversion"
modified:   compress_lzma.cpp
	modified:   compress_zlib.cpp
2020-12-06 15:22:58 -08:00
John Reiser bb1df15958 Use 'mb_' prefix on instances of MemBuffer
modified:   pefile.cpp
	modified:   pefile.h
2020-12-05 13:53:14 -08:00
Liam Murphy 249431f45f tweak formatting to reduce diff 2020-11-26 03:00:21 +00:00
Liam Murphy cbe129795e migrate to MemBuffer class from New() to remove leak 2020-11-26 00:14:00 +00:00
John Reiser 2a135e245b Prefer MemBuffer instead of New()+delete
https://github.com/upx/upx/issues/428
	modified:   pefile.cpp
	modified:   pefile.h
2020-12-05 13:44:19 -08:00
Markus F.X.J. Oberhumer 05a0b3557a Update CI. 2020-12-05 14:04:46 +01:00
Markus F.X.J. Oberhumer c7cfe8b608 Remove Travis CI. 2020-12-05 06:29:57 +01:00
Markus F.X.J. Oberhumer 8d3e1d28a7 Update GitHub CI. 2020-12-05 04:37:30 +01:00
John Reiser 7841e15583 Prefer MemBuffer instead of New()+delete
https://github.com/upx/upx/issues/428
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2020-12-05 10:31:55 -08:00
Markus F.X.J. Oberhumer dd164fbc86 Undo Makefile change in 9b0f523d00. 2020-12-03 18:16:11 +01:00
Markus F.X.J. Oberhumer 23fe02e84a Add GitHub Actions CI. 2020-12-03 13:58:38 +01:00
Markus F.X.J. Oberhumer 94e72238f2 Fix some warnings. 2020-12-03 03:10:12 +01:00
Markus F.X.J. Oberhumer 8f7ac520eb Run clang-format. 2020-12-03 02:15:14 +01:00
Markus F.X.J. Oberhumer bd193201b2 Avoid a clang-11 warning. 2020-12-03 02:14:47 +01:00
Markus F.X.J. Oberhumer 8ced672d24 docs: add a note about security considerations. 2020-12-03 02:10:05 +01:00
Markus F.X.J. Oberhumer f218812858 Fix spelling of some constants. 2020-12-03 01:46:30 +01:00
Markus F.X.J. Oberhumer 8a7b980fc0 Avoid a MSVC warning. 2020-12-03 01:44:09 +01:00
Markus F.X.J. Oberhumer 385c9877f8 Update submodules. 2020-12-03 01:27:05 +01:00
John Reiser 10df93536e Yet another attempt to suppress MSVC C4245
https://github.com/upx/upx/issues/435
	modified:   pefile.cpp
2020-11-29 00:01:22 -08:00
John Reiser 6cad27896f Another attempt to suppress MSVC C4245
https://github.com/upx/upx/issues/435
	modified:   pefile.cpp
2020-11-28 23:53:49 -08:00
John Reiser 052392d97b Attempt workaround for MSVC C4245 signed/unsigned mismatch in template 'argument'
https://github.com/upx/upx/issues/435
	modified:   pefile.cpp
2020-11-28 20:23:01 -08:00
John Reiser ce6b5a0688 Fix MSVC warning C4245: signed/unsigned mismatch in prototype matching
The type of the return value must match exactly the function prototype.
MSVC warning C4245: 'argument': conversion from 'int' to 'unsigned int', signed/unsigned mismatch
https://github.com/upx/upx/issues/435
	modified:   bele_policy.h
2020-11-28 19:45:54 -08:00
John Reiser 1879185e42 Check Mach_command.cmdsize
https://github.com/upx/upx/issues/426
Also use MemBuffer to avoid leaks that result from throw()
	modified:   p_mach.cpp
	modified:   p_mach.h
2020-11-28 10:56:28 -08:00
John Reiser a928a08f9d ptrTEXT in PackMachBase<T>::canUnpack()
https://github.com/upx/upx/issues/417
	modified:   p_mach.cpp
2020-11-06 19:14:18 -08:00
John Reiser 1805cb6857 headway vs size
https://github.com/upx/upx/issues/414
	modified:   packhead.cpp
2020-11-06 14:25:36 -08:00
Liam Murphy 6ce625b535 fix build 2020-11-05 22:21:19 +00:00
Liam Murphy 4702f12818 tweaks: some extra checks on lengths 2020-11-05 04:43:40 +00:00
Matthijs Lavrijsen 4f3054f07d PE: only add a TLS relocation if tls_handler_offset_reloc != 0 2020-09-08 11:44:56 +02:00
bitraid 0d7bd52e21 Only pack w/ -f PE files that force integrity check 2020-10-31 19:53:33 +02:00
John Reiser c3466f579c fillPackHeader: revise and add yet more checks
https://github.com/upx/upx/issues/414
https://github.com/upx/upx/pull/415  revised
	modified:   packhead.cpp
2020-11-06 13:53:29 -08:00
John Reiser 7c105d7af5 omemmove exactly as much
Fix 14992260c60b8d6677a677a9cdfae98b11353df7; revealed by testsuite
	modified:   pefile.cpp
2020-11-05 15:05:52 -08:00
John Reiser 924b229afb fillPackHeader more checks
https://github.com/upx/upx/issues/414
	modified:   packhead.cpp
2020-11-03 01:58:39 -08:00
John Reiser 890d66ecf0 Avoid overlap when rebuild relocs.
Based on a hint from a little bird.
	modified:   packer.cpp
2020-09-20 15:08:39 -07:00
John Reiser 143049922b Beware overlap when rebuildImports
Based on a hint from a little bird.
	modified:   pefile.cpp
2020-09-20 14:10:24 -07:00
John Reiser e6ccef2cf1 MSVC strikes again
modified:   p_lx_elf.cpp
2020-09-05 19:19:11 -07:00
John Reiser be61e9f584 Fix 64-bit ET_EXEC
https://github.com/upx/upx/issues/405
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2020-09-04 10:21:14 -07:00
Mattiwatti 89d0fda9fa Make PE load config directory address dword aligned 2020-01-21 16:03:40 +01:00
bitraid 6a85bab5da Don't pack Cotrol Flow Guard PE files 2020-07-28 17:36:13 +03:00
John Reiser c1a55b063e 0==e_shnum obviates testing of e_shoff
modified:   p_lx_elf.cpp
2020-07-26 20:00:05 -07:00
John Reiser 77c914bce5 Check de-compressed SHT_SYMTAB
https://github.com/upx/upx/issues/396
	modified:   p_lx_elf.cpp
2020-07-25 09:28:02 -07:00
John Reiser cc60f03b2e Check Shdr more
https://github.com/upx/upx/issues/395
	modified:   p_lx_elf.cpp
2020-07-25 08:19:45 -07:00
John Reiser cc9ccdbbd1 Check .sh_offset and .sh_size in SHT_DYNAMIC and SHT_STRNDX
https://github.com/upx/upx/issues/394
	modified:   p_lx_elf.cpp
2020-07-25 07:41:43 -07:00
John Reiser 9dfc8f573c Avoid 0==nbucket
https://github.com/upx/upx/issues/393
	modified:   p_lx_elf.cpp
2020-07-23 05:44:18 -07:00
John Reiser 4e2fdb464a Defend against bad PT_DYNAMIC
https://github.com/upx/upx/issues/391
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2020-07-23 05:09:52 -07:00
John Reiser 73b854874e Defend against junk PT_DYNAMIC
https://github.com/upx/upx/issues/390
	modified:   p_lx_elf.cpp
2020-07-23 04:14:34 -07:00
John Reiser 0016512df1 Unpack: Phdrs must be within expansion of first compressed block
https://github.com/upx/upx/issues/388
	modified:   p_lx_elf.cpp
2020-07-22 19:34:27 -07:00
John Reiser 527139978a DT_HASH chains might be trimmed (64-bit, too)
https://github.com/upx/upx/issues/383
	modified:   p_lx_elf.cpp
2020-06-08 12:37:53 -07:00
John Reiser 47bc68fa6b DT_HASH chains might be trimmed
https://github.com/upx/upx/issues/383
	modified:   p_lx_elf.cpp
2020-06-07 19:35:49 -07:00
John Reiser 972b670a64 Set .b_extra for hdr, especially for Mach-o for 'go'.
https://github.com/upx/upx/issues/222
	modified:   p_unix.cpp
2020-06-06 17:11:32 -07:00
John Reiser d7c416f243 More DPRINTF debugging
modified:   stub/src/amd64-darwin.macho-main.c
2020-06-06 17:10:53 -07:00
John Reiser 3ace7a0468 Documentation only
modified:   stub/src/amd64-darwin.macho-main.c
2020-06-06 15:32:45 -07:00
John Reiser d305023f5e Sync testsuite checksums for "ELF pageholes" feature
modified:   .github/travis_testsuite_1-expected_sha256sums.sh
2020-05-30 13:56:12 -07:00
John Reiser 963392a5ae De-compress (upx -d) for ELF pageholes
modified:   p_lx_elf.cpp
2020-05-30 13:54:11 -07:00
John Reiser 2f453acf5d use UPX_RSIZE_MAX_MEM
modified:   p_mach.cpp
2020-05-28 15:45:07 -07:00
John Reiser 4ae1576726 Mach-o LC_SEGMENTs not monotonic in file (__DWARF for 'go')
https://github.com/upx/upx/issues/222  go-1.14 (but not go-1.14.3 ?)
	modified:   ../p_mach.cpp
	modified:   ../p_mach.h
	modified:   ../p_unix.cpp
	modified:   ../p_unix.h
	modified:   ../stub/src/amd64-darwin.macho-main.c

	modified:   ../stub/amd64-darwin.macho-fold.h
	modified:   ../stub/arm.v5a-darwin.macho-fold.h
	modified:   ../stub/arm64-darwin.macho-fold.h
	modified:   ../stub/tmp/amd64-darwin.macho-fold.map
	modified:   ../stub/tmp/arm.v5a-darwin.macho-fold.map
	modified:   ../stub/tmp/arm64-darwin.macho-fold.map
2020-05-30 02:54:09 -07:00
bitraid 17bd0b3248 Don't use --strip-reloc with -d
Always restore the relocation section of Portable Executables on
unpacking, if it exists in the compressed image.
2020-04-13 21:38:22 +03:00
Markus F.X.J. Oberhumer a1ad1aee99 Use "python2" instead of "python". 2020-05-23 20:07:23 +02:00
John Reiser a817ed0692 uintptr_t for MSVC
modified:   p_lx_elf.cpp
2020-05-23 11:02:46 -07:00
John Reiser 828a6cf07b invert_pt_dynamic() more checking
https://github.com/upx/upx/issues/378
https://github.com/upx/upx/issues/379
	modified:   p_lx_elf.cpp
2020-05-23 10:51:03 -07:00
John Reiser 962c35aa08 More checking of DT_GNU_HASH and DT_HASH tables
https://github.com/upx/upx/issues/381
	modified:   p_lx_elf.cpp
2020-05-23 10:04:38 -07:00
John Reiser b327645e64 More checking of DT_GNU_HASH and DT_HASH tables
https://github.com/upx/upx/issues/380
	modified:   p_lx_elf.cpp
2020-05-23 09:41:41 -07:00
John Reiser e1b42616a2 workaround: MIPS.r3000 early uClibc forgot memset(,0,) of local array
ldso/ldso/ldso.c: _dl_get_ready_to_run()
    _dl_memset(app_tpnt, 0, sizeof(*app_tpnt));
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S

	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
2020-05-26 14:49:25 -07:00
John Reiser f96638c42a MIPS32 works: ELF layout for page holes
modified:   stub/src/include/linux.h
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S

	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/tmp/mips.r3000-linux.elf-entry.bin.dump
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-entry.bin.dump
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
2020-05-25 14:13:01 -07:00
John Reiser 6272152dfe phdr[C_BASE].p_memsz for ET_EXEC
modified:   p_lx_elf.cpp
2020-05-25 14:11:46 -07:00
John Reiser 030a200c08 clarity; no functional change
modified:   stub/src/powerpc-linux.elf-entry.S
2020-05-25 14:07:58 -07:00
John Reiser 994da63b4d DPRINTF the munmap
modified:   stub/src/i386-linux.elf-main.c
2020-05-25 14:05:58 -07:00
John Reiser 2315bff280 powerpc64 works: ELF layout for page holes
modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S

	modified:   stub/powerpc64-linux.elf-entry.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/powerpc64-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2020-05-23 11:18:32 -07:00
John Reiser 98dddf93d8 powerpc32 works: ELF layout for page holes
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S

	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2020-05-23 08:00:35 -07:00
John Reiser fd2939e18d i386 works: ELF layout for page holes
modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main.c

	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/include/linux.h
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2020-05-15 16:05:26 -07:00
John Reiser 80c27e0822 arm.v4a works: ELF layout for page holes
modified:   p_lx_elf.cpp
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S

	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   stub/tmp/mipsel.r3000-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2020-05-14 15:10:40 -07:00
John Reiser b463f24eda arm64 works: ELF layout for page holes
modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S

	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
2020-05-10 09:18:06 -07:00
John Reiser 2a849444db un-debug
modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2020-05-09 09:46:51 -07:00
John Reiser 69e106c0c5 unmap C_TEXT
modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2020-05-09 09:45:02 -07:00
John Reiser 926481dace ELF layout for page holes when runtime PAGE_SIZE < .p_align
amd64 works
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   Makefile
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.shlib-init.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/amd64-linux.shlib-init.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2020-05-09 08:05:05 -07:00
John Reiser a3b2cde58d max_bucket versus symbias
modified:   p_lx_elf.cpp
2020-04-17 17:09:47 -07:00
John Reiser 30f37d2cc6 DT_GNU_HASH check the buckets
https://github.com/upx/upx/issues/365
	modified:   p_lx_elf.cpp
2020-04-17 16:49:54 -07:00
John Reiser c4d61dd9fe --preserve-build-id for ET_EXEC
https://github.com/upx/upx/issues/371
	modified:   p_lx_elf.cpp
2020-04-17 16:17:29 -07:00
John Reiser 210870f840 invert_pt_dynamic() DT_GNU_HASH trims hash array for Rust and Android
https://github.com/upx/upx/issues/369
	modified:   p_lx_elf.cpp
2020-04-15 17:29:03 -07:00
John Reiser 4cb4bd38eb check_pt_dynamic() checks PT_DYNAMIC.p_memsz
https://github.com/upx/upx/issues/368
	modified:   p_lx_elf.cpp
2020-04-15 14:24:05 -07:00
John Reiser 58c6d19f7c unpack() checks PT_DYNAMIC.p_filesz
https://github.com/upx/upx/issues/367
	modified:   p_lx_elf.cpp
2020-04-15 14:12:06 -07:00
John Reiser f99ae94747 More checking .e_shstrndx
https://github.com/upx/upx/issues/366
	modified:   p_vmlinx.cpp
2020-04-15 13:44:35 -07:00
John Reiser 6868ca7953 getElfSections concentrates on _Shdr[.e_shstrndx]
https://github.com/upx/upx/issues/363
	modified:   p_vmlinx.cpp
2020-04-15 13:29:01 -07:00
John Reiser 87a5a4ef32 WIP but should concentrate on section .e_shstrndx instead.
modified:   p_vmlinx.cpp
2020-04-15 13:13:45 -07:00
John Reiser c67a5d677c More bounds checking for DT_INIT (etc.) in shlib
https://github.com/upx/upx/issues/364
	modified:   p_lx_elf.cpp
2020-04-13 17:08:49 -07:00
bitraid 1ce6f0e6f4 Fix unpacking of ASLR enabled PE files 2020-04-12 03:19:57 +03:00
John Reiser 740b4ff865 ELF shared lib: PT_DYNAMIC might be below xct_off, such as MIPS
https://github.com/upx/upx/issues/298
	modified:   p_lx_elf.cpp
2020-02-15 15:04:44 -08:00
John Reiser 1059f62566 MIPS stub mprotect() suffered from [non-]inlining.
https://github.com/upx/upx/issues/342
https://github.com/upx/upx/issues/339
	modified:   src/stub/src/include/linux.h
   consequences:
	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
	modified:   src/stub/mips.r3000-linux.elf-fold.h
	modified:   src/stub/mipsel.r3000-linux.elf-fold.h
	modified:   src/stub/tmp/mips.r3000-linux.elf-fold.map
	modified:   src/stub/tmp/mipsel.r3000-linux.elf-fold.map
2020-02-08 19:55:08 -08:00
Markus F.X.J. Oberhumer df3193c1ee Use new ASCII art logo. 2020-01-23 00:21:44 +01:00
Jonas Zeitler 67860e3704 fix kerning on ascii art logo 2019-01-11 17:22:56 +01:00
Markus F.X.J. Oberhumer 35fbb1ecb6 Update testsuite checksums caused by version bump. 2020-01-22 23:26:41 +01:00
Markus F.X.J. Oberhumer c63a71ad42 Prepare for switch to semantic versioning. 2020-01-22 23:24:00 +01:00
Markus F.X.J. Oberhumer f33645f739 Post-release version bump. 2020-01-22 23:11:13 +01:00
Markus F.X.J. Oberhumer d7ba31cab8 Bump release date. 2020-01-22 22:29:58 +01:00
John Reiser 342b1b7d6c EM_PPC64 forgot get_te16(&...) for ehdri.e_machine
So compression on big-endian host was not correct.
https://github.com/upx/upx/issues/334
	modified:   p_lx_elf.cpp
2020-01-19 18:48:50 -08:00
John Reiser 936013f60c Decompression escape hatch for ELF can require a new page.
If not enough room on last page of .text, and ElfXX_Ehdr not PF_X,
then the escape hatch must use a new page.
https://github.com/upx/upx/issues/308
	modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
    Plus stub/*-linux.elf-fold.h and stub/tmp/*-linux.elf-fold.map
2020-01-19 13:25:55 -08:00
Markus F.X.J. Oberhumer fdf2eddc73 Update Travis. 2020-01-16 13:38:30 +01:00
Markus F.X.J. Oberhumer 4409753014 Update Travis. 2020-01-16 01:54:41 +01:00
Markus F.X.J. Oberhumer 9172ae3d19 New ACC version. 2020-01-16 01:53:55 +01:00
John Reiser e2f60adc95 Detect 0==DT_SYMTAB in invert_pt_dynamic()
https://github.com/upx/upx/issues/333
	modified:   p_lx_elf.cpp
2020-01-14 18:45:52 -08:00
John Reiser 1bb93d4fce Detect bad e_shstrtab better.
https://github.com/upx/upx/issues/332
	modified:   p_lx_elf.cpp
2020-01-13 17:26:31 -08:00
John Reiser eb90eab632 Detect bogus DT_SYMENT.
https://github.com/upx/upx/issues/331
	modified:   p_lx_elf.cpp
2020-01-13 17:10:02 -08:00
Markus F.X.J. Oberhumer 0f4975fd7f Update Travis. 2020-01-08 17:30:03 +01:00
Markus F.X.J. Oberhumer b5b1f06a11 Avoid some compilation warnings. 2020-01-08 06:04:21 +01:00
Markus F.X.J. Oberhumer 86f8eb0930 Fix shadowing global symbols. 2020-01-08 05:44:06 +01:00
Markus F.X.J. Oberhumer 91ad0e7572 Revert "Cleanup legacy symbols: basename, index"
This reverts commit 47ddace96a.
2020-01-08 05:41:56 +01:00
Markus F.X.J. Oberhumer b034ee98fe Revert "Mention --assume-execute-permission"
This reverts commit 29fa358077.
2020-01-08 05:40:40 +01:00
Markus F.X.J. Oberhumer ded07f8781 Revert "MSVC lacks S_IXUSR"
This reverts commit 62a07df45e.
2020-01-08 05:38:44 +01:00
Markus F.X.J. Oberhumer 849bdd87e1 Revert "Option --assume-execute-permission"
This reverts commit 4484acf9d6.
2020-01-08 05:38:19 +01:00
Markus F.X.J. Oberhumer 643e48efd7 Update Travis. 2020-01-08 05:18:43 +01:00
Markus F.X.J. Oberhumer 92f072cf70 Silence some compiler warnings. 2020-01-08 04:49:27 +01:00
Markus F.X.J. Oberhumer 95bf2e2e41 Update testsuite checksums caused by version date bump. 2020-01-08 04:37:59 +01:00
Markus F.X.J. Oberhumer 6a6c6d84eb Rebuild stubs. 2020-01-08 04:30:08 +01:00
Markus F.X.J. Oberhumer 08a689c81e Bump tentative release date. 2020-01-08 04:21:30 +01:00
Markus F.X.J. Oberhumer d1174385ef Welcome 2020. 2020-01-08 04:13:28 +01:00
John Reiser cb5f590e10 More hacking Android shlib.
https://github.com/upx/upx/issues/318
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2019-12-12 20:23:33 -08:00
John Reiser 5ed9c66ed9 Hack Android shared libraries on arm64.
https://github.com/upx/upx/issues/318
	modified:   p_lx_elf.cpp
2019-12-12 17:05:50 -08:00
John Reiser b8f52d14f4 user_init_va on AARCH64
https://github.com/upx/upx/issues/318  (work-in-progress)
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2019-12-04 14:26:46 -08:00
John Reiser 5d295c24f0 DT_NEEDED can be duplicated
modified:   p_lx_elf.cpp
2019-11-26 19:33:27 -08:00
John Reiser 8be9da8280 Avoid bogus values in PT_DYNAMIC segment.
Detect duplicate DT_*.
Detect out-of-bounds hashtab and gashtab.
Detect missing DT_REL, DT_RELA.
Detect out-of-bounds d_val.
https://github.com/upx/upx/issues/317
	modified:   p_lx_elf.cpp
2019-11-23 20:06:14 -08:00
John Reiser 819c33fee2 Detect malformed Mach-o file in ::canUnpack()
https://github.com/upx/upx/issues/314
https://github.com/upx/upx/issues/315
	modified:   p_mach.cpp
2019-11-15 21:32:06 -08:00
John Reiser 75a2cc4ecb Sync testsuite (amd64, 32-bit ARM, 64-bit ARM)
modified:   ../.github/travis_testsuite_1-expected_sha256sums.sh
	modified:   Makefile
2019-10-27 21:56:30 -07:00
John Reiser e2833cf303 Message when /proc/self/exe lacks Read permission
Done: amd64, 32-bit ARM, 64-bit ARM.  TODO: mips, PowerpC
https://github.com/upx/upx/issues/302
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
2019-10-27 21:30:41 -07:00
John Reiser 801de73dbe random assembler?
modified:   ../stub/arm64-linux.elf-entry.h
2019-10-27 21:15:15 -07:00
John Reiser 6a53c0b3d4 [Append to previous commit message.]
https://github.com/upx/upx/issues/286
	modified:   p_vmlinx.cpp
2019-07-21 10:51:59 -07:00
John Reiser 58b122d97d Better checking for malformed input
https://github.com/upx/upx/issues
	modified:   p_vmlinx.cpp
2019-07-21 10:48:50 -07:00
John Reiser 276b748aa6 Ignore malformed ElfXX_Shdr in search for .text or .note
https://github.com/upx/upx/issues/287
	modified:   p_vmlinx.cpp
2019-07-21 07:40:21 -07:00
John Reiser 23570097cf MSVC barfs on {unsigned == long int) [because sizeof() is the same!]
https://github.com/upx/upx/issues/283
	modified:   p_lx_elf.cpp
2019-07-14 13:39:09 -07:00
John Reiser 62a07df45e MSVC lacks S_IXUSR
modified:   p_unix.cpp
2019-07-14 13:38:51 -07:00
John Reiser 593a69ce25 PT_LOAD[0] with ElfXX.Ehdr only
https://github.com/upx/upx/issues/283
	modified:   p_lx_elf.cpp
2019-07-14 13:08:56 -07:00
John Reiser c33603e324 'bound' register was clobbered
modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
2019-07-14 13:05:52 -07:00
John Reiser 29fa358077 Mention --assume-execute-permission
for MSYS2 and other permission-poor OS.
	modified:   NEWS
2019-05-10 07:03:51 -07:00
John Reiser 49766388bc Fix compression and de-compression of Android shared libraries
Handle relocation (and DT_INIT_ARRAY[0]==NULL) when !DT_INIT.
Warn about missing --android-shlib if (ET_DYN && !DF_1_PIE && Arm*).
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
https://github.com/upx/upx/issues/265
https://github.com/upx/upx/issues/262
https://github.com/upx/upx/issues/259
https://github.com/upx/upx/issues/243
https://github.com/upx/upx/issues/229
https://github.com/upx/upx/issues/220
2019-04-14 19:59:08 -07:00
John Reiser f23267bddd Fix rotate+lop of PT_INTERP in shared library
Found while working on https://github.com/upx/upx/issues/262
but probably does not help that bug.
	modified:   p_lx_elf.cpp
2019-04-01 21:35:53 -07:00
John Reiser 4484acf9d6 Option --assume-execute-permission
modified:   main.cpp
	modified:   options.h
	modified:   p_unix.cpp
https://github.com/upx/upx/issues/256
2019-03-31 10:25:06 -07:00
John Reiser 47ddace96a Cleanup legacy symbols: basename, index
modified:   conf.h
https://github.com/upx/upx/issues/257
2019-03-31 10:12:41 -07:00
John Reiser 8aadbcd786 Enable standalone compiling, to investigate size of compiled code
modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
2019-03-03 14:27:33 -08:00
John Reiser 517bc9db0b PR_SET_MM (previous commit had typo) is from 7 years ago: 2012
modified:   stub/src/include/linux.h
2019-03-03 14:26:20 -08:00
John Reiser 16bfa7b846 PT_SET_MM since 2012
modified:   stub/src/include/linux.h
2019-03-02 16:12:14 -08:00
John Reiser 570b2d0e88 arm64-linux.elf changed when PT_LOAD[1] no longer forces 4KB alignment
modified:   travis_testsuite_1-expected_sha256sums.sh
2019-03-02 16:10:37 -08:00
John Reiser 2653a0749a de-tabify
modified:   stub/src/arch/i386/bxx.S
2019-03-02 15:48:44 -08:00
John Reiser 3de0008543 i386-darwin.macho re-implementation, especially for MacOS <= 10.8.x (Mountain Lion)
[i386 will not be supported by new MacOS beginning fall 2019.]
https://github.com/upx/upx/issues/246
	modified:   p_mach.cpp
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-darwin.macho-fold.h
	modified:   stub/i386-darwin.macho-upxmain.exe
	modified:   stub/i386-darwin.macho-upxmain.h
	new file:   stub/src/arch/i386/bxx.S
	new file:   stub/src/arch/i386/nrv2b_d32-easy.S
	new file:   stub/src/arch/i386/nrv2d_d32-easy.S
	new file:   stub/src/arch/i386/nrv2e_d32-easy.S
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/i386-darwin.macho-fold.S
	modified:   stub/src/i386-darwin.macho-main.c
	modified:   stub/src/i386-darwin.macho-upxmain.c
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/i386-darwin.macho-fold.map
2019-03-02 15:39:30 -08:00
John Reiser d4e2d7e8a8 arm64 (aarch64) and PAGE_SIZE > 4KiB
Future: use prctl(PR_SET_MM, PR_SET_MM_START_BRK, addr)
https://github.com/upx/upx/issues/254
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
2019-03-01 20:31:41 -08:00
John Reiser a9c08c6f52 __MSYS2__ acts like UNIX but cannot handle --x permission
https://github.com/upx/upx/issues/256
	modified:   p_unix.cpp
2019-03-01 16:46:49 -08:00
Markus F.X.J. Oberhumer c2aa5c35f7 Silence a gcc-4.6 compiler warning. 2019-02-25 13:41:54 +01:00
John Reiser 423f1a8758 pack4() "__TEXT".nsects can differ from prototype to actual
modified:   p_mach.cpp
2019-02-18 14:41:43 -08:00
Markus F.X.J. Oberhumer cc5f684e33 Update testsuite checksums caused by version date bump. 2019-02-15 11:14:18 +01:00
Markus F.X.J. Oberhumer b6646d319a Bump tentative release date. 2019-02-15 11:12:07 +01:00
Markus F.X.J. Oberhumer 3667fa4e44 Welcome 2019. 2019-02-15 11:04:09 +01:00
John Reiser d1c80154f6 SHT_NOTE with ~SHF_ALLOC; as for 'gold' linker version
https://github.com/upx/upx/issues/243
	modified:   p_lx_elf.cpp
2019-02-12 21:13:24 -08:00
John Reiser 3c2bfc742e g++ -Wsign-compare is not as picky as MSVC warning C4018: '<': signed/unsigned mismatch
https://github.com/upx/upx/issues/247
	modified:   p_lx_elf.cpp
2019-02-09 08:04:58 -08:00
John Reiser d60fef753f check_pt_load(); u32_t, u64_t; (off_t) is not unsigned!
https://github.com/upx/upx/issues/247
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2019-02-01 19:31:57 -08:00
John Reiser 70ed2d0d03 Allow Load Configuration directory > 256, with info().
https://github.com/upx/upx/issues/245
	modified:   pefile.cpp
2019-01-26 07:51:16 -08:00
John Reiser 716d203a78 Testsuite checksums
amd64-linux.elf
commit 6b500bc83b
Date:   Wed Aug 22 14:39:14 2018 -0700

arm-linux.elf, armeb-linux.elf:
commit 75c31dff1d
Date:   Thu Dec 13 20:10:57 2018 -0800

	modified:   .github/travis_testsuite_1-expected_sha256sums.sh
2018-12-31 11:08:53 -08:00
John Reiser 9719a7dd56 MSVC pettiness
https://github.com/upx/upx/issues/238
	modified:   p_lx_elf.cpp
2018-12-26 18:38:30 -08:00
John Reiser c097233bf3 Stronger checks for DT_HASH, DT_GNU_HASH
https://github.com/upx/upx/issues/238
	modified:   p_lx_elf.cpp
2018-12-26 13:00:20 -08:00
John Reiser 69a583281f MemBuffer::subref() for 64-bit offsets; better diagnosis for bad .e_shoff
https://github.com/upx/upx/issues/235 (POC14)
	modified:   mem.cpp
	modified:   mem.h
	modified:   p_lx_elf.cpp
2018-12-16 16:00:15 -08:00
John Reiser 8e90c9af2b Corner cases for e_shnum vs e_shstrndx
modified:   p_lx_elf.cpp
2018-12-16 15:36:51 -08:00
John Reiser a784284b7f Check user_init_off. Also remove '\n' from error messages.
https://github.com/upx/upx/issues/235  POC11
	modified:   p_lx_elf.cpp
2018-12-16 12:14:22 -08:00
John Reiser 0509edf08d ElfXX_Sym.st_name is always 32 bits
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-12-16 11:32:58 -08:00
John Reiser 7ca20f424f Typos
modified:   p_lx_elf.cpp
2018-12-15 21:17:26 -08:00
John Reiser b74d51c2a8 More checking of e_shstrndx
https://github.com/upx/upx/issues/235  POC6
	modified:   p_lx_elf.cpp
2018-12-15 21:12:15 -08:00
John Reiser 58061cd121 Check .p_offset
https://github.com/upx/upx/issues/235  POC13
	modified:   p_lx_elf.cpp
2018-12-15 20:59:45 -08:00
John Reiser b8f6be5389 More checking of DT_HASH and DT_GNU_HASH
https://github.com/upx/upx/issues/235  POC12
	modified:   p_lx_elf.cpp
2018-12-15 20:43:33 -08:00
John Reiser 7c766b3313 Check e_shstrndx and Shdr.st_name
https://github.com/upx/upx/issues/235  POC10
	modified:   p_lx_elf.cpp
2018-12-15 20:27:20 -08:00
John Reiser 91b81b587b Abandon when outrageous Elf64_Dyn.d_tag
https://github.com/upx/upx/issues/235  POC8
	modified:   p_lx_elf.cpp
2018-12-15 19:35:13 -08:00
John Reiser 780a4347b8 Check DT_HASH and DT_GNU_HASH.
https://github.com/upx/upx/issues/235  POC2,POC4
Also cleanup checking of symbol number and .st_name
in POC1,POC3,POC5,POC7,POC9,POC11
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-12-15 19:16:14 -08:00
John Reiser 606ad08dd1 Check symbol number and .st_name
https://github.com/upx/upx/issues/235  POC1,POC3,POC7,POC9
	modified:   p_elf_enum.h
	modified:   p_lx_elf.h
	modified:   p_lx_elf.cpp
2018-12-14 21:32:49 -08:00
John Reiser 75c31dff1d Use THUMB 'ret' when in THUMB mode.
https://github.com/upx/upx/issues/236
https://github.com/upx/upx/issues/229
	modified:   src/arm.v4t-linux.shlib-init.S

	modified:   arm.v5t-linux.shlib-init.h
	modified:   tmp/arm.v5t-linux.shlib-init.bin.dump
2018-12-13 20:14:14 -08:00
John Reiser 473b90419f Mach-o for 'rust' has intermixed LC_SEGMENT64 "__DWARF" with 0==.vmsize
https://github.com/upx/upx/issues/222
	modified:   p_mach.cpp
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	also *-darwin.macho-fold.{h,map}
2018-10-13 21:06:37 -07:00
John Reiser f88b85e126 MSVC error C4146: unary minus operator applied to unsigned type, result still unsigned
modified:   p_lx_elf.cpp
2018-10-09 20:27:19 -07:00
John Reiser b122f8e9d0 Optimize /proc/self/exe. Sync stubs.
See also commit 78b1da5c00 earlier today
for https://github.com/upx/upx/issues/225 .
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	also *.h, *.map, *.bin.dump
2018-10-09 20:11:34 -07:00
John Reiser cb8b1595a1 Pay more attention to 0==.e_shnum
modified:   p_lx_elf.cpp
2018-10-09 19:38:43 -07:00
John Reiser 1bee919276 cosmetic: developer quality-of-life
modified:   packer.cpp
2018-10-09 19:35:03 -07:00
John Reiser 78b1da5c00 Avoid dcache==>icache trouble with mflg_data; heuristic cache_flush for 32-bit ARM
modified:   arm.v4a-linux.elf-entry.S
	modified:   arm.v4a-linux.elf-fold.S
2018-10-09 19:24:50 -07:00
John Reiser bb8239ccda more DPRINTF
modified:   amd64-linux.elf-main.c
2018-10-09 19:23:06 -07:00
John Reiser 2a594ad0a7 Better return value when de-compression method mismatches.
modified:   arch/amd64/lzma_d.S
	modified:   arch/amd64/nrv2b_d.S
	modified:   arch/amd64/nrv2d_d.S
	modified:   arch/amd64/nrv2e_d.S
2018-10-07 10:15:48 -07:00
John Reiser b05073550c "pop %rcx", not %ecx
modified:   amd64-darwin.macho-entry.S
	modified:   amd64-linux.elf-entry.S
2018-10-07 10:11:45 -07:00
John Reiser 37d6a34e58 MSVC is a nimrod. (All verions 10.0 through 14.1)
"(4074): error C4146: unary minus operator applied to unsigned type, result still unsigned"
So what?  Many programmers are much better than the typical Microsoft coder.
The C standard GUARANTEES that unsigned arithmetic uses two's complement,
ignores overflow, and the result is what the hardware adder produces.
	modified:   p_lx_elf.cpp
2018-09-23 20:45:07 -07:00
John Reiser 4f0cba9bb6 /proc/self/exe mapping had wrong offset in stub for 32-bit ARM
https://github.com/upx/upx/issues/221
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	also arm*.*-linux.elf-*.{h,map}
2018-09-23 20:32:37 -07:00
John Reiser 4d1c754af9 Preserve Mach_segment_header.flags; fix non-PIE main programs on MacOS.
https://github.com/upx/upx/issues/222
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	also *.macho-*.h, *.macho-fold.map, amd64-darwin.macho-entry.bin.dump
2018-09-22 18:50:37 -07:00
John Reiser c1cfde21d7 Map when .vmsize (not .filesize). More debugging DPRINTF;
modified:   stub/src/amd64-darwin.macho-main.c
	also *.macho-fold.h, *.macho-fold.map
2018-09-22 13:06:45 -07:00
John Reiser bb1f9cdecd Propagate pagezero_vmsize; fix overlay_offset.
modified:   p_mach.cpp
2018-09-22 12:11:51 -07:00
John Reiser b259b0ca28 Print failed syscalls to stderr
modified:   stub/src/amd64-darwin.macho-fold.S
2018-09-22 12:09:22 -07:00
John Reiser 0051dfc84f --android-shlib: Relocate ABS _edata etc.
https://github.com/upx/upx/issues/220
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-09-16 15:10:40 -07:00
John Reiser 9f294e6ce5 Fix "upx -d" de-compression when input is compressed Android shlib.
https://github.com/upx/upx/issues/220
	modified:   p_lx_elf.cpp
2018-09-16 13:09:43 -07:00
John Reiser 153ea8be03 MSVC signed/unsigned
modified:   p_mach.cpp
2018-09-11 21:13:27 -07:00
John Reiser f3f7f97f8d MSVC signed/unsigned
modified:   p_mach.cpp
2018-09-09 15:58:24 -07:00
John Reiser 9bb6854e64 Fix stub for MacOS El Capitan, which has "pre-linked" /usr/bin/dyld
https://github.com/upx/upx/issues/218
https://github.com/Homebrew/homebrew-core/pull/31846
	modified:   src/amd64-darwin.macho-main.c
	    also *-darwin.mach-fold.{h,map}
2018-09-09 15:37:54 -07:00
John Reiser 4bba1e6cb7 Merge branch 'devel' of https://github.com/upx/upx into devel 2018-09-08 11:43:41 -07:00
John Reiser 597e8fe407 Fix de-compression for Mach-O files (MacOS)
https://github.com/upx/upx/issues/219
	modified:   p_mach.cpp
	modified:   p_mach.h
2018-09-08 11:41:38 -07:00
Markus F.X.J. Oberhumer 556c541ffb Sync with latest upx-testsuite changes. 2018-09-06 13:57:15 +02:00
John Reiser 5963f18f7c Merge branch 'devel' of https://github.com/upx/upx into devel 2018-09-04 20:54:21 -07:00
John Reiser 0dac6b7be3 MacOS de-compression (upx -d)
https://github.com/upx/upx/issues/218
	modified:   p_mach.cpp
2018-09-04 20:52:17 -07:00
Markus F.X.J. Oberhumer 296ede780b Update Travis. 2018-08-29 15:13:46 +02:00
Markus F.X.J. Oberhumer faaa19331a Update Travis. 2018-08-27 16:43:21 +02:00
Markus F.X.J. Oberhumer 88cb5886f3 Update Travis. 2018-08-26 06:42:46 +02:00
Markus F.X.J. Oberhumer 2fcc3f86c0 Introduce environment variable UPX_DISABLE_GITREV_WARNING. 2018-08-26 06:29:58 +02:00
Markus F.X.J. Oberhumer 9362fde9eb Update testsuite checksums caused by version bump. 2018-08-26 06:15:54 +02:00
Markus F.X.J. Oberhumer 56f4d781c1 Post-release version bump. 2018-08-26 06:08:40 +02:00
Markus F.X.J. Oberhumer 7a3637ff5a Update NEWS. 2018-08-26 04:58:09 +02:00
John Reiser 2923c0968e Merge branch 'devel' of https://github.com/upx/upx into devel
Fix Conflicts:
	.github/travis_testsuite_1.sh
2018-08-22 14:58:36 -07:00
John Reiser 98cfe99d65 sync testsuite
modified:   .github/travis_testsuite_1.sh
2018-08-22 14:52:00 -07:00
John Reiser bdd97fe0b2 build stubs
modified:   amd64-linux.elf-fold.h
	modified:   arm64-linux.elf-fold.h
	modified:   i386-bsd.elf-fold.h
	modified:   i386-linux.elf.interp-fold.h
	modified:   i386-netbsd.elf-fold.h
	modified:   i386-openbsd.elf-fold.h
	modified:   powerpc64-linux.elf-fold.h
	modified:   powerpc64le-linux.elf-fold.h
	modified:   tmp/amd64-linux.elf-fold.map
	modified:   tmp/arm64-linux.elf-fold.map
	modified:   tmp/i386-bsd.elf-fold.map
	modified:   tmp/i386-linux.elf.interp-fold.map
	modified:   tmp/i386-netbsd.elf-fold.map
	modified:   tmp/i386-openbsd.elf-fold.map
	modified:   tmp/powerpc64-linux.elf-fold.map
	modified:   tmp/powerpc64le-linux.elf-fold.map
2018-08-22 14:48:15 -07:00
John Reiser 6b500bc83b auxv_up() quit at AT_NULL, especially when AT_BASE has been omitted.
Based on contribution from Brian Geffon 'bgaff'
https://github.com/upx/upx/pull/215 ; bgaff
	modified:   amd64-linux.elf-main.c
	modified:   i386-bsd.elf-main.c
	modified:   i386-linux.elf.interp-main.c
	modified:   i386-openbsd.elf-main.c
2018-08-22 14:39:14 -07:00
Markus F.X.J. Oberhumer 92a12a2ec1 Update testsuite checksums caused by version date bump. 2018-08-22 13:16:39 +02:00
Markus F.X.J. Oberhumer 04d79040f9 Bump tentative release date. 2018-08-22 13:15:50 +02:00
Markus F.X.J. Oberhumer 3201ddc680 Update .editorconfig. 2018-08-22 13:06:39 +02:00
Markus F.X.J. Oberhumer 2f06de54c5 Cosmetic update. 2018-08-22 12:43:23 +02:00
John Reiser 6489ec9bba Fix PT_LOAD for ELF shared library.
modified:   p_lx_elf.cpp
2018-08-20 19:36:27 -07:00
John Reiser 1a5ba22fe7 Highlight changes for upx-3.95.
modified:   NEWS
2018-08-20 17:10:00 -07:00
John Reiser 8f9713ed53 Appease MSVC warning C4018: s/igned/unsigned mismatch
modified:   p_lx_elf.cpp
2018-08-13 18:47:42 -07:00
John Reiser 90eb68b3b9 Adapt to 4 PT_LOAD in binutils-2.31 and gcc-8.2.1 (Fedora 29)
0:        PF_R: .gnu.hash .dynsym .dynstr
1: PF_X | PF_R: .plt .plt.sec .text
2:        PF_R: .rodata .hash
3: PF_W | PF_R: .data.rel.ro .dynamic .got .got.plt .data .bss
	modified:   p_lx_elf.cpp

https://github.com/upx/upx/issues/212 (partial, Fedora 29)
2018-08-13 17:36:56 -07:00
John Reiser 95fcbcb4f2 ::PackLinuxElf64amd() sets lg2_page back to 12.
https://github.com/upx/upx/issues/212 (partial, Fedora 29)
	modified:   p_lx_elf.cpp
2018-08-10 20:28:40 -07:00
John Reiser b97688d119 Stub updates AT_PHDR for 32-bit libmusl, particularly -fPIE
https://github.com/upx/upx/issues/200
	modified:   stub/src/i386-linux.elf-main.c
	  also *.elf-fold.h, *.elf-fold.map for arm, armeb, i386, mips, mipsel, powerpc
	modified:   ../.github/travis_testsuite_1.sh
2018-08-04 18:26:02 -07:00
John Reiser 5ea3627cab --android-shlib, --force-pie
modified:   NEWS
2018-05-19 06:30:23 -07:00
John Reiser d9288213ec More checking of PT_DYNAMIC and its contents.
https://github.com/upx/upx/issues/206
	modified:   p_lx_elf.cpp
2018-05-17 21:48:26 -07:00
John Reiser 614c86fb7d --force-pie inhibits treating as shared library (for 'rust', etc.)
https://github.com/upx/upx/issues/200
	modified:   main.cpp
	modified:   options.h
	modified:   p_lx_elf.cpp
2018-04-26 13:44:17 -07:00
John Reiser 9f651ee40f Ignore ElfXX_Shdr if not CMD_COMPRESS; beware unpack when PT_DYNAMIC in other PT_LOAD
https://github.com/upx/upx/issues/200
	modified:   p_lx_elf.cpp
2018-04-26 08:34:58 -07:00
John Reiser 774c8c3fd4 Fix forgotten get_teXX() in canPack() and invert_pt_dynamic()
https://github.com/upx/upx/issues/200
	modified:   p_lx_elf.cpp
2018-04-25 23:05:17 -07:00
John Reiser b711d2f750 TLS callbacks: one entry only
https://github.com/upx/upx/issues/186  [partial, incomplete]
(Laszlo hints there is more, but meanwhile this does fix some.)
	modified:   pefile.cpp
2018-04-06 13:44:24 -07:00
John Reiser 8a793d5942 ELF shlib when no DT_INIT (especially --android-shlib)
https://github.com/upx/upx/issues/191
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-04-04 09:15:18 -07:00
John Reiser 99f52c60ed Merge branch 'Mattiwatti-offset-to-rva-fix' into devel
https://github.com/upx/upx/pull/193
2018-04-02 09:08:57 -07:00
Mattiwatti 2c2e108301 PE: fix comparison against a constant value
... due to size always being assigned to right before this comparison,
and instead check against the RVA and size of the export directory
from the header. (note: this is still stricter than the Windows loader
which ignores all of these except the directory RVA, but if the name RVA
is invalid the PE was probably tampered with).
Change 'offset' to 'RVA' in exception message; this field is always an RVA

  Author:    Mattiwatti <mattiwatti@gmail.com>
	modified:   pefile.cpp
2018-04-02 09:07:29 -07:00
John Reiser 563165e6ae Defensive patches from hints by Sean Williams <rootkit@google.com>
modified:   pefile.cpp
2018-03-29 16:55:21 -07:00
John Reiser f1a31b4793 ELf32::unpack; Elf64 parity with Elf32 for shlib with no DT_INIT
https://github.com/upx/upx/issues/191  [partial, not finished]
	modified:   p_lx_elf.cpp
2018-03-27 19:15:47 -07:00
John Reiser 5e9b6bd69d more ELF shlib when no DT_INIT (especially Android): hook DT_INIT_ARRAY[0]
https://github.com/upx/upx/issues/191  [partial, not finished]
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
2018-03-26 16:30:52 -07:00
John Reiser 9b990c4eae clarity
modified:   p_lx_elf.cpp
2018-03-24 13:52:29 -07:00
John Reiser 7a625a449a ELF shlib without DT_INIT: steal a DT_NULL from PT_DYNAMIC
https://github.com/upx/upx/issues/191  [partial, not finished]
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-03-24 09:41:58 -07:00
John Reiser c2b62359d5 arm32 stubs on linux: allow 0==user_DT_INIT as nop; somewhat expensive
modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/tmp/arm.v5a-linux.shlib-init.bin.dump
	modified:   stub/tmp/arm.v5t-linux.shlib-init.bin.dump
2018-03-24 08:55:04 -07:00
John Reiser 6722e8972e cleanup dead variables: is_big, all_pages
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-03-23 08:06:31 -07:00
John Reiser fefe7a3452 Fix segTEXT.vmsize and data for entry to shlib.
https://github.com/upx/upx/issues/57
	modified:   p_mach.cpp
2018-03-19 14:59:20 -07:00
John Reiser 90a1322929 Also check for wrap-around when checking oversize involving e_shoff and e_shnum.
raised by https://github.com/upx/upx/pull/190
	modified:   p_lx_elf.cpp
2018-03-15 21:25:20 -07:00
John Reiser d698eb69e2 Fix decompression stub for arm64 --lzma
https://github.com/upx/upx/issues/181
	modified:   stub/src/arch/arm64/v8/lzma_d.S
2018-02-24 13:04:15 -08:00
John Reiser 0ef00e9b82 Fix --lzma (and so --ultra-brute) for 32-bit ARM
https://github.com/upx/upx/issues/167  (comment #14)
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   ../.github/travis_testsuite_1.sh
2018-02-03 15:44:00 -08:00
John Reiser 95cedb6640 upgrade ::unpack for --android-shlib
modified:   p_elf_enum.h
    	modified:   p_lx_elf.cpp
    	modified:   p_lx_elf.h
    	modified:   stub/src/arm64-linux.shlib-init.S
    	modified:   stub/src/arm.v4t-linux.shlib-init.S
2018-02-02 14:50:56 -08:00
John Reiser d736da4208 Elf32, not shared lib: leave alone the hole between .text and .data
In theory Linux might put pages there (and that would be a problem),
but postpone closing the gap until more experience.
	modified:   p_lx_elf.cpp
2018-01-28 13:30:10 -08:00
John Reiser be83788666 --android-shlib for 32-bit ARM
Includes better handling of asl_delta in execution stub.

    	modified:   p_lx_elf.cpp
    	modified:   p_lx_elf.h
    	modified:   stub/src/arm.v4t-linux.shlib-init.S
    	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-27 22:00:16 -08:00
John Reiser 5a28a51abc android shlib: better handling of asl_delta in execution stub
modified:   p_lx_elf.cpp
    	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-26 12:35:06 -08:00
John Reiser 8a84df752c Compiler nit: ptr->ENUM is not always considered a constant
modified:   p_lx_elf.cpp
2018-01-26 11:54:33 -08:00
John Reiser 85f53b210d de-compression of arm64 --android-shlib
modified:   src/p_lx_elf.cpp
	modified:   src/p_lx_elf.h
	modified:   src/stub/src/arm64-linux.shlib-init.S
2018-01-24 15:39:46 -08:00
John Reiser 5d13c6cd01 elfout is unset for shlib in PackLinuxElf64::updateLoader
modified:   p_lx_elf.cpp
2018-01-22 16:15:53 -08:00
John Reiser 98a0d381e9 Merge branch 'devel' into jreiser-android
modified:   p_lx_elf.cpp
2018-01-22 13:55:45 -08:00
John Reiser e1d20fd0b5 Fix wobble in PackLinuxElf64::pack2
modified:   p_lx_elf.cpp
2018-01-22 13:48:26 -08:00
John Reiser d1035ecd8f Fix PLT for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-22 13:05:18 -08:00
John Reiser 0e651facdd Fix PLT for --android-shlib
NYI: unpack of PLT, DT_INIT etc.  Also e_entry.
	modified:   p_lx_elf.cpp
2018-01-22 13:01:20 -08:00
John Reiser 9fdddfc332 work in progress: de-compression of --android-shlib
OK except for asl_delta not removed from DT_INIT, DT_INIT_ARRAY,
DT_FINI_ARRAY, DT_PREINIT_ARRAY
	modified:   ../p_lx_elf.cpp
2018-01-21 18:59:21 -08:00
John Reiser 7d2913709c MemBuffer lowmem; for shlib, especially android
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-21 14:03:52 -08:00
John Reiser 3623199e8d Merge branch 'devel' into jreiser-android 2018-01-21 10:55:56 -08:00
John Reiser e4b23f7a47 Merge branch 'devel' of https://github.com/upx/upx into devel 2018-01-21 10:30:42 -08:00
John Reiser f056ecdcd5 pefile: Allow overlap of MZ header and PE header (h.nexepos==0x10)
https://github.com/upx/upx/issues/169
This means .codebase is aliased to .nexepos, with both equal to 0x10.
	modified:   pefile.cpp
2018-01-21 10:29:17 -08:00
John Reiser 857a03a074 fix sh_offset for new Shdr[e_shstrndx]
modified:   p_lx_elf.cpp
2018-01-20 16:41:32 -08:00
John Reiser a34deee4f5 work in progress for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-20 16:34:52 -08:00
John Reiser fc9c8ae482 fix updating of DT_INIT
modified:   p_lx_elf.cpp
2018-01-20 09:48:28 -08:00
John Reiser 08c63f06eb p_lx_elf.h: phdro for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-19 22:01:56 -08:00
John Reiser bbff510ef1 Merge branch 'devel' into jreiser-android
Conflicts:
	src/p_lx_elf.cpp
	src/p_lx_elf.h

	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_exe.cpp
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   pefile.cpp
2018-01-19 21:51:49 -08:00
Markus F.X.J. Oberhumer f747435952 For consistency, add missing "virtual". 2018-01-19 20:21:18 +01:00
Markus F.X.J. Oberhumer e6edad8f46 Clean up OptVar handling. 2018-01-19 19:50:28 +01:00
Markus F.X.J. Oberhumer 05e44b9644 Fix powerpc64 cross build. 2018-01-19 15:05:43 +01:00
Markus F.X.J. Oberhumer 16bb7ab841 clang-format files. 2018-01-19 14:18:47 +01:00
Markus F.X.J. Oberhumer 9248f02557 Silence some gcc-8-snapshot compiler warnings. 2018-01-19 14:13:58 +01:00
Markus F.X.J. Oberhumer 9485a56af1 Update Travis. 2018-01-19 11:30:34 +01:00
Markus F.X.J. Oberhumer 021c8db58a Welcome 2018. 2018-01-19 10:55:32 +01:00
John Reiser 8ab180edf8 MS-DOS .exe (not PE): default to file_size when ih.m512 and ih.p512 are zero
https://github.com/upx/upx/issues/169
	modified:   p_exe.cpp
2018-01-18 12:00:38 -08:00
John Reiser ab35b685d4 Fix pefile.cpp bad range checking for reloc type 3 and 10
modified:   pefile.cpp
2018-01-18 11:11:19 -08:00
John Reiser 86745721ee MSVC strikes again
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-15 16:27:00 -08:00
John Reiser c34fe09a79 Revamp --android-shlib
Android "Oreo" wants to deal with ElfXX_Shdr[].  So splice 4KiB into PT_LOAD[0]
with an "extra" copy of them.  This requires careful relocation processing.
It also costs a page at run time, and an average of a page in the file
(depending on fragmentation at the boundary between r-x and rw- .)

https://github.com/upx/upx/issues/124
https://github.com/upx/upx/issues/139
https://github.com/upx/upx/issues/142

	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/src/arm64-linux.shlib-init.S

	modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/arm64-linux.shlib-init.h

	modified:   ../.github/travis_testsuite_1.sh
2018-01-15 16:08:34 -08:00
John Reiser 1fa9ff2c05 --android-shlib handles implicit relocation in PLT
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2018-01-15 15:45:37 -08:00
John Reiser e8ef0cf63f Merge branch 'devel' into jreiser-android 2018-01-13 09:25:55 -08:00
John Reiser 8c84efb8fb --android-shlib for Android "Oreo"
Android "Oreo" wants to deal with ElfXX_Shdr[].  So splice 4KiB into PT_LOAD[0]
with an "extra" copy of them.  This requires careful relocation processing.
It also costs a page at run time.
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-13 09:20:04 -08:00
John Reiser f3a7620ae8 ARM: recognize R_ARM_CALL and R_ARM_JUMP24 as equivalent to R_ARM_PC24
modified:   linker.cpp
2018-01-12 08:42:34 -08:00
John Reiser c7969ed5a5 work in progress for --android-shlib
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/arm.v4a-linux.shlib-init.S
	modified:   stub/src/arm.v4t-linux.shlib-init.S
2018-01-12 08:32:24 -08:00
Markus F.X.J. Oberhumer 900926c0ed Avoid a MSVC warning. 2018-01-12 10:19:14 +01:00
John Reiser df94f4288a picky, picky
modified:   p_lx_elf.cpp
2018-01-11 12:09:43 -08:00
John Reiser 969efe687d MSVC pecadillos
modified:   p_lx_elf.cpp
	modified:   pefile.cpp
2018-01-11 12:01:00 -08:00
John Reiser ee3f1292d0 fix editing rot for mach-o .dylib
https://github.com/upx/upx/issues/57
	modified:   p_mach.cpp
2018-01-11 11:33:15 -08:00
John Reiser cacb239040 work in progress for --android-shlib
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/src/arm64-linux.shlib-init.S
2018-01-11 09:39:26 -08:00
John Reiser 28d1789783 work in progress for --android-shlib
modified:   p_lx_elf.cpp
2018-01-08 14:04:38 -08:00
John Reiser 633eb98e34 Merge branch 'devel' into jreiser-android 2018-01-06 09:53:43 -08:00
John Reiser 4854c03096 uint64_t ==> upx_uint64_t
MSVC error C2065: 'uint64_t' : undeclared identifier
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_mach.cpp
2018-01-06 09:33:04 -08:00
John Reiser e853119c77 canonicalize bool in OR
MSVC error C4805: '|' : unsafe mix of type 'bool' and type 'unsigned int' in operation
	modified:   p_lx_elf.cpp
2018-01-06 09:20:46 -08:00
John Reiser 161a58bafb work in progress for --android-shlib
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2018-01-06 09:18:17 -08:00
John Reiser f5fd94e815 Android shlib: work in progress
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-12-31 22:40:57 -08:00
John Reiser edde6210f1 amd64 linux stack align
forgotten as part of 4a35bf32ea
	modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   ../.github/travis_testsuite_1.sh
2017-12-31 10:36:14 -08:00
John Reiser 507e19945e more checking of PT_DYNAMIC
https://github.com/upx/upx/issues/166
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-12-30 22:31:50 -08:00
John Reiser 4a35bf32ea static uClibc on amd64 passes entry.%rdx to 'atexit'
https://github.com/upx/upx/issues/166
	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
2017-12-30 17:20:01 -08:00
John Reiser e04bf9e4bc more checking of PT_DYNAMIC
https://github.com/upx/upx/issues/164
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-12-28 17:40:04 -08:00
John Reiser c384d224c0 Mach-o stubs turn off DEBUG
Branch jreiser-macho has DEBUG 1
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-27 10:23:19 -08:00
John Reiser 35427f998e Mach-o stubs turn off SIMULATE_ON_LINUX_EABI4
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-27 09:12:38 -08:00
John Reiser 1174da2bc3 arm64 stubs use NBPW in TRACE etc
modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S
2017-12-26 16:39:51 -08:00
John Reiser 11e8a47030 DEBUG and TRACE for arm*-darwin.macho-* stubs
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-26 15:44:54 -08:00
John Reiser 8c4e9bcf0d typo
modified:   stub/src/arm.v4a-linux.elf-entry.S
2017-12-26 15:43:58 -08:00
John Reiser 9dfd624901 fix TRACE macro
modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
2017-12-26 15:43:01 -08:00
John Reiser 79e65503a9 Merge branch 'devel' into jreiser-macho 2017-12-26 10:41:26 -08:00
John Reiser 59f18b9d9f stash work-in-progress
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-22 23:07:03 -08:00
John Reiser fb3699fb89 stash work-in-progress
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-fold.S
	modified:   stub/src/arm.v5a-darwin.macho-main.c
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/i386-darwin.macho-upxmain.c
2017-12-22 10:20:32 -08:00
John Reiser 9d2d59b5d2 stash work-in-progress
modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm64-darwin.macho-fold.S
2017-12-19 21:19:53 -08:00
John Reiser aefb2fa3c3 bad logic for throwCantUnpack("cmdsize") [simple]
https://github.com/upx/upx/issues/161
	modified:   p_mach.cpp
2017-12-19 17:36:22 -08:00
John Reiser e8aa80f904 stash work-in-progress
modified:   linker.cpp
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-darwin.macho-main.c
2017-12-19 17:32:15 -08:00
John Reiser 990988f920 More checking of input Phdr and Shdr
https://github.com/upx/upx/issues/157
	modified:   p_lx_elf.cpp
2017-12-18 10:36:43 -08:00
John Reiser 576d9a4e7e stash work-in-progress
modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/arm.v5a-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-entry.S
2017-12-17 15:02:57 -08:00
John Reiser 1d462ee424 MIPS shlib --lzma stub coding error: wrong register
https://github.com/upx/upx/issues/139 (part2)
	modified:   stub/src/mipsel.r3000-linux.shlib-init.S
2017-12-14 11:17:01 -08:00
John Reiser c9b09555c4 MH_PIE ASLR (Address-Space Layout Randomization)
modified:   stub/src/amd64-darwin.macho-main.c
2017-12-13 11:15:10 -08:00
John Reiser 860b5bf967 MH_EXECUTE diagnose syscall failure
modified:   stub/src/amd64-darwin.macho-fold.S
2017-12-13 10:53:22 -08:00
John Reiser 5063480a38 MH_EXECUTE runs under lldb, fails under shell
mmap  addr=0x100000000  len=0x3003  prot=0x3  flags=0x1012  fd=-1  off=0x0  reloc=0x0
maddr=0xffffffffffffffff  addr=0x100000000
	modified:   p_mach.cpp
	modified:   p_mach_enum.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-fold.S
	modified:   stub/src/amd64-darwin.macho-main.c
2017-12-13 09:54:44 -08:00
John Reiser 3400ae9dbe MH_EXECUTE leave space for thread state command
modified:   p_mach.cpp
2017-12-12 10:53:19 -08:00
John Reiser 3385264eb2 new DPRINTF
modified:   stub/src/amd64-darwin.macho-main.c
2017-12-12 10:52:47 -08:00
John Reiser 34646f1c6a fix braces in comment after #elif
modified:   stub/src/amd64-linux.elf-main.c
2017-12-12 10:51:38 -08:00
John Reiser 50aa63a5a0 declare write()
modified:   stub/src/include/darwin.h
2017-12-12 10:50:50 -08:00
John Reiser 64557bee43 Mach-o MH_EXECUTE rewrite; work-in-progress
The stub for amd64 gets to upx_main()
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-fold.S
	plus .h .bin.dump .map
2017-12-09 20:18:39 -08:00
John Reiser 7c21c4513e Android 64-bit ARM shared library stub: use 4Ki page size until more is known
https://github.com/upx/upx/issues/124
	modified:   p_lx_elf.cpp
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/src/arm64-linux.shlib-init.S
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-12-08 20:05:21 -08:00
John Reiser c6d6378005 Mach-o MH_EXECUTE rewrite; work-in-progress
The stub for amd64 gets into the de-compressed folded code.
	modified:   p_mach.cpp
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
2017-12-06 17:04:47 -08:00
John Reiser 4f6979967d Mach-o MH_EXECUTE rewrite; work-in-progress
On amd64, otool and lldb accept the results.
The entry point points to the unfilter and uncompress routines.
Somehow _start has been lost.

	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-darwin.macho-upxmain.c
	modified:   stub/src/i386-darwin.macho-upxmain.c
	modified:   stub/src/powerpc-darwin.macho-upxmain.c
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
2017-12-03 23:17:55 -08:00
John Reiser e633c51b50 off_t_upx_stub typedef enables easier use of native #include
... but requires  #define __WORDSIZE
	modified:   p_mach.h
	modified:   stub/amd64-darwin.macho-fold.h
	modified:   stub/src/amd64-darwin.macho-main.c
	modified:   stub/src/arm.v5a-darwin.macho-main.c
	modified:   stub/src/arm64-darwin.macho-main.c
	modified:   stub/src/i386-darwin.macho-main.c
	modified:   stub/src/include/darwin.h
	modified:   stub/src/powerpc-darwin.macho-main.c
	modified:   stub/src/powerpc64le-darwin.macho-main.c
	modified:   stub/tmp/amd64-darwin.macho-fold.map
2017-11-28 14:49:46 -08:00
John Reiser 143f0accef PeFile check MZ offset to PE header
modified:   pefile.cpp
2017-11-21 13:07:42 -08:00
John Reiser b413f3da26 ELF shared library: PT_NOTE can prevent packing
Android build environment post-processing is adding a PT_NOTE
("Android", 21, "r16-beta1") at the high end of PT_LOAD[0],
above the stub; the runtime linker looks there before de-compression.
https://github.com/upx/upx/issues/124
	modified:   p_lx_elf.cpp
2017-11-20 10:08:24 -08:00
John Reiser 6eafa552bb Mach-o defend against bad crafted input
https://github.com/upx/upx/issues/146
	modified:   p_mach.cpp
2017-11-15 13:38:54 -08:00
John Reiser 7a0514d9b4 PeFile more checks for Section table
modified:   pefile.cpp
2017-11-12 21:47:47 -08:00
John Reiser 7e7565299e PeFile check Section table
https://github.com/upx/upx/issues/132
	modified:   pefile.cpp
2017-11-12 21:02:52 -08:00
László Molnár ed34a089c6 minor update for a memory derefencing check 2017-11-12 16:19:40 +01:00
John Reiser d14a2c5282 PeFile fix the recently-added interval checking.
https://github.com/upx/upx/issues/143
	modified:   pefile.cpp
2017-11-09 21:58:25 -08:00
John Reiser f014406b65 MemBuffer.subref(errfmt, skip, take) checks that a subinterval is inside
modified:   mem.cpp
	modified:   mem.h
2017-11-09 21:55:41 -08:00
John Reiser 58771ecca6 PeFile: better checking for import descriptors
modified:   pefile.cpp
2017-11-08 12:38:54 -08:00
John Reiser 5d9dcb634b PeFile: Defend against bad crafted import descriptors
https://github.com/upx/upx/issues/143
	modified:   pefile.cpp
	modified:   pefile.h
2017-11-08 11:07:46 -08:00
John Reiser 19c2c1edcf Android 8.0 (Oreo) wants 0!=.e_shstrndx in a shared library
https://github.com/upx/upx/issues/142
It should not matter what the .sh_name is; only the .sh_type matters.
	modified:   p_lx_elf.cpp
2017-11-07 11:12:23 -08:00
John Reiser 0430e7931e PowerPC64 stub: on syscall, real Linux trashes r13 and below
(except r1, r2, and input args!) So, r12 .e_entry for musl
must copy from a saved register.  [qemu-ppc64 doesn't trash registers!]
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	also .h  .fold.map
2017-10-27 20:07:32 -07:00
John Reiser bb8e607442 PowerPC64 musl 1.1.16 wants r12= .e_entry
modified:   stub/src/powerpc64le-linux.elf-fold.S
	also .h  .fold.map
2017-10-27 13:19:03 -07:00
John Reiser e61ada944d debug info for shared library on stderr under "-D"
modified:   p_lx_elf.cpp
2017-10-25 21:32:17 -07:00
John Reiser 46730315e3 stub arm64-linux.shlib-init.S saves 1 instr and checks for assembly errors
modified:   arm64-linux.shlib-init.S
	also .h .bin.dump
2017-10-24 12:50:29 -07:00
John Reiser 4869142034 arm64 stub for shared library uses AT_PAGESZ
modified:   stub/src/arm64-linux.shlib-init.S
	also .h .bin.dump
2017-10-23 18:55:28 -07:00
John Reiser 8e42e17bbf typo
modified:   stub/src/amd64-linux.elf-entry.S
2017-10-23 18:53:42 -07:00
John Reiser 38c8b84a26 Align hatch_off.
modified:   p_lx_elf.cpp
2017-10-20 17:23:55 -07:00
John Reiser c652626a37 32-bit shared libs reduce Phdr[1].p_align to 4096, like 64-bit.
This saves space when PAGE_SIZE is larger than 4096: MIPS, etc.
	modified:   p_lx_elf.cpp
2017-10-20 16:35:27 -07:00
John Reiser 06f6e47ebf Fix stub for MIPS shared libraries
https://github.com/upx/upx/issues/135
	modified:   p_lx_elf.cpp
	modified:   stub/src/mipsel.r3000-linux.shlib-init.S
	also .h .bin.dump
2017-10-20 16:16:35 -07:00
John Reiser 403b180b1d Compress shared libraries for mips and mipsel in ELF on Linux
modified:   p_lx_elf.cpp
	modified:   stub/Makefile
	new file:   stub/mips.r3000-linux.shlib-init.h
	new file:   stub/mipsel.r3000-linux.shlib-init.h
	new file:   stub/src/mips.r3000-linux.shlib-init.S
	new file:   stub/src/mipsel.r3000-linux.shlib-init.S
	new file:   stub/tmp/mips.r3000-linux.shlib-init.bin.dump
	new file:   stub/tmp/mipsel.r3000-linux.shlib-init.bin.dump
2017-10-19 13:47:36 -07:00
John Reiser ee008acfbd amd64 implements --is_ptinterp
https://github.com/upx/upx/issues/121
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
	also .h, .map, .bin.dump
2017-10-18 13:10:49 -07:00
John Reiser d149092ac0 Reference to external documentation only.
modified:   stub/src/arch/mips/r3000/macros.ash
2017-10-17 14:11:06 -07:00
John Reiser eafa136c69 Appease error C4146 unary minus operator applied to unsigned type, result still unsigned
Microsoft Optimizing Compiler 16.00.40219.01, 19.00.24215.1, 19.11.25507.1; others
	modified:   p_lx_elf.cpp
2017-10-17 08:44:08 -07:00
John Reiser 402c885987 Merge branch 'jreiser-elfstub' into devel
New stub strategy on Linux:  Linux adds too many other segments
to the address space: [vdso], [sigpage], ...; and qemu might
arrange them differently.  Thus the only reliable mappings
are the PT_LOAD of the compressed file itself; all other
address space is unknown!  First, the compressed file uses
.bss to occupy all unused pages up to the original brk(0).
Then at run time, the stub gets another mapping of /proc/self/exe,
and uncompresses the user program on top of the original pages.
[*BSD unchanged for now?]

	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   p_unix.cpp
	modified:   p_mach.cpp
	modified:   p_lx_sh.cpp
	modified:   p_lx_interp.cpp
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_lx_interp.h
	modified:   p_lx_sh.h
	modified:   p_mach.h
	modified:   p_unix.h
	modified:   stub/src/arch/mips/r3000/macros.ash
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/include/linux.h
	modified:   stub/Makefile
	modified:   ../.github/travis_testsuite_1.sh
	also .h .map .bin.dump
2017-10-14 14:26:11 -07:00
John Reiser 5e7e0508b9 sync stubs for "make run-testsuite"
modified:   ../.github/travis_testsuite_1.sh
2017-10-14 14:19:24 -07:00
John Reiser ff1d5fb794 stub for 64-bit little-endian PowerPC also uses TOC
modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc64le-linux.elf-fold.S
2017-10-14 13:54:43 -07:00
John Reiser ad3f63b5c4 stubs *.elf-main.c: tighten input to first decompress of ELF headers
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
	also .h, .map
2017-10-14 06:21:44 -07:00
John Reiser a3e51e6dee stub for PowerPC 64-bit big endian: accommodate musl bare .func as .e_entry
modified:   stub/src/powerpc64le-linux.elf-fold.S
2017-10-14 06:18:00 -07:00
John Reiser c1b9c79f54 arm,armeb stubs need endian-neutral code to set mflg_subr
modified:   stub/src/arm.v4a-linux.elf-entry.S
	also .h, .bin.dump
2017-10-13 12:27:07 -07:00
John Reiser e0bc040b0a mips stub uses new strategy
modified:   p_lx_elf.cpp
	modified:   stub/src/arch/mips/r3000/macros.ash
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	also .h, .bin.dump, .map
2017-10-12 21:04:10 -07:00
John Reiser 85eb4c7537 powerpc stub: used wrong register
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
2017-10-11 17:17:45 -07:00
John Reiser 1f929d47d0 x86_64 stub also needs make_hatch()
https://github.com/upx/upx/issues/133
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   ../.github/travis_testsuite_1.sh
	also .h and .map
2017-10-11 09:06:50 -07:00
John Reiser 608662d73b x86_64 stub also needs make_hatch()
https://github.com/upx/upx/issues/133
	modified:   stub/src/amd64-linux.elf-main.c
2017-10-11 08:45:21 -07:00
John Reiser 7841d23e77 arm64: folded stub uses 64-bit TRACEing under DEBUG
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
2017-10-10 21:39:50 -07:00
John Reiser b72dda4ada arm64 spills a few registers because syscall can trash x18
modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
2017-10-10 20:31:11 -07:00
John Reiser c59c8a1ea2 readability; no functional change
modified:   stub/src/powerpc64le-linux.elf-entry.S
2017-10-10 20:30:41 -07:00
John Reiser 1522293be0 arm64: stub uses new strategy
modified:   p_lx_elf.cpp
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c
	also .h, .map, .bin.dump
2017-10-10 14:51:03 -07:00
John Reiser b37bc99330 PowerPC64: stub uses new strategy
Needed: expert on TOC for big-endian.  glibc, musl, gcc disagree
on layout (is the .func first?) and usage for .e_entry.
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/Makefile
	also .h, .bin.dump, .map
2017-10-07 13:43:12 -07:00
John Reiser 7f905724b1 amd64: stub uses new strategy
modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   p_lx_elf.cpp
	also .h, .bin.dump, .map
2017-10-06 11:15:34 -07:00
John Reiser 2bf5bb1625 arm: stub uses new strategy
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   p_lx_elf.cpp
	plus .h, .bin.dump, .map
2017-10-05 17:07:30 -07:00
John Reiser 08d3376740 Elf i386 stub: get enough space when unfolded code requires another page
modified:   src/i386-linux.elf-entry.S
2017-10-03 11:48:27 -07:00
John Reiser 7bace76176 Protect against bad crafted input.
https://github.com/upx/upx/issues/129
	modified:   p_lx_elf.cpp
2017-10-03 09:55:34 -07:00
John Reiser ef336dbcc6 Protect against bad crafted input.
https://github.com/upx/upx/issues/128
	modified:   p_lx_elf.cpp
2017-10-02 21:47:40 -07:00
John Reiser ca7217e717 powerpc: stub uses new strategy
First mmap must reserve enough space to decompress folded stub.
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	also .h, .map, .dump
2017-10-02 20:03:47 -07:00
John Reiser 3931cb7871 off_t is signed and long; keep the long when discarding the signed.
https://github.com/upx/upx/issues/127
	modified:   p_vmlinx.cpp
2017-10-01 16:14:09 -07:00
John Reiser 9e8de4abe5 i386: new stub strategy to avoid problems with early mmap layout
The stub occupies the same region that execve() would create
for the original progam.  The stub copies everything to a new area,
erases the original region, replaces it with the de-compressed
program, and erases the copy of itself via the escape hatch.
The copy is inexpensive via mmap() of /proc/self/exe.

	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-main.c

	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_lx_interp.cpp
	modified:   p_lx_interp.h
	modified:   p_lx_sh.cpp
	modified:   p_lx_sh.h
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_unix.cpp
	modified:   p_unix.h
	modified:   p_vmlinx.cpp

	plus .h, .map, .dump
2017-10-01 15:56:34 -07:00
John Reiser 26be845563 mips stubs: implement ET_DYN (-pie).
modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	plus associated *.h, *.bin.dump, and ../.github/travis_testsuite_1.sh
2017-09-26 10:05:22 -07:00
John Reiser 2f11a629fa Fix flub: "git --amend" after "git push" is not a good idea.
https://github.com/upx/upx/issues/126# Please enter the commit message for your changes. Lines starting
	modified:   arm64-linux.shlib-init.S
2017-09-25 11:43:38 -07:00
John Reiser a295437e11 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-09-25 11:39:13 -07:00
John Reiser 04597fb804 Fix bug in unfilter for shlib on arm64.
https://github.com/upx/upx/issues/126
	modified:   stub/src/arm64-linux.shlib-init.S
	and associated *.h, *.bin.dump
2017-09-25 11:38:33 -07:00
John Reiser f2f002409b Fix bug in unfilter for shlib on arm64.
https://github.com/upx/upx/issues/126
	modified:   stub/src/arm64-linux.shlib-init.S
	and associated *.h, *.bin.dump
2017-09-25 11:31:44 -07:00
John Reiser 509de877ca Cleanup powerpc64 aux stub files.
modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/powerpc64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-09-24 20:30:07 -07:00
John Reiser 63aea4a7dc 64-bit Power PC linux uses 64KiB page size, but qemu-ppc64{,le} uses 4KiB.
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/include/linux.h
	modified:   stub/src/powerpc64le-linux.elf-fold.S
2017-09-24 20:24:46 -07:00
John Reiser 6470c748db Flush ACC_UNUSED(adrc); and its predecessors from stub for MIPS.
modified:   p_lx_elf.cpp
2017-09-24 20:07:31 -07:00
John Reiser 25a6429e6a Merge branch 'devel' of https://github.com/upx/upx into devel 2017-09-23 10:43:14 -07:00
John Reiser 4fa1c2a97e Avoid the stack in stub for PowerPC, especially under qemu-ppc.
modified:   stub/src/powerpc-linux.elf-entry.S

	also travis_testsuite_1.sh, -entry.h, -entry.bin.dump
2017-09-23 10:41:40 -07:00
Markus F.X.J. Oberhumer 9ad39d77cc Update Travis. 2017-09-21 10:15:01 +02:00
John Reiser 92527126a8 Adapt around qemu-arm placement of ET_DYN and stack.
modified:   stub/src/arm.v4a-linux.elf-entry.S

	modified:   ../.github/travis_testsuite_1.sh
	plus arm*.elf-entry.h, arm*.elf-entry.bin.dump
2017-09-20 15:23:12 -07:00
John Reiser 02b4a4c974 Sync testsuite checksums.
modified:   ../.github/travis_testsuite_1.sh
2017-09-20 13:37:38 -07:00
John Reiser ede570be21 Spend 8 instructions to avoid modifying [0xf7000000, +) under qemu-arm.
modified:   src/arm.v4a-linux.elf-entry.S
	modified:   src/arm.v4a-linux.elf-fold.S

	plus arm*.h and tmp/arm*.{dump,map}
2017-09-20 13:31:38 -07:00
John Reiser 08627e9df5 Fix some AT_PHDR problems, at least on x86*.
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1.sh
	plus many *.elf-fold.h and *.elf-fold.map
2017-09-18 19:54:27 -07:00
John Reiser 6d9f3adc86 Escape hatch for Thumb-mode shared library must reside at even address.
https://github.com/upx/upx/issues/122
	modified:   stub/src/arm.v4t-linux.shlib-init.S

	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/tmp/arm.v5t-linux.shlib-init.bin.dump
2017-09-13 22:38:24 -07:00
John Reiser 96433b4e39 FILTER_ID was wrong for arm64-linux.shlib and arm64-darwin.macho.
https://github.com/upx/upx/issues/100  (partial)
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S
	modified:   p_mach.cpp

	modified:   stub/arm64-darwin.macho-fold.h
	modified:   stub/arm64-linux.shlib-init.h
2017-08-25 12:51:33 -07:00
John Reiser f4947cc2ae Work-around Ubuntu runtime bug loading shlib on ARM.
Use --android-shlib to activate the work-around.
https://bugs.launchpad.net/bugs/1712938
https://github.com/upx/upx/issues/116
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2017-08-24 19:52:30 -07:00
John Reiser 7b554d4f72 ucl-1.03 needs help for recent gcc and for native on aarch64.
modified:   README.SRC
2017-08-23 05:47:16 -07:00
John Reiser 5b54544438 Fix powerpc64 (BIG_ENDIAN and comments)
modified:   stub/src/arch/powerpc/64/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S

	plus stub/powerpc64*entry.h and .dump
2017-07-26 11:16:02 -07:00
Markus F.X.J. Oberhumer ef78d23494 Update Travis and check_whitespace.sh. 2017-07-23 02:59:51 +02:00
Markus F.X.J. Oberhumer ef8a7f330d Silence some compiler warnings. 2017-07-23 02:59:51 +02:00
Markus F.X.J. Oberhumer b72e0f3060 Disable debugging section. 2017-07-23 02:59:51 +02:00
Markus F.X.J. Oberhumer 2a0bab938b Rebuild stubs. 2017-07-23 02:20:05 +02:00
Markus F.X.J. Oberhumer cd637629c4 Update stub/src/arch/powerpc Makefiles. 2017-07-23 02:18:39 +02:00
John Reiser b9adfd801d Compile powerpc64 using powerpc64-linux-gcc-4.9.2 from stubtools
modified:   src/arch/powerpc/64/Makefile.extra
2017-07-22 16:14:12 -07:00
Markus F.X.J. Oberhumer 69355514c9 Fix some misspellings. 2017-07-22 12:54:37 +02:00
Markus F.X.J. Oberhumer 33dc947c21 clang-format files. 2017-07-22 12:47:45 +02:00
John Reiser 6de021d8d8 Fix MIPS, at least ET_EXEC.
ET_DYN not tested.  Also /proc/self/exe is not proected [use getenv("   ")]
	modified:   p_lx_elf.cpp
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   ../.github/travis_testsuite_1.sh

	also .h .dump .map for mips
2017-06-27 20:53:44 -07:00
John Reiser 9be86621bf PowerPC64 unifies into amd64-linux.elf-main.c
Also reconcile ppc32 and ppc64, especially *.S
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   ../.github/travis_testsuite_1.sh

	also corresponding *.h *.map *.dump
2017-06-27 14:58:13 -07:00
John Reiser a7a0876298 /proc/self/exe in powerpc64*.S stub; unify with powerpc*.S.
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   .github/travis_testsuite_1.sh

	also corresponding *.h *.dump *.map files
2017-06-26 21:40:12 -07:00
John Reiser 31b42345c3 Fix nesting brace in comment on #endif.
modified:   i386-linux.elf-main.c
2017-06-26 21:31:36 -07:00
John Reiser 1b172e729e Fix stub for powerpc64, powerpc64le
modified:   src/powerpc64le-linux.elf-fold.S
2017-06-25 16:03:43 -07:00
John Reiser 3bf387a2d4 PowerPC stub unified with i386; including escape hatch [munmap all extras]
modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	modified:   ../.github/travis_testsuite_1.sh

	{arm.*,i386,mips*.r3000,powerpc}-linux.elf-fold.{h,map}
	powerpc-*-entry.*
2017-06-24 18:37:16 -07:00
John Reiser 9f20bbb046 Fix merge 2017-06-19 16:01:35 -07:00
John Reiser 82af555974 Merge branch 'i386-VDSO' into devel 2017-06-19 15:58:22 -07:00
John Reiser 50638b5213 i386 VDSO may conflict on low side of -pie ET_DYN
https://github.com/upx/upx/issues/105
	modified:   stub/src/i386-linux.elf-entry.S

	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
2017-06-19 15:49:28 -07:00
John Reiser 650df95b72 Fix thinko in PackMachBase<T>::canUnpack(). Also detect more bad input values.
https://github.com/upx/upx/issues/109
	modified:   p_mach.cpp
2017-06-18 14:24:44 -07:00
John Reiser b2115a4162 i386: clear the stack when leaving (for buggy programs); align esp to 0 mod 8
modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
2017-06-16 21:36:21 -07:00
John Reiser d67bf16a08 i386: Separate PROT_EXEC and PROT_WRITE
Also affects some arm and mips (via sharing i386-linux.elf-main.c)
	modified:   i386-linux.elf-entry.S
	modified:   i386-linux.elf-main.c

	also .h, .map, .dump
2017-06-16 08:17:44 -07:00
John Reiser a4c9b64224 PowerPC: fix ET_EXEC [merge problems?] Next: -pie
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c

	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-06-14 20:00:30 -07:00
John Reiser 8f572e5fe6 Rewrite stubs for 32-bit arm and i386 for -pie (Position-Independent Executable)
Coming next: MIPS and PowerPC.
	modified:   p_lx_elf.cpp
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   ../.github/travis_testsuite_1.sh

	also associated *.h *.map *.dump files
2017-06-14 09:57:19 -07:00
John Reiser e58873044b Remove unused and obsolete macros do_dcache_flush and do_icache_invalidate
modified:   stub/src/arch/arm64/v8/macros.S
2017-06-14 09:35:05 -07:00
John Reiser 8ada92a69f "Drive-by" typo fix
modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/arm64-darwin.macho-entry.h
2017-06-14 09:33:41 -07:00
John Reiser 3c8ed5c000 Fix typo under "#if 0"
modified:   packer.cpp
2017-06-10 22:11:04 -07:00
John Reiser c127d5b64a o_binfo got in the way
modified:   stub/src/i386-linux.elf-entry.S
2017-06-10 14:03:05 -07:00
John Reiser 2d3bd0809a i386-linux.elf-fold.S avoids mmap() into stack
modified:   stub/src/i386-linux.elf-fold.S
	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-fold.map
2017-06-09 14:38:08 -07:00
John Reiser eef955a9dd Fix arm.v4a-linux.elf-entry.S
modified:   stub/src/arm.v4a-linux.elf-entry.S

	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   ../.github/travis_testsuite_1.sh
2017-06-08 20:50:57 -07:00
John Reiser e59ce39dc6 Fix arm64-linux.elf-*
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-06-08 17:23:19 -07:00
John Reiser 62815f5c3c Fix AT_PHDR and AT_ENTRY for amd64-linux.elf (-pie, libmusl)
modified:   stub/src/amd64-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-06-07 09:04:02 -07:00
John Reiser f496010273 Fix reloc of stub for amd64-linux.elf
modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-06-07 09:01:37 -07:00
John Reiser 143c4e3322 Fix MH_EXECUTE for amd64-darwin.macho
modified:   p_mach.cpp
	modified:   stub/src/amd64-darwin.macho-entry.S

	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
2017-06-07 08:58:20 -07:00
John Reiser e7f1e99a5e Merge branch 'jreiser' into devel
O_BINFO simplifies stubs on linux Elf;
PowerPC64 (big endian: Apple Macintosh G5) and PowerPC* cleanup;
-fpie simplification; shlib for arm64, amd64.

A big merge due to suspending activity on 'devel' branch
during stabilization for release of UPX-3.94.
There were intermediate merges with private branch 'jreiser',
and attempted rebase onto 'devel' did not go well.
Verfication of cases ({ET_EXEC, -fpie, shlib} x {$ARCH}) is in progress.

	modified:   ../.github/travis_testsuite_1.sh
	modified:   conf.h
	modified:   linker.cpp
	modified:   linker.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/scripts/xstrip.py

	modified:   stub/src/amd64-darwin.dylib-entry.S
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/32/lzma_d.S
	modified:   stub/src/arch/powerpc/32/nrv2b_d.S
	modified:   stub/src/arch/powerpc/32/nrv2d_d.S
	modified:   stub/src/arch/powerpc/32/nrv2e_d.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	new file:   stub/src/arch/powerpc/64/Makefile
	new file:   stub/src/arch/powerpc/64/Makefile.extra
	new file:   stub/src/arch/powerpc/64/bxx.S
	new file:   stub/src/arch/powerpc/64/lzma_d.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cf.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cs.S
	new file:   stub/src/arch/powerpc/64/macros.S
	new file:   stub/src/arch/powerpc/64/nrv2b_d.S
	new file:   stub/src/arch/powerpc/64/nrv2d_d.S
	new file:   stub/src/arch/powerpc/64/nrv2e_d.S
	new file:   stub/src/arch/powerpc/64/ppc_regs.h
	modified:   stub/src/arch/powerpc/64le/bxx.S
	copied:     stub/src/arch/powerpc/64le/lzma_d.S -> stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/lzma_d_cs.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S
	modified:   stub/src/i386-bsd.elf-entry.S
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-entry.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	new file:   stub/src/powerpc64-darwin.dylib-entry.S
	new file:   stub/src/powerpc64-darwin.macho-entry.S
	new file:   stub/src/powerpc64-darwin.macho-fold.S
	new file:   stub/src/powerpc64-darwin.macho-main.c
	new file:   stub/src/powerpc64-linux.elf-entry.S
	new file:   stub/src/powerpc64-linux.elf-fold.S
	new file:   stub/src/powerpc64-linux.elf-fold.lds
	new file:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64-savegpr0.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c

	and most stub/*.h and stub/tmp/*.dump
2017-06-05 11:32:25 -07:00
John Reiser 140a031515 arm64-linux.shlib-init
modified:   p_lx_elf.cpp
	modified:   stub/src/arm64-linux.shlib-init.S

	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-06-04 16:52:43 -07:00
John Reiser b7c91941b8 --android-shlib fix Elf64_Shdr.sh_offset
https://github.com/upx/upx/issues/100
	modified:   ../p_lx_elf.cpp
	modified:   ../p_lx_elf.h
2017-05-31 11:04:56 -07:00
John Reiser 33f0b6da67 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-05-31 10:57:19 -07:00
John Reiser ee18fe9bba DF_1_PIE and calls_crt1() to handle part of -pie,-fPIE
https://github.com/upx/upx/issues/106  [partial]
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-05-31 10:53:55 -07:00
John Reiser a51330cf07 DF_1_PIE and calls_crt1() to handle part of -pie,-fPIE
https://github.com/upx/upx/issues/106  [partial]
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-05-30 13:43:06 -07:00
John Reiser a67aed2744 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-05-30 11:33:39 -07:00
John Reiser d979e19315 fpad8() for --android-shlib in PackLinuxElf64::pack4()
https://github.com/upx/upx/issues/100
	modified:   p_lx_elf.cpp
2017-05-30 11:32:05 -07:00
Markus F.X.J. Oberhumer 4c74d16795 Avoid a compilation warning. clang-format files. 2017-05-28 11:32:12 +02:00
John Reiser 6e541a432f amd64-linux: DF_1_PIE marks a main program; stub juggles AT_PHDR for same
https://github.com/upx/upx/issues/105
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-05-27 19:54:12 -07:00
John Reiser d8f47e248a Handle old style 8-byte headers for version <= 11
https://github.com/upx/upx/issues/102
	modified:   p_unix.cpp
2017-05-26 13:05:12 -07:00
John Reiser d1a869496b More visibility for PackHeader when debug(-D)
modified:   packhead.cpp
	modified:   packmast.cpp
	modified:   pefile.h
2017-05-26 13:02:32 -07:00
John Reiser f42a37555d Merge branch 'devel' of https://github.com/upx/upx into devel 2017-05-21 20:48:05 -07:00
John Reiser d9e019bd87 amd64-darwin.dylib hacking
modified:   stub/src/amd64-darwin.dylib-entry.S

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/tmp/amd64-darwin.dylib-entry.bin.dump
2017-05-17 21:36:40 -07:00
John Reiser ce194fa5d8 amd64-darwin.dylib hacking
modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   p_mach_enum.h
	modified:   stub/src/amd64-darwin.dylib-entry.S

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/tmp/amd64-darwin.dylib-entry.bin.dump
2017-05-17 15:50:34 -07:00
Markus F.X.J. Oberhumer b5bdf57636 Minor cleanups. 2017-05-14 19:21:04 +02:00
Markus F.X.J. Oberhumer a3a81ce7c6 Update NEWS. 2017-05-13 20:44:02 +02:00
Markus F.X.J. Oberhumer 61f347401c Update testsuite checksums caused by version bump. 2017-05-12 15:35:24 +02:00
Markus F.X.J. Oberhumer d985a4c250 Post-release version bump. 2017-05-12 15:28:47 +02:00
Markus F.X.J. Oberhumer d31947e1f0 Update NEWS. 2017-05-12 13:01:20 +02:00
Markus F.X.J. Oberhumer e4659b7d7c Bump release date. 2017-05-12 12:47:14 +02:00
Markus F.X.J. Oberhumer 8827a534db Update Travis. 2017-05-12 12:45:43 +02:00
Markus F.X.J. Oberhumer ddf48b45a5 Update Travis. 2017-05-09 22:50:18 +02:00
John Reiser 8eabb9b02f i386 recover from merge
modified:   p_lx_elf.cpp
2017-05-08 18:54:41 -07:00
John Reiser 8a195a0b35 amd64 recover from merge
modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-05-08 16:06:02 -07:00
John Reiser 955206aaf0 Merge branch 'devel' into jreiser
Conflicts:
	src/p_lx_elf.cpp
	src/stub/src/amd64-linux.elf-entry.S
	src/stub/src/amd64-linux.elf-main.c
	src/stub/src/arm.v4a-linux.elf-entry.S
	src/stub/src/arm.v4a-linux.elf-fold.S
	src/stub/src/arm64-linux.elf-entry.S
	src/stub/src/arm64-linux.elf-fold.S
	src/stub/src/i386-linux.elf-fold.S
	src/stub/src/powerpc-darwin.macho-entry.S
	src/stub/src/powerpc-linux.elf-fold.S
	src/stub/src/powerpc64le-darwin.macho-entry.S
	src/stub/src/powerpc64le-linux.elf-entry.S
	src/stub/src/powerpc64le-linux.elf-fold.S
	src/stub/src/powerpc64le-linux.elf-main.c

 Changes to be committed:
	modified:   ../.github/ISSUE_TEMPLATE.md
	modified:   ../.github/travis_build.sh
	modified:   ../.github/travis_deploy.sh
	modified:   ../.github/travis_init.sh
	modified:   ../.github/travis_testsuite_1.sh
	modified:   ../.gitignore
	modified:   ../.travis.yml
	modified:   ../NEWS
	modified:   c_screen.cpp
	modified:   file.cpp
	modified:   help.cpp
	modified:   linker.cpp
	modified:   main.cpp
	modified:   p_lx_elf.cpp
	modified:   packer.cpp
	modified:   s_djgpp2.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	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-main.c
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   ui.cpp
	modified:   util.cpp
	modified:   work.cpp
	[plus *.h, *.dump, *.map]
2017-05-08 14:21:31 -07:00
John Reiser 082dd7d5ee arm64 TRACE improvement
modified:   stub/src/arm64-linux.elf-entry.S

	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
2017-05-07 12:07:51 -07:00
John Reiser 90714cf624 arm64 tracing in stub
modified:   ../../linker.cpp
	modified:   ../../p_lx_elf.cpp
	modified:   arm64-linux.elf-entry.S
2017-05-06 19:37:37 -07:00
John Reiser 61798d33f0 Revamp stub on arm, arm64; mmap into stack defeats auto-expansion [kernel bug?]
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:   ../.github/travis_testsuite_1.sh
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
2017-05-05 18:36:44 -07:00
John Reiser 6e2a41cb26 DPRINTF for amd64
modified:   Makefile
	modified:   src/amd64-linux.elf-fold.S
	modified:   src/amd64-linux.elf-main.c

	modified:   amd64-linux.elf-fold.h
	modified:   tmp/amd64-linux.elf-fold.map
2017-05-05 13:32:42 -07:00
John Reiser 515897e180 Allow Elf64_Ehdr::ELFOSABI_NONE on Linux; cater to EM_PPC64.e_flags quirk
modified:   p_lx_elf.cpp
2017-05-04 08:28:03 -07:00
John Reiser fe4a8f33b1 Start on darwin.macho-dylib
modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   packmast.cpp
2017-05-03 08:30:21 -07:00
Markus F.X.J. Oberhumer 304d848f53 Bump version date. 2017-05-03 13:49:22 +02:00
Markus F.X.J. Oberhumer b5f738abf3 Move xxx_le26 from miniacc.h to bele.h. 2017-05-03 13:25:10 +02:00
Markus F.X.J. Oberhumer 7ebed06393 Fix building with recent djgpp2 gcc-6 version. 2017-05-03 13:21:08 +02:00
Markus F.X.J. Oberhumer 2e56fe82bb Update Travis. 2017-05-01 10:37:07 +02:00
John Reiser 32019c61aa dynamic e_phnum for arm
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
2017-04-30 19:15:17 -07:00
John Reiser f7ffae565c dynamic e_phnum for arm64
modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S

	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
2017-04-30 13:13:53 -07:00
John Reiser cd11bb1606 Update AT_BASE for musl-libc
https://github.com/upx/upx/issues/93
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/i386-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-main.c

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
	modified:   ../.github/travis_testsuite_1.sh
2017-04-27 20:55:02 -07:00
John Reiser 24c924d668 Fix size of 'imul'
modified:   src/stub/src/i386-linux.elf-fold.S
	modified:   src/p_lx_elf.cpp

	modified:   .github/travis_testsuite_1.sh
	modified:   src/stub/i386-linux.elf-fold.h
	modified:   src/stub/tmp/i386-linux.elf-fold.map
2017-04-26 15:24:19 -07:00
John Reiser 9be94e4b58 Fix size of 'imul'
modified:   stub/src/amd64-linux.elf-entry.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
2017-04-24 17:12:55 -07:00
John Reiser 15e9d8c99d Recognize __libc_init for Android -pie (PositionIndependentExecutable)
based on https://github.com/upx/upx/pull/92/commits/d34887ef60304cb28990c4b99c17b1f91acbbef1
	modified:   p_lx_elf.cpp
2017-04-24 11:04:48 -07:00
John Reiser 391f511094 powerpc-linux.elf-fold.S and -main.c handle /proc/self/exe
modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c

	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-04-22 20:18:00 -07:00
John Reiser 5b53c11a6b Sync powerpc-linux.elf testsuite
modified:   travis_testsuite_1.sh
2017-04-21 11:30:12 -07:00
John Reiser 9df4b6ea24 Sync SZ_FRAME with devel branch
modified:   src/arch/powerpc/32/ppc_regs.h
	modified:   src/arch/powerpc/64le/ppc_regs.h
	modified:   src/powerpc64le-linux.elf-entry.S
	modified:   src/powerpc64le-linux.elf-fold.S
2017-04-21 10:54:04 -07:00
John Reiser a440564ba4 Fix powerpc64le ABI stack frame omitting spill area for a0-a7
Also use new symbol SZ_FRAME in */ppc_regs.h
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S

	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-darwin.macho-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-darwin.macho-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/tmp/powerpc64le-darwin.macho-fold.map
2017-04-21 08:58:13 -07:00
John Reiser 9583cfcc93 Update NEWS 2017-04-19 19:55:39 -07:00
John Reiser c4a921283a Revamp powerpc{,64le,64}.
Fix 64-bit stack frame (8*8 bytes for spilling a0-a7).  Avoid using r2 (t0).
Prepare for -pie executables.  Prepare for unified strategy in stubs.

	modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-main.c
	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/32/lzma_d.S
	modified:   stub/src/arch/powerpc/32/nrv2b_d.S
	modified:   stub/src/arch/powerpc/32/nrv2d_d.S
	modified:   stub/src/arch/powerpc/32/nrv2e_d.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	new file:   stub/src/arch/powerpc/64/Makefile
	new file:   stub/src/arch/powerpc/64/Makefile.extra
	new file:   stub/src/arch/powerpc/64/lzma_d.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cf.S
	new file:   stub/src/arch/powerpc/64/lzma_d_cs.S
	modified:   stub/src/arch/powerpc/64le/bxx.S
	copied:     stub/src/arch/powerpc/64le/lzma_d.S -> stub/src/arch/powerpc/64le/lzma_d-common.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/lzma_d_cs.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.dylib-entry.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	modified:   stub/src/powerpc64-darwin.dylib-entry.S
	modified:   stub/src/powerpc64-darwin.macho-entry.S
	modified:   stub/src/powerpc64-darwin.macho-fold.S
	modified:   stub/src/powerpc64-darwin.macho-main.c
	modified:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64-savegpr0.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S

	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-darwin.macho-fold.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
	modified:   stub/powerpc64-linux.elf-entry.h
	modified:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-darwin.macho-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc64le-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2017-04-19 19:25:05 -07:00
John Reiser 4e05f087f9 PowerPC 64-bit big-endian
modified:   conf.h
	modified:   linker.cpp
	modified:   linker.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/powerpc-linux.elf-entry.h
	new file:   stub/powerpc64-linux.elf-entry.h
	new file:   stub/powerpc64-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/scripts/xstrip.py
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	new file:   stub/src/powerpc64-darwin.dylib-entry.S
	new file:   stub/src/powerpc64-darwin.macho-entry.S
	new file:   stub/src/powerpc64-darwin.macho-fold.S
	new file:   stub/src/powerpc64-darwin.macho-main.c
	new file:   stub/src/powerpc64-linux.elf-entry.S
	new file:   stub/src/powerpc64-linux.elf-fold.S
	new file:   stub/src/powerpc64-linux.elf-fold.lds
	new file:   stub/src/powerpc64-linux.elf-main.c
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-11 19:15:43 -07:00
John Reiser 40b506d2e0 Sync arm* stubs
modified:   ../arm.v4a-linux.elf-entry.h
	modified:   ../arm.v4a-linux.elf-fold.h
	modified:   ../arm.v5a-linux.elf-entry.h
	modified:   ../arm.v5a-linux.elf-fold.h
	modified:   ../arm64-darwin.macho-entry.h
	modified:   ../arm64-linux.elf-entry.h
	modified:   ../arm64-linux.elf-fold.h
	modified:   ../armeb.v4a-linux.elf-entry.h
	modified:   ../armeb.v4a-linux.elf-fold.h
	modified:   ../tmp/arm.v4a-linux.elf-entry.bin.dump
	modified:   ../tmp/arm.v4a-linux.elf-fold.map
	modified:   ../tmp/arm.v5a-linux.elf-entry.bin.dump
	modified:   ../tmp/arm.v5a-linux.elf-fold.map
	modified:   ../tmp/arm64-darwin.macho-entry.bin.dump
	modified:   ../tmp/arm64-linux.elf-entry.bin.dump
	modified:   ../tmp/armeb.v4a-linux.elf-entry.bin.dump
	modified:   ../tmp/armeb.v4a-linux.elf-fold.map
2017-04-11 19:13:11 -07:00
John Reiser 263f384810 o_binfo
modified:   arm64-darwin.macho-entry.S
2017-04-11 19:07:38 -07:00
John Reiser d80c145a18 PROT_EXEC for decompressed 'fold'
modified:   powerpc-linux.elf-entry.S
2017-04-10 15:36:43 -07:00
Markus F.X.J. Oberhumer 8848fe35f6 Update Travis. 2017-04-10 16:15:03 +02:00
John Reiser 7a681bd20d Use saved registers for parameters to 'fold'; lzma can clobber others
modified:   arm64-linux.elf-entry.S
	modified:   arm64-linux.elf-fold.S
2017-04-09 21:33:29 -07:00
John Reiser ed31fb184b Replace crumb with b_info
modified:   stub/src/arm.v4a-linux.elf-entry.S
	modified:   stub/src/arm.v4a-linux.elf-fold.S
2017-04-09 18:06:16 -07:00
John Reiser 360b94dd6c i386-linux ET_EXEC working
modified:   stub/src/i386-linux.elf-fold.S

	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-fold.map
2017-04-07 16:08:13 -07:00
John Reiser 8524e73f59 Always a 1-page crumb for i386
modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S

	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
2017-04-07 11:17:01 -07:00
John Reiser 940514e5ca Sync stubs
modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-04-07 10:09:01 -07:00
John Reiser a4e47625ac Sync stubs
modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-04-07 08:23:30 -07:00
John Reiser 7c16872a6e Merge branch 'devel' into jreiser 2017-04-07 08:22:08 -07:00
John Reiser 994c3c3552 Use arm64-linux-objdump-2.25 and arm64-linux-objcopy-2.25
modified:   Makefile.extra

	modified:   lzma_d_cf.S
	modified:   lzma_d_cs.S
2017-04-07 07:20:47 -07:00
John Reiser c34f496600 Avoid incorrect C4319 by Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64
modified:   p_lx_elf.cpp
2017-04-07 05:36:40 -07:00
John Reiser 8bca8629be Preserve symlink /proc/self/exe by mapping one page into the stack.
modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-04-06 23:08:35 -07:00
John Reiser 85fdd579d6 Cleanup PackLinuxElf64amd::defineSymbols(): use is_pie; reduce symbols
modified:   p_lx_elf.cpp
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S

	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-fold.map
2017-04-06 17:22:30 -07:00
John Reiser e88d2ff88c Merge branch 'devel' into jreiser
modified:   ../.appveyor.yml
	modified:   ../.github/travis_build.sh
	modified:   Makefile
	modified:   linker.cpp
	modified:   p_lx_elf.cpp
	modified:   packmast.cpp
2017-04-06 14:25:14 -07:00
John Reiser bdf08baebd O_BINFO
modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/i386-bsd.elf-entry.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/i386-netbsd.elf-entry.h
	modified:   stub/mips.r3000-linux.elf-fold.h
	modified:   stub/mipsel.r3000-linux.elf-fold.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-darwin.macho-entry.S
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/amd64-linux.elf-fold.S
	modified:   stub/src/arch/powerpc/32/ppc_regs.h
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/i386-bsd.elf-entry.S
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/src/i386-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/mipsel.r3000-linux.elf-fold.S
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-main.c
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/tmp/amd64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/amd64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-bsd.elf-entry.bin.dump
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/i386-netbsd.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-06 14:22:47 -07:00
John Reiser 3dcdd25177 re-work -fpie for amd64
modified:   stub/src/amd64-linux.elf-main.c
2017-04-06 14:22:05 -07:00
John Reiser 491e8640b2 is_pie; O_BINFO; remove LUNMP000, LUNMP001
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-04-06 14:15:07 -07:00
John Reiser b23b7ef85e DT_FLAGS_1, DF_1_PIE
modified:   p_elf_enum.h
2017-04-06 14:13:02 -07:00
John Reiser b167374f13 R_PPC64_ADDR32
modified:   linker.cpp
2017-04-06 14:12:29 -07:00
John Reiser cd1f6e733f Merge branch 'devel' of https://github.com/upx/upx into devel 2017-04-06 09:05:46 -07:00
John Reiser d3fc7687b8 Fix valgrind error
https://travis-ci.org/upx/upx/jobs/218929378
	modified:   p_lx_elf.cpp
2017-04-06 09:04:13 -07:00
Markus F.X.J. Oberhumer 17a83d58da clang-format files. 2017-04-05 17:15:29 +02:00
Markus F.X.J. Oberhumer 18a8e1b6d6 Update Travis. 2017-04-05 17:02:46 +02:00
Markus F.X.J. Oberhumer 2c23cbb359 Silence some compiler warnings. 2017-04-05 17:02:42 +02:00
Markus F.X.J. Oberhumer cdd58cf757 Use proper UPX types. 2017-04-05 16:31:36 +02:00
John Reiser a0df325659 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-04-03 20:26:23 -07:00
John Reiser a59005e836 Elf propagates NX via PT_GNU_STACK (except MIPS stub is too difficult for now)
https://github.com/upx/upx/issues/81
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-03 20:25:57 -07:00
John Reiser 5da6a27e6b Elf propates NX via PT_GNU_STACK (except MIPS stub is too difficult for now)
https://github.com/upx/upx/issues/81
	modified:   ../.github/travis_testsuite_1.sh
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/i386-linux.elf-fold.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/src/amd64-linux.elf-entry.S
	modified:   stub/src/i386-linux.elf-fold.S
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/tmp/amd64-linux.elf-entry.bin.dump
	modified:   stub/tmp/i386-linux.elf-fold.map
	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-04-03 20:11:08 -07:00
John Reiser ef97af71e3 Merge branch 'jreiser' into devel 2017-04-03 12:57:57 -07:00
John Reiser 6ed67f4532 Unpack prefix with appended data; give message, keep backup
https://github.com/upx/upx/issues/4
	modified:   p_mach.cpp
2017-04-03 12:53:27 -07:00
John Reiser 1278d663b4 Merge branch 'jreiser' into devel 2017-04-02 14:56:26 -07:00
John Reiser 0395c7b407 Use stubtools for arm64.
modified:   stub/Makefile
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-04-02 14:55:39 -07:00
John Reiser df3d15ffb3 Enable stub for arm64 shlib. Stub is broken, but at least it packs.
modified:   p_lx_elf.cpp
2017-03-31 20:01:14 -07:00
John Reiser 6f673310d2 powerpc64le: lzma compression support
https://github.com/upx/upx/pull/79

Integration based on:
commit c4bde4369f
Author: Thierry Fauck <tfauck@free.fr>
Date:   Fri Mar 24 17:39:30 2017 +0100

    powerpc64le: lzma compression support

    Signed-off-by: Thierry Fauck <tfauck@free.fr>

    	modified:   powerpc64le-darwin.dylib-entry.h
    	modified:   powerpc64le-darwin.macho-entry.h
    	modified:   powerpc64le-linux.elf-entry.h
    	modified:   powerpc64le-linux.kernel.vmlinux.h
    	modified:   src/arch/powerpc/64le/lzma_d.S
    	modified:   tmp/powerpc64le-darwin.dylib-entry.bin.dump
    	modified:   tmp/powerpc64le-darwin.macho-entry.bin.dump
    	modified:   tmp/powerpc64le-linux.elf-entry.bin.dump
    	modified:   tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2017-03-31 13:42:43 -07:00
John Reiser 978c3eca23 --android-shlib preserves selected Elf64_Shdr
https://github.com/upx/upx/issues/65
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-31 13:26:27 -07:00
John Reiser 20bc848bd6 --android-shlib preserves selected Elf64_Shdr
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-31 13:24:36 -07:00
John Reiser ce7f1292dc Merge branch 'devel' into jreiser 2017-03-31 13:10:08 -07:00
John Reiser d97ff8bb40 More cleanup
modified:   p_lx_elf.cpp
2017-03-31 12:57:11 -07:00
John Reiser 8a9b46d82f Cleanup minor bug in unpack ET_EXE
modified:   p_lx_elf.cpp
2017-03-31 12:42:14 -07:00
John Reiser 12e5703541 Stronger test and better message for PT_LOAD[0].p_offset != 0
https://github.com/upx/upx/issues/80
	modified:   p_lx_elf.cpp
2017-03-31 12:20:02 -07:00
John Reiser 1b87fc2ee6 DT_INIT restored for -d on --android-shlib
modified:   p_lx_elf.cpp
2017-03-30 15:55:35 -07:00
John Reiser ebd0c780a1 Unpacking --android-shlib works except for restoring DT_INIT
modified:   p_lx_elf.cpp
2017-03-30 11:05:49 -07:00
John Reiser bd976cd562 Merge branch 'devel' into jreiser
modified:   packmast.cpp
2017-03-30 10:27:54 -07:00
John Reiser 0e511c3e07 visitAllPackers() lists class names when -D
modified:   packmast.cpp
2017-03-30 10:23:27 -07:00
John Reiser 300d489408 --android-shlib preserves selected Elf32_Shdr
32-bit only for now; also in wrong place for unpacking (-d)
	modified:   main.cpp
	modified:   options.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-29 18:31:39 -07:00
John Reiser 024d081167 Fix unpack of ET_DYN
https://github.com/upx/upx/issues/73

	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-27 16:49:46 -07:00
John Reiser 348173d3f1 Fix editing glitch
modified:   p_lx_elf.cpp
2017-03-27 16:42:26 -07:00
John Reiser 23e3814f8a Fix unpacking of ET_DYN
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2017-03-27 16:10:12 -07:00
John Reiser b818e2c4b8 arm64 (aarch64)
Tested and working: nrv2b and nrv2e for ET_EXE on linux.
NOT TESTED: lzma, ET_DYN on linux; any Mach-O

	modified:   bele.h
	modified:   conf.h
	modified:   filter/ct.h
	modified:   filteri.cpp
	modified:   linker.cpp
	modified:   linker.h
	modified:   miniacc.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-darwin.macho-fold.h
	new file:   stub/arm64-linux.elf-entry.h
	new file:   stub/arm64-linux.elf-fold.h
	new file:   stub/arm64-linux.shlib-init.h
	new file:   stub/src/arch/arm64/v8/Makefile.extra
	modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/lzma_d_cf.S
	new file:   stub/src/arch/arm64/v8/lzma_d_cs.S
	modified:   stub/src/arch/arm64/v8/macros.S
	renamed:    stub/src/arch/arm64/v8/nrv2b_d8.S -> stub/src/arch/arm64/v8/nrv2b_d32.S
	renamed:    stub/src/arch/arm64/v8/nrv2d_d8.S -> stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	deleted:    stub/src/arch/arm64/v8/nrv2e_d8.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	new file:   stub/src/arm64-linux.elf-entry.S
	new file:   stub/src/arm64-linux.elf-fold.S
	new file:   stub/src/arm64-linux.elf-fold.lds
	new file:   stub/src/arm64-linux.elf-main.c
	new file:   stub/src/arm64-linux.shlib-init.S
	modified:   stub/src/include/linux.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-darwin.macho-fold.map
	new file:   stub/tmp/arm64-linux.elf-entry.bin.dump
	new file:   stub/tmp/arm64-linux.elf-fold.map
	new file:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-26 13:10:26 -07:00
John Reiser 6adb3dc142 BUILD_TYPE_DEBUG ?= 0 2017-03-26 13:03:49 -07:00
John Reiser 0e154cc759 Hint when need DT_INIT for shared library
https://github.com/upx/upx/issues/74
	modified:   p_lx_elf.cpp
2017-03-25 20:22:04 -07:00
John Reiser 9dce8d9bce Separate from amd64/bxx.S
modified:   stub/src/arch/amd64/bxx.S
2017-03-25 20:14:48 -07:00
John Reiser 0aa3b9c487 Revise comment
modified:   stub/src/arch/amd64/bxx.S
2017-03-25 20:10:50 -07:00
John Reiser dc7ab3ed30 sync git branch
modified:   stub/amd64-win64.pep.h
	modified:   stub/tmp/amd64-win64.pep.bin.dump
2017-03-25 20:08:29 -07:00
John Reiser 254259b354 Fix comment
modified:   stub/src/arch/amd64/bxx.S
2017-03-25 20:05:32 -07:00
John Reiser 9651c70efd Revert powerpc-linux.elf-fold.S
modified:   stub/src/powerpc-linux.elf-fold.S
2017-03-25 17:51:32 -07:00
John Reiser 5840190ed5 Revert xstrip.py
modified:   stub/scripts/xstrip.py
2017-03-25 17:50:06 -07:00
John Reiser a807b88694 BUILD_TYPE_DEBUG ?= 1
modified:   Makefile
2017-03-25 17:40:24 -07:00
John Reiser 0db82e09e9 Suggest fix for missing DT_INIT in shared library.
modified:   p_lx_elf.cpp
2017-03-25 17:39:47 -07:00
John Reiser e5865f171a xstrip.py: *.bindump was unused; clear e_shnum, e_shstrndx
Also allow other compilers for powerpc64le and arm64: loosen checking.
	modified:   stub/Makefile
	modified:   stub/scripts/xstrip.py

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.kernel.vmlinux.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-wince.pe.h
	modified:   stub/arm.v4t-wince.pe.h
	modified:   stub/arm.v5a-darwin.macho-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.kernel.vmlinux.h
	modified:   stub/arm.v5a-linux.kernel.vmlinuz.h
	modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v5a-linux.kernel.vmlinux.h
	modified:   stub/i086-dos16.com.h
	modified:   stub/i086-dos16.exe.h
	modified:   stub/i086-dos16.sys.h
	modified:   stub/i386-bsd.elf-entry.h
	modified:   stub/i386-bsd.elf.execve-entry.h
	modified:   stub/i386-darwin.dylib-entry.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-dos32.djgpp2.h
	modified:   stub/i386-dos32.tmt.h
	modified:   stub/i386-dos32.watcom.le.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf.execve-entry.h
	modified:   stub/i386-linux.elf.interp-entry.h
	modified:   stub/i386-linux.elf.shell-entry.h
	modified:   stub/i386-linux.kernel.vmlinux.h
	modified:   stub/i386-linux.kernel.vmlinuz.h
	modified:   stub/i386-linux.shlib-init.h
	modified:   stub/i386-netbsd.elf-entry.h
	modified:   stub/i386-win32.pe.h
	modified:   stub/m68k-atari.tos.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-ps1.h
	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
2017-03-25 17:09:16 -07:00
John Reiser 166d198dcb Default BUILD_TYPE_DEBUG
modified:   Makefile
2017-03-25 16:54:26 -07:00
John Reiser 445795f2ec Sync testsuite for 32-bit powerpc lzma
modified:   ../.github/travis_testsuite_1.sh
2017-03-25 16:50:38 -07:00
John Reiser 6be4a87dac Revert "testsuite "set -x""
This reverts commit fbe4d287c7.

	modified:   .github/travis_testsuite_1.sh
2017-03-25 16:38:30 -07:00
John Reiser 17c47053d6 Revert amd64/bxx.S to reduce churn of testsuite
modified:   stub/src/arch/amd64/bxx.S

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-darwin.macho-fold.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
2017-03-25 16:34:01 -07:00
John Reiser b4e18f7521 Remove debugging straggler.
modified:   src/powerpc-linux.elf-fold.S

	modified:   powerpc-linux.elf-fold.h
	modified:   tmp/powerpc-linux.elf-fold.map
2017-03-25 15:48:18 -07:00
John Reiser fbe4d287c7 testsuite "set -x"
modified:   ../.github/travis_testsuite_1.sh
2017-03-25 14:52:08 -07:00
John Reiser 543fa3ae79 Revert PackLinuxElf32::unpack() for decompression of armeb-linux.elf/upx-3.91
Conflicting with https://github.com/upx/upx/issues/73
	modified:   p_lx_elf.cpp
2017-03-25 12:52:20 -07:00
John Reiser 7cf855413c Sync testuite checksums (powerpc)
modified:   ../.github/travis_testsuite_1.sh
2017-03-25 09:12:56 -07:00
John Reiser f5d65dc0bc arm64 unfilter
modified:   stub/src/arm64-linux.elf-fold.S

	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-03-24 13:55:54 -07:00
John Reiser 2f6211a1d9 xstrip.py slight improvement for powerpc64le and arm64
modified:   stub/scripts/xstrip.py
2017-03-24 10:54:56 -07:00
John Reiser 513a57330a xstrip.py: *.bindump was unused; clear e_shnum, e_shstrndx
modified:   stub/scripts/xstrip.py
	modified:   stub/Makefile

	modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-linux.elf-entry.h
	modified:   stub/amd64-linux.kernel.vmlinux.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
	modified:   stub/arm.v4a-linux.elf-entry.h
	modified:   stub/arm.v4a-wince.pe.h
	modified:   stub/arm.v4t-wince.pe.h
	modified:   stub/arm.v5a-darwin.macho-entry.h
	modified:   stub/arm.v5a-linux.elf-entry.h
	modified:   stub/arm.v5a-linux.kernel.vmlinux.h
	modified:   stub/arm.v5a-linux.kernel.vmlinuz.h
	modified:   stub/arm.v5a-linux.shlib-init.h
	modified:   stub/arm.v5t-linux.shlib-init.h
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/armeb.v4a-linux.elf-entry.h
	modified:   stub/armeb.v5a-linux.kernel.vmlinux.h
	modified:   stub/i086-dos16.com.h
	modified:   stub/i086-dos16.exe.h
	modified:   stub/i086-dos16.sys.h
	modified:   stub/i386-bsd.elf-entry.h
	modified:   stub/i386-bsd.elf.execve-entry.h
	modified:   stub/i386-darwin.dylib-entry.h
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/i386-dos32.djgpp2.h
	modified:   stub/i386-dos32.tmt.h
	modified:   stub/i386-dos32.watcom.le.h
	modified:   stub/i386-linux.elf-entry.h
	modified:   stub/i386-linux.elf.execve-entry.h
	modified:   stub/i386-linux.elf.interp-entry.h
	modified:   stub/i386-linux.elf.shell-entry.h
	modified:   stub/i386-linux.kernel.vmlinux.h
	modified:   stub/i386-linux.kernel.vmlinuz.h
	modified:   stub/i386-linux.shlib-init.h
	modified:   stub/i386-netbsd.elf-entry.h
	modified:   stub/i386-win32.pe.h
	modified:   stub/m68k-atari.tos.h
	modified:   stub/mips.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-linux.elf-entry.h
	modified:   stub/mipsel.r3000-ps1.h
	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
2017-03-24 09:26:40 -07:00
John Reiser 715ddf0620 arm64 hacking
modified:   stub/src/arch/arm64/v8/macros.S
	new file:   stub/src/arch/arm64/v8/Makefile.extra
	modified:   stub/src/arch/arm64/v8/lzma_d-arm.S
	modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/lzma_d_cf.S
	new file:   stub/src/arch/arm64/v8/lzma_d_cs.S
	modified:   stub/src/arm64-darwin.macho-entry.S

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-23 20:32:41 -07:00
John Reiser 6bb31e276e Merge branch 'devel' into jreiser 2017-03-23 13:27:09 -07:00
John Reiser b10f1df49f Merge branch 'devel' of https://github.com/upx/upx into devel 2017-03-23 13:09:59 -07:00
John Reiser f999519b13 Sync stubs for 32-bit powerpc
modified:   stub/src/arch/powerpc/32/Makefile.extra
	modified:   stub/src/arch/powerpc/32/lzma_d_cf.S
	modified:   stub/src/arch/powerpc/32/lzma_d_cs.S

	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h
2017-03-23 13:08:36 -07:00
Markus F.X.J. Oberhumer aedbf02830 p_lx_elf.cpp: silence a clang-4.0 compilation warning. 2017-03-23 17:43:23 +01:00
John Reiser bd5479b250 arm64 omit "dc zva," while valgrind complains
modified:   src/arm64-linux.elf-entry.S
	modified:   src/arm64-linux.elf-fold.S

	modified:   arm64-linux.elf-entry.h
	modified:   arm64-linux.elf-fold.h
	modified:   tmp/arm64-linux.elf-entry.bin.dump
	modified:   tmp/arm64-linux.elf-fold.map
2017-03-23 09:12:35 -07:00
Markus F.X.J. Oberhumer 9d14715652 Update Travis. 2017-03-23 13:00:42 +01:00
Thierry Fauck 72156fcf1b powerpc64le: support for -fpie compiled binaries
Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   powerpc64le-linux.elf-fold.h
	modified:   src/powerpc64le-linux.elf-fold.S
	modified:   src/powerpc64le-linux.elf-main.c
	modified:   tmp/powerpc64le-linux.elf-fold.map
2017-03-23 11:21:50 +01:00
Markus F.X.J. Oberhumer 1c6eab00d1 Update Travis. 2017-03-23 04:20:29 +01:00
Markus F.X.J. Oberhumer f9738c5b55 New ACC version. 2017-03-23 01:17:33 +01:00
John Reiser 3b63083619 Cleanup powerpc64 stubs
modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S

	modified:   stub/powerpc64le-darwin.macho-fold.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/tmp/powerpc64le-darwin.macho-fold.map
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
2017-03-22 16:50:52 -07:00
John Reiser d5d7d8bc84 arm64 hacking
modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-03-22 16:45:09 -07:00
John Reiser f26118cf5a lzma for powerpc64le: -Os needs _restgpr0_*
modified:   stub/src/arch/powerpc/64le/Makefile.extra
	modified:   stub/src/arch/powerpc/64le/ppc_regs.h
	modified:   stub/src/powerpc64-savegpr0.S

	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/arch/powerpc/64le/lzma_d_cf.S
	modified:   stub/src/arch/powerpc/64le/lzma_d_cs.S
	modified:   stub/tmp/powerpc64le-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc64le-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2017-03-22 14:17:40 -07:00
John Reiser 5d6c4b475c preloc
modified:   stub/src/arm64-linux.elf-main.c
2017-03-22 09:03:13 -07:00
John Reiser 2c4ef392f6 arm64-linux hacking; returns from upx_main(), only launch remains!
modified:   stub/src/arch/arm64/v8/lzma_d.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.elf-main.c

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-21 21:54:49 -07:00
John Reiser 2a128fe772 Work on arm64 decompression
renamed:    stub/src/arch/arm64/v8/nrv2b_d8.S -> stub/src/arch/arm64/v8/nrv2b_d32.S
	renamed:    stub/src/arch/arm64/v8/nrv2d_d8.S -> stub/src/arch/arm64/v8/nrv2d_d32.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d32.S
	deleted:    stub/src/arch/arm64/v8/nrv2e_d8.S
	modified:   stub/src/arm64-darwin.macho-entry.S
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/src/arm64-linux.elf-fold.S
	modified:   stub/src/arm64-linux.shlib-init.S

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/arm64-linux.shlib-init.h
	modified:   stub/tmp/arm64-darwin.macho-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
	modified:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-20 21:23:15 -07:00
John Reiser bb7d3ca3a1 Fix PackLinuxElf32::unpack() for shared library?
modified:   p_lx_elf.cpp
2017-03-20 21:21:46 -07:00
John Reiser a2bdba7eda arm64 cache flogging at initial move
modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/src/arm64-linux.elf-entry.S
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
2017-03-14 21:36:18 -07:00
John Reiser e8aabc9980 R_AARCH64_CONDBR19
modified:   linker.cpp
2017-03-14 21:35:01 -07:00
John Reiser 9f554a14fd ARM64 hacking
modified:   p_lx_elf.cpp
	modified:   stub/src/arch/arm64/v8/macros.S
	modified:   stub/src/arm64-darwin.macho-fold.S
	modified:   stub/src/arm64-linux.elf-entry.S

	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-darwin.macho-fold.h
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/arm64-linux.elf-fold.h
	modified:   stub/tmp/arm64-darwin.macho-fold.map
	modified:   stub/tmp/arm64-linux.elf-entry.bin.dump
	modified:   stub/tmp/arm64-linux.elf-fold.map
2017-03-14 20:08:28 -07:00
John Reiser 68a2b91ccb arm64 filter, relocation, defineSymbols
modified:   Makefile
	modified:   bele.h
	modified:   filter/ct.h
	modified:   filteri.cpp
	modified:   linker.cpp
	modified:   miniacc.h
	modified:   p_lx_elf.cpp
	modified:   stub/arm64-linux.elf-entry.h
	modified:   stub/src/arm64-linux.elf-entry.S
2017-03-05 21:05:13 -08:00
John Reiser 4089cc6e6f arm64-linux compiles
modified:   conf.h
	modified:   linker.cpp
	modified:   linker.h
	modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
	modified:   packmast.cpp
	modified:   stub/Makefile
	new file:   stub/arm64-linux.shlib-init.h
	new file:   stub/src/arm64-linux.shlib-init.S
	new file:   stub/tmp/arm64-linux.elf-entry.bin.dump
	new file:   stub/tmp/arm64-linux.elf-fold.map
	new file:   stub/tmp/arm64-linux.shlib-init.bin.dump
2017-03-05 18:07:29 -08:00
John Reiser 4e8848eeca Merge branch 'devel' into jreiser
Conflicts:
	src/stub/amd64-win64.pep.h
	src/stub/powerpc-linux.elf-entry.h
	src/stub/powerpc-linux.elf-fold.h
	src/stub/src/amd64-win64.pep.S
	src/stub/src/arch/powerpc/32/ppc_regs.h
	src/stub/src/arch/powerpc/64le/lzma_d.S
	src/stub/src/powerpc-linux.elf-entry.S
	src/stub/src/powerpc64le-darwin.dylib-entry.S
	src/stub/src/powerpc64le-darwin.macho-entry.S
	src/stub/src/powerpc64le-linux.elf-entry.S
	src/stub/src/powerpc64le-linux.kernel.vmlinux.S
	src/stub/tmp/amd64-win64.pep.bin.dump
	src/stub/tmp/powerpc-linux.elf-entry.bin.dump
	src/stub/tmp/powerpc-linux.elf-fold.map

	modified:   ../../.github/travis_testsuite_1.sh
	modified:   ../p_lx_elf.cpp
	modified:   ../p_unix.cpp
	modified:   ../p_unix.h
	modified:   amd64-win64.pep.h
	modified:   arm.v4a-linux.elf-fold.h
	modified:   arm.v5a-linux.elf-fold.h
	modified:   armeb.v4a-linux.elf-fold.h
	modified:   powerpc-darwin.dylib-entry.h
	modified:   powerpc-darwin.macho-entry.h
	copied:     powerpc-darwin.dylib-entry.h -> powerpc-linux.elf-entry.h
	modified:   powerpc-linux.elf-fold.h
	modified:   powerpc-linux.kernel.vmlinux.h
	modified:   powerpc64le-linux.elf-fold.h
	modified:   src/amd64-win64.pep.S
	modified:   src/arch/powerpc/32/bxx.S
	modified:   src/arch/powerpc/32/lzma_d.S
	modified:   src/arch/powerpc/32/nrv2d_d.S
	modified:   src/arch/powerpc/32/nrv2e_d.S
	modified:   src/arch/powerpc/32/ppc_regs.h
	modified:   src/arch/powerpc/64le/bxx.S
	modified:   src/arch/powerpc/64le/lzma_d.S
	modified:   src/arch/powerpc/64le/nrv2b_d.S
	modified:   src/arch/powerpc/64le/nrv2d_d.S
	modified:   src/arch/powerpc/64le/nrv2e_d.S
	modified:   src/arm.v4a-linux.elf-fold.S
	modified:   src/powerpc-darwin.macho-fold.S
	modified:   src/powerpc-linux.elf-entry.S
	modified:   src/powerpc-linux.elf-fold.S
	modified:   src/powerpc64le-darwin.dylib-entry.S
	modified:   src/powerpc64le-darwin.macho-entry.S
	modified:   src/powerpc64le-darwin.macho-fold.S
	modified:   src/powerpc64le-linux.elf-entry.S
	modified:   src/powerpc64le-linux.elf-fold.S
	modified:   src/powerpc64le-linux.kernel.vmlinux.S
	modified:   tmp/amd64-win64.pep.bin.dump
	modified:   tmp/arm.v4a-linux.elf-fold.map
	modified:   tmp/arm.v5a-linux.elf-fold.map
	modified:   tmp/armeb.v4a-linux.elf-fold.map
	modified:   tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   tmp/powerpc-linux.elf-entry.bin.dump
	modified:   tmp/powerpc-linux.elf-fold.map
	modified:   tmp/powerpc-linux.kernel.vmlinux.bin.dump
2017-03-01 08:14:13 -08:00
John Reiser 8c6133c115 Decompression stubs for arm64-linux (aarch)
modified:   stub/Makefile
	modified:   stub/arm64-darwin.macho-entry.h
	modified:   stub/arm64-darwin.macho-fold.h
	new file:   stub/arm64-linux.elf-entry.h
	new file:   stub/arm64-linux.elf-fold.h
	modified:   stub/scripts/xstrip.py
	modified:   stub/src/arch/arm64/v8/macros.S
	modified:   stub/src/arch/arm64/v8/nrv2b_d8.S
	modified:   stub/src/arch/arm64/v8/nrv2d_d8.S
	modified:   stub/src/arch/arm64/v8/nrv2e_d8.S
	new file:   stub/src/arm64-linux.elf-entry.S
	new file:   stub/src/arm64-linux.elf-fold.S
	new file:   stub/src/arm64-linux.elf-fold.lds
	new file:   stub/src/arm64-linux.elf-main.c
	modified:   stub/src/include/linux.h
2017-03-01 05:47:03 -08:00
John Reiser 483db31acd arm: Preserve 8-byte alignment of stack pointer
https://github.com/upx/upx/issues/60  (partial)
	modified:   stub/src/arm.v4a-linux.elf-fold.S

	modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/arm.v4a-linux.elf-fold.h
	modified:   stub/arm.v5a-linux.elf-fold.h
	modified:   stub/armeb.v4a-linux.elf-fold.h
	modified:   stub/tmp/arm.v4a-linux.elf-fold.map
	modified:   stub/tmp/arm.v5a-linux.elf-fold.map
	modified:   stub/tmp/armeb.v4a-linux.elf-fold.map
2017-02-14 20:36:45 -08:00
John Reiser 35dae3dab7 PowerPC 32-bit lzma stub defends against omitted linkage area.
https://github.com/upx/upx/issues/60
	modified:   stub/src/arch/powerpc/32/lzma_d.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S

	modified:   stub/powerpc-darwin.dylib-entry.h
	modified:   stub/powerpc-darwin.macho-entry.h
 [WTF?]	copied:     stub/powerpc-darwin.dylib-entry.h -> stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc-linux.kernel.vmlinux.h

	modified:   stub/tmp/powerpc-linux.elf-fold.map
	modified:   stub/tmp/powerpc-darwin.dylib-entry.bin.dump
	modified:   stub/tmp/powerpc-darwin.macho-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.kernel.vmlinux.bin.dump

	modified:   ../.github/travis_testsuite_1.sh
2017-02-12 16:23:57 -08:00
John Reiser 8232aedf78 unpackExtent() segregates rewrite() from write()
Fix the reported output file size when un-compressing.
Part of https://github.com/upx/upx/issues/60
	modified:   p_lx_elf.cpp
	modified:   p_unix.cpp
	modified:   p_unix.h
2017-02-11 15:26:27 -08:00
László Molnár d30a0a2e67 updated filter invocation in win64/pe 2017-02-06 14:31:16 +01:00
John Reiser d913fe508f Remove debugging jig
modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/powerpc-linux.elf-fold.S
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-02-05 15:41:52 -08:00
John Reiser 4029903301 Sync testsuite
modified:   ../.github/travis_testsuite_1.sh
2017-02-05 15:14:11 -08:00
John Reiser 5db7e826d3 Find and use AT_PAGESZ; forward from -entry to -fold.
Cleanup the runtime choice of PAGE_SIZE 4K or 64K
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/src/arch/powerpc/32/ppc_regs.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
2017-02-05 15:02:31 -08:00
John Reiser 7f3e7da7c7 Stubs LZMA_DEC00 and LZMA_ELF00 fall through; no "+80C" alignment.
https://github.com/upx/upx/issues/60  (partial)
addStubEntrySections() and getDecompressorSections()
	modified:   p_lx_elf.cpp
	modified:   p_mach.cpp
	modified:   packer_c.cpp
2017-02-05 14:52:09 -08:00
John Reiser 93cefde8fc Allow __PAGEZERO.vmsize to be 0x1000 on x86_64, as for "go"-language.
https://github.com/upx/upx/issues/59
	modified:   p_mach.cpp
	modified:   p_mach.h
2017-02-05 14:50:08 -08:00
John Reiser 02e7981e10 Merge and fix conflics
Conflicts:
	src/stub/src/arch/powerpc/64le/lzma_d.S
	src/stub/src/powerpc64le-darwin.dylib-entry.S
	src/stub/src/powerpc64le-darwin.macho-entry.S
	src/stub/src/powerpc64le-linux.elf-entry.S
	src/stub/src/powerpc64le-linux.kernel.vmlinux.S

	modified:   stub/src/arch/powerpc/32/lzma_d.S
2017-02-05 14:41:15 -08:00
John Reiser 0ecec10af0 Sync stubs and testsuite.
modified:   ../.github/travis_testsuite_1.sh
	modified:   stub/powerpc-linux.elf-entry.h
2017-02-05 14:26:18 -08:00
John Reiser 00b8cba987 typos
modified:   stub/src/powerpc-linux.elf-entry.S
2017-02-05 14:18:05 -08:00
John Reiser 8486bff918 PowerPC compare instructions: make cr0 explicit, put width ('w' or 'd') into mnemonic.
Easier to understand, caught a couple bugs in width.
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/32/nrv2d_d.S
	modified:   stub/src/arch/powerpc/32/nrv2e_d.S
	modified:   stub/src/arch/powerpc/64le/bxx.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/powerpc-darwin.macho-fold.S
	modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S
2017-02-05 14:00:19 -08:00
John Reiser 5305eb5b8a Sync stubs
modified:   stub/amd64-darwin.dylib-entry.h
	modified:   stub/amd64-darwin.macho-entry.h
	modified:   stub/amd64-darwin.macho-fold.h
	modified:   stub/amd64-linux.elf-fold.h
	modified:   stub/amd64-linux.shlib-init.h
	modified:   stub/amd64-win64.pep.h
	modified:   stub/powerpc-linux.elf-entry.h
	modified:   stub/powerpc-linux.elf-fold.h
	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S
	modified:   stub/tmp/amd64-win64.pep.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-entry.bin.dump
	modified:   stub/tmp/powerpc-linux.elf-fold.map
2017-02-05 13:37:01 -08:00
John Reiser 377a3bb7de More register definitions
modified:   stub/src/arch/powerpc/32/ppc_regs.h
2017-02-05 13:32:54 -08:00
John Reiser 5a47e8d2c6 Find and use AT_PAGESZ
modified:   stub/src/powerpc-linux.elf-entry.S
	modified:   stub/src/powerpc-linux.elf-fold.S
2017-02-05 13:31:17 -08:00
John Reiser 71f4cd7c85 Fix register usage conventions for amd64 unfilter
modified:   stub/src/amd64-win64.pep.S
	modified:   stub/src/arch/amd64/bxx.S
2017-02-05 13:29:59 -08:00
John Reiser f7751684af Stubs LZMA_DEC00 and LZMA_ELF00 fall through; no "+80C" alignment.
addStubEntrySections() and getDecompressorSections()
	modified:   p_lx_elf.cpp
	modified:   p_mach.cpp
	modified:   packer_c.cpp
2017-02-05 13:26:02 -08:00
John Reiser 59df1d39b2 Merge pull request #61 from tfauck/devel-thf
Following #51 pull with rerequested changes
2017-02-04 09:10:24 -08:00
John Reiser 7e5933e6a0 Merge branch 'devel' into devel-thf 2017-02-04 08:42:10 -08:00
John Reiser 2cefd34bb7 Allow __PAGEZERO.vmsize to be 0x1000 on x86_64, as for "go"-language.
https://github.com/upx/upx/issues/59
	modified:   p_mach.cpp
	modified:   p_mach.h
2017-02-03 15:12:40 -08:00
Thierry Fauck eac891dc3a Typo in .bss bzeroing
Rebuild of powerpc64le stubs

Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   stub/powerpc64le-darwin.dylib-entry.h
	modified:   stub/powerpc64le-darwin.macho-entry.h
	modified:   stub/powerpc64le-linux.elf-entry.h
	modified:   stub/powerpc64le-linux.elf-fold.h
	modified:   stub/powerpc64le-linux.kernel.vmlinux.h
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.elf-main.c
	modified:   stub/tmp/powerpc64le-linux.elf-fold.map
2017-02-03 10:57:05 +01:00
Thierry Fauck abd3599408 Explicitely specify cmp instructions to be 32 bits or 64bits on powerpc
(Thanks to John Reiser).

Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   src/arch/powerpc/32/bxx.S
	modified:   src/arch/powerpc/32/lzma_d.S
	modified:   src/arch/powerpc/64le/bxx.S
	modified:   src/arch/powerpc/64le/lzma_d.S
	modified:   src/arch/powerpc/64le/nrv2b_d.S
	modified:   src/arch/powerpc/64le/nrv2d_d.S
	modified:   src/arch/powerpc/64le/nrv2e_d.S
	modified:   src/powerpc64le-darwin.dylib-entry.S
	modified:   src/powerpc64le-darwin.macho-entry.S
	modified:   src/powerpc64le-darwin.macho-fold.S
	modified:   src/powerpc64le-linux.elf-entry.S
	modified:   src/powerpc64le-linux.elf-fold.S
	modified:   src/powerpc64le-linux.kernel.vmlinux.S
2017-02-03 10:55:14 +01:00
John Reiser 1bcd259c00 Merge branch 'devel' of https://github.com/upx/upx into devel 2017-02-01 17:17:31 -08:00
Thierry Fauck c4e835266c Typo in .bss bzeroing
Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   src/stub/powerpc64le-linux.elf-fold.h
	modified:   src/stub/src/powerpc64le-linux.elf-fold.S
	modified:   src/stub/src/powerpc64le-linux.elf-main.c
	modified:   src/stub/tmp/powerpc64le-linux.elf-fold.map
2017-01-30 18:53:34 +01:00
Thierry Fauck 685953f6a5 Explicitely specify cmp instructions to be 32 bits or 64bits on powerpc
Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   stub/src/arch/powerpc/32/bxx.S
	modified:   stub/src/arch/powerpc/64le/bxx.S
	modified:   stub/src/arch/powerpc/64le/lzma_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2b_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2d_d.S
	modified:   stub/src/arch/powerpc/64le/nrv2e_d.S
	modified:   stub/src/powerpc64le-darwin.dylib-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-entry.S
	modified:   stub/src/powerpc64le-darwin.macho-fold.S
	modified:   stub/src/powerpc64le-linux.elf-entry.S
	modified:   stub/src/powerpc64le-linux.elf-fold.S
	modified:   stub/src/powerpc64le-linux.kernel.vmlinux.S
2017-01-30 00:34:45 +01:00
John Reiser 03fffbc724 Re-base to upx-3.93
modified:   src/stub/src/arch/amd64/bxx.S
2017-01-29 06:58:03 -08:00
Markus F.X.J. Oberhumer e1a8c932ee Cleanup snprintf.cpp. 2017-01-29 14:11:46 +01:00
Markus F.X.J. Oberhumer 1aa2a6b054 Add missing src/stub/tmp/*.map files to repo. 2017-01-29 14:10:12 +01:00
Markus F.X.J. Oberhumer 1ad96c9c81 Update testsuite checksums caused by version bump. 2017-01-29 14:08:02 +01:00
Markus F.X.J. Oberhumer f69199909f Post-release version bump. 2017-01-29 14:05:00 +01:00
John Reiser d063e77040 Update checksums for testsuite.
modified:   .github/travis_testsuite_1.sh
2017-01-29 14:01:57 +01:00
John Reiser bf3ddeb1eb Rebuild stubs.
modified:   amd64-darwin.dylib-entry.h
	modified:   amd64-darwin.macho-entry.h
	modified:   amd64-darwin.macho-fold.h
	modified:   amd64-linux.elf-fold.h
	modified:   amd64-linux.kernel.vmlinux.h
	modified:   amd64-linux.shlib-init.h
	modified:   amd64-win64.pep.h
	modified:   i386-bsd.elf-entry.h
	modified:   i386-bsd.elf.execve-entry.h
	modified:   i386-darwin.dylib-entry.h
	modified:   i386-darwin.macho-entry.h
	modified:   i386-dos32.djgpp2.h
	modified:   i386-dos32.tmt.h
	modified:   i386-dos32.watcom.le.h
	modified:   i386-linux.elf-entry.h
	modified:   i386-linux.elf.execve-entry.h
	modified:   i386-linux.elf.interp-entry.h
	modified:   i386-linux.kernel.vmlinux.h
	modified:   i386-linux.kernel.vmlinuz.h
	modified:   i386-linux.shlib-init.h
	modified:   i386-netbsd.elf-entry.h
	modified:   i386-win32.pe.h
	modified:   tmp/amd64-darwin.dylib-entry.bin.dump
	modified:   tmp/amd64-darwin.macho-entry.bin.dump
	modified:   tmp/amd64-linux.shlib-init.bin.dump
	modified:   tmp/amd64-win64.pep.bin.dump
2017-01-29 14:01:57 +01:00
John Reiser fc261ad8cd Smaller by 7 bytes; also slower.
https://github.com/upx/upx/issues/43
	modified:   bxx.S
2017-01-29 14:01:56 +01:00
John Reiser 90fc018295 Avoid sigsegv after "patchelf --set-rpath"
https://github.com/upx/upx/issues/47
Enhancement not yet implemented: non-adjacent ElfXX_Ehdr and ElfXX_Phdr.
	modified:   p_unix.cpp
2017-01-29 14:01:56 +01:00
John Reiser cdc01d9a69 linux.sh/i386 interpreter.e_machine must be EM_386; else execve()
https://github.com/upx/upx/issues/53
	modified:   stub/i386-linux.elf.shell-fold.h
	modified:   stub/src/i386-linux.elf.shell-fold.S
	modified:   stub/src/i386-linux.elf.shell-main.c
2017-01-29 14:01:56 +01:00
John Reiser da7e76c07d Document location of checksums for testsuite.
modified:   Makefile
2017-01-29 14:01:56 +01:00
John Reiser ba9118aa58 Bug in unfilter on x86* when region ends in 32-bit displacement.
https://github.com/upx/upx/issues/43
	modified:   stub/src/arch/amd64/bxx.S
	modified:   stub/src/arch/i386/macros.S
	plus all the stubs that use them
2017-01-29 14:01:56 +01:00
Markus F.X.J. Oberhumer fdce705e55 Bump release date. 2017-01-29 12:07:00 +01:00
Markus F.X.J. Oberhumer 81268e7064 Update Travis. 2017-01-28 23:29:12 +01:00
Markus F.X.J. Oberhumer f502f41359 Update conf.h. 2017-01-28 22:39:42 +01:00
Markus F.X.J. Oberhumer 34c9cfb6b0 Don't use "long". 2017-01-28 22:39:42 +01:00
Markus F.X.J. Oberhumer 6da1790c46 New ACC version. 2017-01-28 22:39:42 +01:00
Markus F.X.J. Oberhumer d333c940da Update Travis. 2017-01-17 01:59:13 +01:00
Markus F.X.J. Oberhumer c940d2906f Mention win64/pe in help usage text. 2017-01-17 01:56:58 +01:00
Markus F.X.J. Oberhumer ac4b51ba85 Update Travis. 2017-01-15 23:25:39 +01:00
Markus F.X.J. Oberhumer ea7a1ad2c7 Bump version date. 2017-01-15 15:51:33 +01:00
Markus F.X.J. Oberhumer 45ddd6a68d Enable wildcard expansion on newer mingw versions. 2017-01-15 15:47:53 +01:00
Markus F.X.J. Oberhumer acd99364e0 Update Travis. 2017-01-15 11:10:59 +01:00
Markus F.X.J. Oberhumer 14710dea55 Replace some negative enum constants with "static const unsigned" vars. 2017-01-03 12:57:10 +01:00
Markus F.X.J. Oberhumer 5d3be8da1d Silence a MSVC warning. 2017-01-03 12:37:35 +01:00
Markus F.X.J. Oberhumer 3026821f9f Update testsuite checksums caused by version bump. 2017-01-03 12:16:51 +01:00
Markus F.X.J. Oberhumer fba51dabd0 Bump UPX_VERSION_DATE. 2017-01-03 12:06:17 +01:00
Markus F.X.J. Oberhumer c4da5e81fa Welcome 2017. 2017-01-03 12:02:07 +01:00
Markus F.X.J. Oberhumer bc80d81432 Silence a bogus scan-build warning. 2016-12-30 23:59:31 +01:00
László Molnár 67797efead fixed relocation handling regression in win32/pe (issue #38) 2016-12-30 23:18:32 +01:00
László Molnár c7cb036536 fixed data corruption in import handling (issue #32,#34) 2016-12-30 21:31:50 +01:00
Markus F.X.J. Oberhumer 0ccbc5f139 Silence some bogus coverity warnings. 2016-12-21 19:03:01 +01:00
Markus F.X.J. Oberhumer 2a6bbcaf8f Fix a p_w64pep.cpp issue detected by coverity. 2016-12-21 19:01:55 +01:00
Markus F.X.J. Oberhumer d46a8438ba Remove unused option "--script=". 2016-12-19 23:44:10 +01:00
Markus F.X.J. Oberhumer cc9d19da19 Remove unused PackLinuxI386sep. 2016-12-19 23:29:42 +01:00
Markus F.X.J. Oberhumer 6e6aa6fd6d Update doc/Makefile. 2016-12-19 23:23:59 +01:00
Markus F.X.J. Oberhumer 61652a2989 Remove unused PackSolarisSparc. 2016-12-19 23:23:25 +01:00
Markus F.X.J. Oberhumer edd7503607 Update executable format constants. 2016-12-19 23:18:38 +01:00
Markus F.X.J. Oberhumer c9d6dab401 Remove unused p_elks.cpp. 2016-12-19 23:14:08 +01:00
Markus F.X.J. Oberhumer d303038bcb Remove unused p_vxd.h. 2016-12-19 23:12:05 +01:00
Markus F.X.J. Oberhumer 0a0e7c3b7c Remove unused p_w16ne.cpp. 2016-12-19 23:11:00 +01:00
Markus F.X.J. Oberhumer 0b4ac35bc9 Tune some MSVC warnings. 2016-12-19 22:57:43 +01:00
László Molnár c51864ca39 fixed TLS callback handling for PE64 2016-12-18 23:34:27 +01:00
John Reiser a1cabd5a68 Avoid warning C4805: '|': unsafe mix of type 'bool' and type 'unsigned int' in operation
modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2016-12-18 11:32:47 -08:00
John Reiser 9c1bc99d7a Avoid warning C4146: unary minus operator applied to unsigned type, result still unsigned
modified:   p_mach.cpp
2016-12-16 10:59:51 -08:00
Markus F.X.J. Oberhumer c05fedcb76 Update Travis. 2016-12-14 16:27:51 +01:00
Markus F.X.J. Oberhumer e11beeae4b Update testsuite checksums caused by version bump. 2016-12-11 18:31:01 +01:00
Markus F.X.J. Oberhumer 4749e0d71e Post-release version bump. 2016-12-11 17:50:03 +01:00
Markus F.X.J. Oberhumer 1c01b77a71 Bump release date. 2016-12-11 16:12:06 +01:00
Markus F.X.J. Oberhumer 1dd8ad3685 Remove outdated TODO file. 2016-12-11 15:58:43 +01:00
John Reiser d6f6350b54 Remove comment about PalmPilot; add MacOS; add future AArch64; add John
modified:   README
	modified:   README.1ST
2016-12-01 21:51:04 -08:00
Markus F.X.J. Oberhumer 4f3b85e604 Update NEWS. 2016-12-01 00:45:25 +01:00
Markus F.X.J. Oberhumer efd5bc24b0 Bump tentative release date. 2016-12-01 00:40:54 +01:00
Markus F.X.J. Oberhumer a1d5dfa1ac Update Travis. 2016-12-01 00:36:49 +01:00
Markus F.X.J. Oberhumer 597c2ba180 Add .github/ISSUE_TEMPLATE.md. 2016-12-01 00:34:28 +01:00
Markus F.X.J. Oberhumer 2c2fb1b70b Update Travis. 2016-11-24 14:27:49 +01:00
John Reiser fc1287659a de-tab (comments, too?)
modified:   stub/src/powerpc-darwin.macho-upxmain.c
2016-11-21 14:02:57 -08:00
John Reiser 1a76630594 Mention support for MacOS "Sierra"
modified:   NEWS
2016-11-21 08:30:34 -08:00
John Reiser 322f682d32 re-generate stub
modified:   powerpc-darwin.macho-upxmain.h
2016-11-21 08:26:08 -08:00
John Reiser 0e329336fc Merge branch 'devel' of https://github.com/upx/upx into devel 2016-11-21 08:23:05 -08:00
John Reiser b33bdabbb6 powerpc Mach-o cleanup
modified:   stub/powerpc-darwin.macho-upxmain.exe
	new file:   stub/src/powerpc-darwin.macho-upxmain.c
2016-11-21 08:22:09 -08:00
Markus F.X.J. Oberhumer 27d30121ab Bump tentative release date. 2016-11-20 15:07:46 +01:00
Markus F.X.J. Oberhumer 345278f309 Re-enable assertion in xstrip.py. 2016-11-20 15:07:46 +01:00
Markus F.X.J. Oberhumer 4953e77161 upx-clang-format -i linker.cpp linker.h 2016-11-20 14:20:36 +01:00
Markus F.X.J. Oberhumer 8d61e037f9 Cleanups. 2016-11-20 14:17:21 +01:00
Markus F.X.J. Oberhumer 33a51e69bf Update submodules. 2016-11-20 13:56:42 +01:00
Markus F.X.J. Oberhumer d5dd9bbf24 Update Travis. 2016-11-20 13:51:53 +01:00
Markus F.X.J. Oberhumer 8772e52513 Remove old cruft. 2016-11-20 13:51:53 +01:00
John Reiser 9e1631ad4f avoid null section name and zero alignment; enforce record === line
modified:   linker.cpp
	modified:   linker.h
2016-11-19 17:38:23 -08:00
John Reiser 134b829d59 prevent warning C4319: '~': zero extending 'const unsigned int' to 'upx_uint64_t' of greater size
modified:   linker.cpp
	modified:   p_lx_elf.cpp
	modified:   pefile.cpp
2016-11-19 16:46:01 -08:00
John Reiser 3df7d26101 propagate cpusubtype
modified:   p_mach.cpp
	modified:   p_mach.h
2016-11-14 05:06:29 -08:00
John Reiser cf56086f06 powerpc-darwin.macho-: remove debugging 'trap' :-)
modified:   stub/powerpc-darwin.macho-upxmain.exe
	modified:   stub/powerpc-darwin.macho-upxmain.h
	modified:   stub/src/powerpc-darwin.macho-upxsubr.S
2016-11-12 20:13:12 -08:00
John Reiser a72aca4379 powerpc (32-bit) works on MacOS using Sierra-compatible strategy.
modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   stub/powerpc-darwin.macho-entry.h
	modified:   stub/powerpc-darwin.macho-upxmain.exe
	modified:   stub/powerpc-darwin.macho-upxmain.h
	modified:   stub/src/powerpc-darwin.macho-entry.S
	modified:   stub/src/powerpc-darwin.macho-upxsubr.S
	modified:   stub/tmp/powerpc-darwin.macho-entry.bin.dump
2016-11-12 19:48:19 -08:00
John Reiser edb0b7519a Merge branch 'devel' of https://github.com/upx/upx into devel 2016-11-09 06:08:44 -08:00
Markus F.X.J. Oberhumer 3a3248c88c Merge pull request #24 from tfauck/devel
powerpc64le -fpic dynamically linked binary support
2016-11-09 10:57:33 +01:00
John Reiser 3f14b9dab7 LC_UNIXTHREAD in ::pass4
modified:   p_mach.cpp
2016-11-08 17:53:02 -08:00
Thierry Fauck b1c07c22ce powerpc64le -fpic dynamically linked binary support
Update stub for -fpic support
 Handle 64K page in p_lx_elf.cpp

Signed-off-by: Thierry Fauck <tfauck@free.fr>
2016-11-08 18:29:10 +01:00
John Reiser 3b2c411274 Work on 32-bit PowerPC
modified:   p_mach.cpp
	modified:   p_mach.h
2016-11-06 20:39:01 -08:00
John Reiser e418af1ccd Try to fix 32-bit PowerPC.
modified:   p_mach.cpp
	modified:   p_mach.h
	modified:   stub/Makefile
	new file:   stub/powerpc-darwin.macho-upxmain.exe
	new file:   stub/powerpc-darwin.macho-upxmain.h
	new file:   stub/src/powerpc-darwin.macho-upxsubr.S
2016-11-06 17:59:16 -08:00
John Reiser 7dc004acb3 bug in other-endian ::canPack and ::canUnpack
modified:   p_mach.cpp
2016-11-05 14:02:51 -07:00
John Reiser 2635472896 more unpacking for Mach-o (pre-3.91 ?)
modified:   p_mach.cpp
	modified:   p_mach.h
2016-11-05 13:16:16 -07:00
John Reiser 5c0340f9ae Merge branch 'devel' of https://github.com/upx/upx into devel 2016-10-19 15:20:04 -07:00
John Reiser c2c970ee33 pacify c++-analyzer
modified:   p_lx_elf.cpp
2016-10-19 15:19:33 -07:00
Markus F.X.J. Oberhumer b52dabe091 Update Travis. 2016-10-19 15:21:40 +02:00
Markus F.X.J. Oberhumer 3fa2db8d6f Update testsuite checksum to match current version. UNTESTED. 2016-10-19 15:03:25 +02:00
Markus F.X.J. Oberhumer 1e7950f671 Rebuild src/stubs from current sources. UNTESTED. 2016-10-19 14:59:33 +02:00
Thierry Fauck 8fde05191a powerpc: Omit -Os flag to avoid use of savegrp*
Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   stub/Makefile
2016-10-19 14:41:18 +02:00
John Reiser 2557de6c4e amd64 changes for brk() fix. powerpc changes UNKNOWN!
Also, filename of expected checksums begins with dot.
	modified:   .github/travis_testsuite_1.sh
2016-10-16 07:31:26 -07:00
John Reiser 44328aee76 fix brk() problem when is_big: stub must munmap all_pages
https://github.com/upx/upx/issues/5
	modified:   p_lx_elf.cpp
	modified:   p_lx_elf.h
2016-10-15 14:06:56 -07:00
Markus F.X.J. Oberhumer f606b5879b Update Travis. 2016-10-11 22:33:45 +02:00
Markus F.X.J. Oberhumer 83607119df Merge pull request #14 from tfauck/powerpc-fixes
POWERPC: Allocate 4K / 64K pages depending on processor type.
2016-10-11 16:11:40 +02:00
Thierry Fauck 9b86e68268 POWERPC: Allocate 4K / 64K pages depending on processor type.
Powerpc: ppc64le processor - Fix nrv2x-d.S compression routines
xstrip - disallow assert at line 178

Signed-off-by: Thierry Fauck <tfauck@free.fr>

	modified:   powerpc-darwin.dylib-entry.h
	modified:   powerpc-darwin.macho-entry.h
	modified:   powerpc-darwin.macho-fold.h
	modified:   powerpc-linux.elf-entry.h
	modified:   powerpc-linux.elf-fold.h
	modified:   powerpc-linux.kernel.vmlinux.h
	modified:   powerpc64le-darwin.dylib-entry.h
	modified:   powerpc64le-darwin.macho-entry.h
	modified:   powerpc64le-darwin.macho-fold.h
	modified:   powerpc64le-linux.elf-entry.h
	modified:   powerpc64le-linux.elf-fold.h
	modified:   powerpc64le-linux.kernel.vmlinux.h
	modified:   scripts/xstrip.py
	modified:   src/arch/powerpc/64le/nrv2b_d.S
	modified:   src/arch/powerpc/64le/nrv2d_d.S
	modified:   src/arch/powerpc/64le/nrv2e_d.S
	modified:   src/powerpc-linux.elf-entry.S
	modified:   src/powerpc-linux.elf-fold.S
	modified:   src/powerpc-linux.elf-main.c
	modified:   tmp/powerpc-linux.elf-entry.bin.dump
	modified:   tmp/powerpc64le-darwin.dylib-entry.bin.dump
	modified:   tmp/powerpc64le-darwin.macho-entry.bin.dump
	modified:   tmp/powerpc64le-linux.elf-entry.bin.dump
	modified:   tmp/powerpc64le-linux.kernel.vmlinux.bin.dump
2016-10-11 09:52:40 -04:00
John Reiser d688a05ac7 DT_JMPREL vanished (binutils-2.26.1); check all DT_RELA.
modified:   p_elf_enum.h
	modified:   p_lx_elf.cpp
2016-10-09 21:50:45 -07:00
Markus F.X.J. Oberhumer 97e975b4f6 Update Travis so that is works with bash 3 again. 2016-10-09 19:53:04 +02:00
John Reiser 9dd0e3ce4f c++-analyzer finds the speck but misses the log.
modified:   p_mach.cpp
2016-10-09 09:34:33 -07:00
John Reiser ca2293f6d3 c++-analyzer needs improved range tracking.
modified:   p_lx_elf.cpp
2016-10-09 09:33:35 -07:00
Markus F.X.J. Oberhumer 0cd1ef0c7a Update Travis for OSX. 2016-10-09 13:56:45 +02:00
Markus F.X.J. Oberhumer b0207ce524 Some refactoring. NFC. 2016-10-09 13:23:19 +02:00
Markus F.X.J. Oberhumer fab0c3b09d testsuite: rename tests. 2016-10-09 13:00:43 +02:00
Markus F.X.J. Oberhumer 8b35dd3358 testsuite: allow easy updating of the checksums by writing .sha256sums.recreate. 2016-10-09 12:36:22 +02:00
László Molnár cadcbb27eb travis checksums updated 2016-10-09 12:13:22 +02:00
László Molnár 297d44c614 PE: fixed file data alignment problem 2016-10-09 11:29:29 +02:00
Markus F.X.J. Oberhumer 22178f2224 Minor cleanups. 2016-10-09 03:12:19 +02:00
Markus F.X.J. Oberhumer 554f8a376c Update testsuite for previous commit. 2016-10-09 03:00:49 +02:00
Markus F.X.J. Oberhumer 4157affbd7 pefile: make kernelDLL() return the same strings as in UPX 3.91. 2016-10-09 02:53:20 +02:00
Markus F.X.J. Oberhumer 4b991203df pefile.cpp: make import sorting independent from qsort() internals. 2016-10-09 00:48:40 +02:00
Markus F.X.J. Oberhumer 38a265741c Ongoing cleanups. 2016-10-08 18:49:14 +02:00
Markus F.X.J. Oberhumer 56eb02280f Update Travis. 2016-10-07 23:07:25 +02:00
Markus F.X.J. Oberhumer ed900b0476 More thorough use of O_BINARY. 2016-10-07 15:04:12 +02:00
John Reiser 42206364e5 Reduce Mach-o headers
modified:   p_mach.cpp
2016-10-06 16:06:24 -07:00
John Reiser 82d9bb8f51 Fix namespace typedefs for Mach-o structs [upx_uint32_t ==> Word]
modified:   p_mach.cpp
	modified:   p_mach.h
2016-10-06 14:00:05 -07:00
John Reiser 923a9d3f9b Template PackMackBase<T>::pack3. Use more templates for ::pack4.
modified:   p_mach.cpp
	modified:   p_mach.h
2016-10-06 08:55:09 -07:00
John Reiser ae7660068b Merge branch 'devel' of https://github.com/upx/upx into devel 2016-10-06 07:49:52 -07:00
John Reiser f466c1d764 Cosmetic
modified:   p_mach.cpp
2016-10-06 07:49:37 -07:00
Markus F.X.J. Oberhumer 6e76f8ef3a Don't use variable length arrays (VLA). 2016-10-06 13:04:46 +02:00
Markus F.X.J. Oberhumer b3a8d02caf Cosmetic cleanups. 2016-10-06 12:31:03 +02:00
Markus F.X.J. Oberhumer 022ba32c1a Improve robustness of seek() by adding some sanity checks. 2016-10-06 12:11:32 +02:00
Markus F.X.J. Oberhumer 8f5e89c900 Update testsuite. 2016-10-06 11:19:31 +02:00
Markus F.X.J. Oberhumer d335d7bafd p_mach.h: fix C++ syntax. 2016-10-06 09:51:58 +02:00
John Reiser 1f51ef7df6 Merge branch 'devel' of https://github.com/upx/upx into devel 2016-10-05 17:16:53 -07:00
Markus F.X.J. Oberhumer ec082ee023 Cosmetic cleanup. 2016-10-06 00:45:42 +02:00
Markus F.X.J. Oberhumer a6bc271e0d Update testsuite. 2016-10-06 00:43:54 +02:00
John Reiser 791fd9199e Preserve alignment in .text
modified:   p_mach.cpp
2016-10-05 12:52:52 -07:00
John Reiser 9e8baf1914 i386 for MacOS 10.12 "Sierra"
modified:   p_mach.cpp
	modified:   stub/i386-darwin.macho-entry.h
	modified:   stub/src/i386-darwin.macho-entry.S
	modified:   stub/tmp/i386-darwin.macho-entry.bin.dump
2016-10-05 11:25:16 -07:00
John Reiser 64b7080532 Merge branch 'devel' of https://github.com/upx/upx into devel 2016-10-04 21:05:44 -07:00
John Reiser 8fd5479f32 Templates for ::pack4; i386 now packs, needs work before running.
modified:   p_mach.cpp
	modified:   p_mach.h
	new file:   stub/i386-darwin.macho-upxmain.exe
	new file:   stub/i386-darwin.macho-upxmain.h
	new file:   stub/src/i386-darwin.macho-upxmain.c
2016-10-04 19:58:04 -07:00
Markus F.X.J. Oberhumer 04eb9c02c3 Update testsuite checksums to match recent changes. Sigh. 2016-10-05 01:35:45 +02:00
John Reiser 07b41b9bc3 i386-darwin.macho-upxmain.h
modified:   Makefile
2016-10-04 10:48:44 -07:00
John Reiser 8ebadfafe9 Standalone bswap, bzero, syscalls for i386-darwin.macho
new file:   i386-darwin.macho-upxsubr.S
2016-10-04 10:46:59 -07:00
John Reiser 3283896e4b Templatize ::buildLoader
modified:   p_mach.cpp
	modified:   p_mach.h
2016-10-04 08:54:55 -07:00
John Reiser b444bcf418 On the way to templates and mach-o/i386.
modified:   p_mach.cpp
	modified:   p_mach.h
2016-10-03 22:00:26 -07:00
Markus F.X.J. Oberhumer 13034577fc Fix previous commit. 2016-10-04 00:56:01 +02:00
Markus F.X.J. Oberhumer 9feefc2e7f Makefile: added run-testsuite target. 2016-10-04 00:42:24 +02:00
John Reiser a5393e985d Merge branch 'devel' of https://github.com/upx/upx into devel 2016-10-03 09:42:48 -07:00
John Reiser e3fe0dc89b Avoid bug in ld-linux to set brk(0) when .p_align is large.
modified:   p_lx_elf.cpp
2016-10-03 09:41:05 -07:00
Markus F.X.J. Oberhumer 42d49e9d50 Update Makefile and check_whitespace.sh. 2016-10-03 13:13:13 +02:00
Markus F.X.J. Oberhumer 06eb244800 Add check_whitespace_git.sh. Minor cleanups. 2016-10-03 04:47:02 +02:00
John Reiser 870cdfa51f Merge branch 'devel' of https://github.com/upx/upx into devel 2016-10-02 10:47:59 -07:00
John Reiser 93787c74ee Rewrite linfo in output file.
modified:   p_mach.cpp
2016-10-02 10:47:37 -07:00
Markus F.X.J. Oberhumer 945323fe15 Fix a compilation warning. 2016-10-02 15:54:14 +02:00
Markus F.X.J. Oberhumer 5e41e69b27 Remove trailing whitespace from p_mach.cpp. 2016-10-02 15:48:56 +02:00
Markus F.X.J. Oberhumer 9d14185f7d Add check_whitespace.sh and call it from Makefile. Update Travis. 2016-10-02 15:46:57 +02:00
John Reiser 0f74162551 Decompression works after codesign. (Still more is possible.)
modified:   p_mach.cpp
2016-10-01 20:38:25 -07:00
John Reiser 00b1ff1ff6 Apple codesign now works.
modified:   p_mach.cpp
2016-10-01 17:40:32 -07:00
John Reiser 977024ea94 Fix clang scan-build errors.
modified:   p_lx_elf.cpp
2016-10-01 17:38:16 -07:00
Markus F.X.J. Oberhumer 3534ed21d7 Update Travis and AppVeyor. 2016-10-01 20:00:48 +02:00
Markus F.X.J. Oberhumer ee093e5232 Minor cleanups. 2016-10-01 19:59:10 +02:00
Markus F.X.J. Oberhumer 807ab8d19f Update Travis and AppVeyor. 2016-09-29 09:54:07 +02:00
Markus F.X.J. Oberhumer 81f3ff098f Update download links to point to github. 2016-09-29 00:37:11 +02:00
Markus F.X.J. Oberhumer 85a5759afb Update AppVeyor to also run the testsuite. 2016-09-29 00:18:22 +02:00
Markus F.X.J. Oberhumer 490e7a56a5 Remove travis_testsuite_2.sh. 2016-09-28 23:02:06 +02:00
Markus F.X.J. Oberhumer e41c475671 Use calloc instead of malloc to pacify valgrind. 2016-09-28 21:30:38 +02:00
Markus F.X.J. Oberhumer b0841268bd Update Travis testsuite. 2016-09-28 20:18:05 +02:00
Markus F.X.J. Oberhumer b9b3b67b95 Silence some pedantic compilation warnings about unused results. 2016-09-28 13:50:50 +02:00
Markus F.X.J. Oberhumer 0d57d2cfe3 Remove old cruft. 2016-09-28 13:39:49 +02:00
Markus F.X.J. Oberhumer 32de5d0d7f Fix msvc build. 2016-09-28 13:34:39 +02:00
Markus F.X.J. Oberhumer 51eab2a4b7 Update Makefile configuration variables. 2016-09-28 13:07:39 +02:00
Markus F.X.J. Oberhumer 93cf170253 Update NEWS. 2016-09-28 12:31:44 +02:00
Markus F.X.J. Oberhumer f7554374ab Update email address. 2016-09-28 12:25:01 +02:00
Markus F.X.J. Oberhumer b4870f62c9 Add option --prefer-ucl. 2016-09-28 11:57:15 +02:00
Markus F.X.J. Oberhumer f1d713ebf6 Silence some pedantic warnings. 2016-09-28 11:29:20 +02:00
Markus F.X.J. Oberhumer 4134a512b9 Update Travis. 2016-09-28 11:13:46 +02:00
Markus F.X.J. Oberhumer cf998f945c Add support for AppVeyor CI. 2016-09-27 20:30:54 +02:00
Markus F.X.J. Oberhumer a7386238dd Update Travis. 2016-09-27 20:29:04 +02:00
Markus F.X.J. Oberhumer 6b39d122a6 Support MSVC. 2016-09-27 20:23:23 +02:00
Markus F.X.J. Oberhumer a0582c5380 pefile.cpp: don't use VLA. 2016-09-27 20:19:43 +02:00
Markus F.X.J. Oberhumer 1f37112969 Moving to github. 2016-09-27 08:41:11 +02:00
Markus F.X.J. Oberhumer 361958db76 Check endian in assertPacker(). 2016-09-26 15:38:04 +02:00
Markus F.X.J. Oberhumer 8bc7880b19 Improve gitrev handling. 2016-09-26 15:32:01 +02:00
Markus F.X.J. Oberhumer ceddf29586 Update Travis. 2016-09-26 15:32:01 +02:00
Markus F.X.J. Oberhumer 3fc78e21bc Stop using Circle CI. 2016-09-26 15:31:49 +02:00
John Reiser 48e00b371c Move UPX_F_MACH_PPC64LE and friends to 38 et seq, the little-endian side.
modified:   conf.h
2016-09-26 05:53:11 -07:00
Markus F.X.J. Oberhumer aee52d3880 Improve gitrev handling. 2016-09-26 10:35:29 +02:00
Markus F.X.J. Oberhumer bd54499537 Update Travis. 2016-09-26 10:07:48 +02:00
Markus F.X.J. Oberhumer e6da9e8d1a Small snprintf.cpp update. 2016-09-26 09:12:53 +02:00
Markus F.X.J. Oberhumer 156ca03b67 Silence some pedantic compiler warnings. 2016-09-26 09:12:53 +02:00
Markus F.X.J. Oberhumer 3f4419b177 Update stub/src for recent changes. 2016-09-26 09:12:53 +02:00
Markus F.X.J. Oberhumer 676f860d7d Normalize whitespace. 2016-09-26 09:12:53 +02:00
Markus F.X.J. Oberhumer 5ce93ae0c7 Update submodules. 2016-09-26 09:12:53 +02:00
László Molnár 43231826b9 fixed address sanitizer problem (untested) 2016-09-26 08:56:23 +02:00
Markus F.X.J. Oberhumer 899b393fcc Add support for Circle CI. 2016-09-25 17:18:29 +02:00
Markus F.X.J. Oberhumer 5c3e02d2f0 Update Travis CI. 2016-09-25 17:17:14 +02:00
Markus F.X.J. Oberhumer a29064107e Bump version date. 2016-09-25 14:01:40 +02:00
Markus F.X.J. Oberhumer 4cdc969801 Update Travis. 2016-09-25 14:00:49 +02:00
Markus F.X.J. Oberhumer 68159d457e Update Travis. 2016-09-25 09:43:30 +02:00
Markus F.X.J. Oberhumer daafc29d2b Add support for UPX_VERSION_GITREV. Some cleanups. 2016-09-25 09:41:26 +02:00
John Reiser 3c786acf2b Fix bug in Mach-O stub.
modified:   amd64-darwin.macho-upxmain.exe
	modified:   amd64-darwin.macho-upxmain.h
	modified:   src/amd64-darwin.macho-upxmain.c
2016-09-24 19:44:00 -07:00
John Reiser 53c3817d4d Allow longer Mach-O headers.
modified:   amd64-darwin.macho-upxmain.exe
2016-09-24 17:26:00 -07:00
John Reiser 9109254488 Allow longer Mach-O headers.
modified:   src/amd64-darwin.macho-upxmain.c
2016-09-24 17:21:07 -07:00
John Reiser df19f0d5ec Try harder to decompress Mach-O I386, too.
modified:   p_mach.cpp
	modified:   p_mach.h
2016-09-24 09:15:10 -07:00
John Reiser 093362e479 Merge branch 'devel' of https://github.com/upx/upx into devel 2016-09-24 06:44:19 -07:00
John Reiser 7826a3652b Try harder to decompress Mach-O, because pirates.
modified:   p_mach.cpp
	modified:   p_mach.h
2016-09-24 06:43:16 -07:00
Markus F.X.J. Oberhumer c27b7e52e1 Small Makefile update. 2016-09-24 13:49:07 +02:00
Markus F.X.J. Oberhumer 6f79cbb2a6 Update Travis. 2016-09-24 12:53:01 +02:00
Markus F.X.J. Oberhumer 6f33929f91 Cleanups. 2016-09-24 12:10:46 +02:00
Markus F.X.J. Oberhumer 2e8b649195 Update Travis. 2016-09-24 11:19:12 +02:00
Markus F.X.J. Oberhumer 3841be7e20 Remove *.bin files. 2016-09-24 11:18:18 +02:00
John Reiser 2c28521283 NetBSDElf32x86 should not impersonate [i386-linux.elf, linux/i386] 2016-09-23 19:31:26 -07:00
László Molnár 1c735cc204 fixed too strict checks in resource handling 2016-09-22 22:17:08 +02:00
Markus F.X.J. Oberhumer f0b13ae8e4 Add .editorconfig. 2016-09-22 18:29:02 +02:00
Markus F.X.J. Oberhumer b1a2f8fec0 Update vim modelines. 2016-09-22 18:17:37 +02:00
Markus F.X.J. Oberhumer 83828aa8a3 Update vim modelines. 2016-09-22 17:29:43 +02:00
Markus F.X.J. Oberhumer 4eb81b4d66 Update stub/scripts. 2016-09-22 14:27:57 +02:00
Markus F.X.J. Oberhumer 96d9968db5 Welcome 2016. 2016-09-22 14:07:14 +02:00
Markus F.X.J. Oberhumer 2781e37ec0 Mark version as "BETA". 2016-09-22 14:05:08 +02:00
Markus F.X.J. Oberhumer 6d61e773b5 Bump version year. 2016-09-22 14:02:44 +02:00
Markus F.X.J. Oberhumer c5171114d1 Clean up stub/Makefile. NFC. 2016-09-22 13:11:14 +02:00
Markus F.X.J. Oberhumer 0ca0a832de stub: arm renaming. 2016-09-22 12:36:00 +02:00
Markus F.X.J. Oberhumer aef54a4bfd Update source for previous rename. 2016-09-22 12:12:43 +02:00
Markus F.X.J. Oberhumer 4c473acfec stub: arm renaming. 2016-09-22 12:05:53 +02:00
Markus F.X.J. Oberhumer 0de41e97ac Update source for previous rename. 2016-09-22 11:54:44 +02:00
Markus F.X.J. Oberhumer 0e52ab3f90 stub: arm renaming. 2016-09-22 11:52:50 +02:00
Markus F.X.J. Oberhumer 797679b42c stub: arm renaming. 2016-09-22 11:43:23 +02:00
Markus F.X.J. Oberhumer 1bc8b6f46e Update source for previous rename. 2016-09-22 11:29:12 +02:00
Markus F.X.J. Oberhumer f322b580ff stub: arm renaming. 2016-09-22 11:28:00 +02:00
Markus F.X.J. Oberhumer 2b2f33e3f5 Update source for previous rename. 2016-09-22 11:22:18 +02:00
Markus F.X.J. Oberhumer ce29cd2fad stub: arm renaming. 2016-09-22 11:20:53 +02:00
Markus F.X.J. Oberhumer 0d5843f44e Update source for previous rename. 2016-09-22 11:17:53 +02:00
Markus F.X.J. Oberhumer e36e8e3b33 stub: arm renaming. 2016-09-22 11:15:49 +02:00
Markus F.X.J. Oberhumer e251a1ca19 Update source for previous rename. 2016-09-22 11:11:03 +02:00
Markus F.X.J. Oberhumer 4aedb00e43 stub: arm renaming. 2016-09-22 11:06:53 +02:00
Markus F.X.J. Oberhumer 10a0469221 Update source for previous rename. 2016-09-22 10:56:33 +02:00
Markus F.X.J. Oberhumer d3419acada stub: start arm renaming. 2016-09-22 10:52:26 +02:00
Markus F.X.J. Oberhumer 65ea4117ca Add some comments to stub/Makefile in prepartion of renames. 2016-09-22 10:44:40 +02:00
Markus F.X.J. Oberhumer 8b0101dcab Update source for previous rename. 2016-09-22 10:25:45 +02:00
Markus F.X.J. Oberhumer 188f67cfca stub: rename ppc64le to powerpc64le. 2016-09-22 10:20:54 +02:00
Markus F.X.J. Oberhumer a89f4bd4b8 Update .gitignore. 2016-09-22 09:56:30 +02:00
Markus F.X.J. Oberhumer 053c9dc0e1 stub: arm64: rename some files, remove unused files. 2016-09-22 09:55:13 +02:00
Markus F.X.J. Oberhumer 493d9f1b9d Ongoing cleanups. 2016-09-22 03:23:55 +02:00
Markus F.X.J. Oberhumer e28793f128 upx-clang-format -i packhead.cpp 2016-09-22 00:59:48 +02:00
Markus F.X.J. Oberhumer ea2bddf245 Fix one more file_image usage. 2016-09-22 00:58:43 +02:00
Markus F.X.J. Oberhumer 763b3c05af Don't use "long". Cleanups. 2016-09-22 00:47:35 +02:00
Markus F.X.J. Oberhumer 473cfb54be Normalize whitespace. 2016-09-22 00:02:58 +02:00
Markus F.X.J. Oberhumer a7fd742c17 Canonicalize the names of our executable formats. 2016-09-21 23:58:08 +02:00
Markus F.X.J. Oberhumer b66ba140cb More cleanups. 2016-09-21 23:18:19 +02:00
Markus F.X.J. Oberhumer 242f606a29 p_lx_elf.h: turn file_image into a MemBuffer. 2016-09-21 22:22:41 +02:00
Markus F.X.J. Oberhumer 60a1214d7e upx-clang-format -i ui.cpp 2016-09-21 21:38:56 +02:00
Markus F.X.J. Oberhumer 189ab8c8e8 upx-clang-format -i ui.h 2016-09-21 21:35:13 +02:00
Markus F.X.J. Oberhumer 3765ca4e92 Cleanups and cruft removal. 2016-09-21 21:33:53 +02:00
Markus F.X.J. Oberhumer df87d76070 p_mach.cpp: use proper types for variable "zero". 2016-09-21 20:39:00 +02:00
Markus F.X.J. Oberhumer 8fbf0b406b p_vmlinx.cpp: remove unused code fragment. 2016-09-21 17:56:43 +02:00
Markus F.X.J. Oberhumer 633073803f upx-clang-format -i s_djgpp2.cpp s_object.cpp s_vcsa.cpp s_win32.cpp screen.h 2016-09-21 17:46:42 +02:00
Markus F.X.J. Oberhumer 104da198d3 Minor screen cleanup. 2016-09-21 17:43:32 +02:00
Markus F.X.J. Oberhumer b3121e4534 Use upx_uint16_t instead of unsigned short. 2016-09-21 17:40:11 +02:00
Markus F.X.J. Oberhumer 3bb654cc85 Ongoing cleanups and cruft removal. 2016-09-21 16:42:25 +02:00
John Reiser d2830db94d Fix memory leak
modified:   p_lx_elf.cpp
2016-09-20 20:43:48 -07:00
John Reiser ad6914b938 PackMachBase<T>::canUnpack() finds overlay_offset for decompression
modified:   p_mach.cpp
	modified:   p_mach.h
2016-09-20 20:07:42 -07:00
Markus F.X.J. Oberhumer 57ba965b93 Add support for Travis CI. 2016-09-21 03:54:49 +02:00
Markus F.X.J. Oberhumer 544ec21fc2 Fix building with clang. 2016-09-21 01:09:07 +02:00
Markus F.X.J. Oberhumer 1bb0fa1809 Fix a few things spotted by the gcc-6 sanitizer. Needs review. 2016-09-21 00:35:51 +02:00
Markus F.X.J. Oberhumer ffa0efc898 Makefile: add support for USE_SANITIZE. 2016-09-21 00:34:52 +02:00
Markus F.X.J. Oberhumer af6b4b8c27 Fix previous commit. 2016-09-21 00:34:20 +02:00
Markus F.X.J. Oberhumer 3f7c1f966b Minor cleanups. 2016-09-20 22:14:25 +02:00
Markus F.X.J. Oberhumer 535515f296 Update submodules. 2016-09-20 22:13:07 +02:00
Markus F.X.J. Oberhumer 7af6c4b10e Use new style casts. Cleanups. 2016-09-20 20:59:34 +02:00
Markus F.X.J. Oberhumer 2076bef95b upx-clang-format -i stdcxx.cpp stdcxx.h ; remove old cruft. 2016-09-20 20:40:08 +02:00
John Reiser 48ce1f1814 Merge branch 'master' of https://github.com/upx/upx 2016-09-20 10:56:00 -07:00
John Reiser 5151c8a505 Indentation error detected by g++-6
modified:   p_lx_elf.cpp
2016-09-20 10:55:14 -07:00
Markus F.X.J. Oberhumer 44248f19b5 Introduce mem_size() and New() and start using it. 2016-09-20 15:24:07 +02:00
Markus F.X.J. Oberhumer 8d433f2580 Update submodules. 2016-09-20 15:09:50 +02:00
Markus F.X.J. Oberhumer 272fe5488c Remove Makefile fragment from p_vmlinx.cpp. 2016-09-20 13:06:24 +02:00
Markus F.X.J. Oberhumer c97765de14 upx-clang-format -i snprintf.cpp 2016-09-20 13:03:48 +02:00
Markus F.X.J. Oberhumer 7acf150ac5 Update README.SRC. 2016-09-20 12:51:06 +02:00
Markus F.X.J. Oberhumer 077bbdfc78 conf.h: check for proper WITH_LZMA. 2016-09-20 12:45:28 +02:00
Markus F.X.J. Oberhumer 2fb38ce13a Update Makefile for upx-lzma-sdk. 2016-09-20 12:37:00 +02:00
Markus F.X.J. Oberhumer 22dc183f25 Add upx-lzma-sdk submodule. 2016-09-20 12:35:15 +02:00
Markus F.X.J. Oberhumer 3c492c3fc7 Update Makefile so that my build scripts work again. 2016-09-20 11:29:28 +02:00
Markus F.X.J. Oberhumer d71db2978e Remove some old cruft. 2016-09-20 11:24:18 +02:00
Markus F.X.J. Oberhumer e4723e0bad Avoid some compiler warnings. 2016-09-20 10:54:27 +02:00
Markus F.X.J. Oberhumer dc56c4e530 bptr.h: size optimizations. 2016-09-20 10:30:09 +02:00
Markus F.X.J. Oberhumer 9579a51a8b pefile.cpp: always use BoundedPtr. 2016-09-20 10:20:42 +02:00
Markus F.X.J. Oberhumer 71f897ebf5 Avoid a -Wsign-compare warning. 2016-09-20 10:08:32 +02:00
Markus F.X.J. Oberhumer 09d9f71ae9 p_mach.h: use proper upx types. 2016-09-20 10:05:08 +02:00
John Reiser c678ccdfb1 stub/ppc64le-darwin.macho-fold.h is flapping (works one time, not the next.) 2016-09-19 21:25:30 -07:00
John Reiser bbbebe343b Try to recover powerpc64le. Still not successful [TOC space?]
modified:   Makefile
	new file:   ppc64-savegpr0.S
	modified:   ppc64le-darwin.macho-fold.h
2016-09-19 20:05:52 -07:00
John Reiser 033cb4f0c2 Fix merge
modified:   p_mach.cpp
2016-09-19 18:49:40 -07:00
John Reiser d750034b79 amd64-darwin.macho-upxmain.exe and .h 2016-09-19 18:32:26 -07:00
Markus F.X.J. Oberhumer a2063f0628 Normalize whitespace. 2016-09-20 02:06:58 +02:00
Markus F.X.J. Oberhumer acf2f2ffc4 Merge branch 'sierra' 2016-09-20 01:54:33 +02:00
Markus F.X.J. Oberhumer d14f484c4b Moving to github. 2016-09-19 22:41:32 +02:00
Markus F.X.J. Oberhumer 695e515a65 stub: update powerpc64le settings. 2016-09-19 22:22:21 +02:00
upstream 61089feee7 New ACC version. 2016-09-19 12:44:29 +00:00
Markus F.X.J. Oberhumer ddc9b10cd3 Add scripts/upx-clang-format. 2016-09-19 11:04:25 +02:00
Markus F.X.J. Oberhumer f95c92b431 Create a dummy stub/ppc64le-darwin.macho-fold.h so that upx builds again. 2016-09-19 10:54:23 +02:00
Markus F.X.J. Oberhumer eba65a94e6 Add missing *.dump files to repo. 2016-09-19 10:44:22 +02:00
John Reiser c28a0c6bb8 Synchronize stubs
modified:   src/stub/arm64-darwin.macho-entry.h
	modified:   src/stub/arm64-darwin.macho-fold.h
	modified:   src/stub/ppc64le-linux.elf-fold.h
	modified:   src/stub/tmp/arm64-darwin.macho-entry.bin.dump
2016-09-18 12:45:11 -07:00
Markus F.X.J. Oberhumer d6bacd9b47 Remove src/stub/scripts/UNUSED. 2016-09-18 16:07:47 +02:00
Markus F.X.J. Oberhumer 70b1657323 Update for upx-stubtools v20160918. 2016-09-18 16:00:29 +02:00
Markus F.X.J. Oberhumer 1ef08bd169 Add .gitignore. 2016-09-18 15:29:03 +02:00
Markus F.X.J. Oberhumer da68cc6a78 Remove .hgignore and .hgtags. 2016-09-18 15:00:53 +02:00
John Reiser 45c75d42ad Catch up to upxtools 20160902; add dangling arm/v8a/lzma_d.S 2016-09-17 19:51:32 -07:00
jreiser@BitWagon.com d4e55af2c2 Propagate LC_VERSION_MIN_MACOSX and LC_SOURCE_VERSION
changed src/p_mach.cpp
2016-09-17 16:40:07 -07:00
jreiser@BitWagon.com 48791a329d overlay_offset for decompress
changed src/p_mach.cpp
2016-09-17 16:16:41 -07:00
jreiser@BitWagon.com 9b26ebed75 LINKEDIT has unfilter and decompressor
changed src/p_mach.cpp
 changed src/stub/amd64-darwin.macho-upxmain.h
 changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-17 15:24:23 -07:00
jreiser@BitWagon.com e2160fb6c9 segLINK.initprot |= VM_PROT_EXECUTE
changed src/p_mach.cpp
2016-09-17 10:41:38 -07:00
jreiser@BitWagon.com 345a1c64f9 Omit Mach_command from stub where allowed.
changed src/p_mach.cpp
2016-09-17 09:36:58 -07:00
jreiser@BitWagon.com 7ad1e7756b Cleanup for checkin
changed src/p_mach.cpp
2016-09-17 06:49:41 -07:00
jreiser@BitWagon.com 90caf19e9e Cleanup amd64-darwin.macho-upxmain.c
changed src/stub/amd64-darwin.macho-upxmain.h
 changed src/stub/src/amd64-darwin.macho-upxmain.c
 changed src/stub/src/amd64-darwin.macho-upxsubr.S
2016-09-16 21:29:37 -07:00
jreiser@BitWagon.com 8d0b3b7d44 Fix segXHDR, but assume no __DATA in stub for now.
changed src/p_mach.cpp
2016-09-15 21:44:17 -07:00
jreiser@BitWagon.com 4c253d68d4 new start address 0xfe000000
changed src/stub/amd64-darwin.macho-upxmain.h
2016-09-15 21:38:39 -07:00
jreiser@BitWagon.com 73d1b331f1 trim Mach_command from stub. [Dirty, needs cleanup!]
changed src/p_mach.cpp
2016-09-13 20:20:41 -07:00
jreiser@BitWagon.com af2fddfd6d rebuild stub
changed src/stub/amd64-darwin.macho-upxmain.h
2016-09-13 20:18:54 -07:00
jreiser@BitWagon.com 3e065ead65 fix .bss in floating dyld
changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-13 20:17:51 -07:00
jreiser@BitWagon.com 3774704326 forgotten file; 3 FIXME !
added src/stub/src/arch/arm/v8a/lzma_d-arm.S
2016-09-13 20:14:44 -07:00
jreiser@BitWagon.com 4a1100b6a4 Unexport all symbols in compressed output.
added src/stub/src/amd64-darwin.macho-upxhide.txt
 changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-11 15:28:42 -07:00
jreiser@BitWagon.com 63dec77ed6 Try auto-relocate for /usr/lib/dyld
changed src/stub/amd64-darwin.macho-upxmain.h
 changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-11 15:08:56 -07:00
jreiser@BitWagon.com 1d3a66f890 bswap(), bzero(), fat_find(), assembly-language system calls
added src/stub/src/amd64-darwin.macho-upxsubr.S
 changed src/stub/amd64-darwin.macho-upxmain.h
 changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-11 14:22:19 -07:00
jreiser@BitWagon.com c1da92ca22 reduce asm()
changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-11 06:03:06 -07:00
jreiser@BitWagon.com 13475002d7 segXHDR reserves address space; actual launch!
changed src/p_mach.cpp
 changed src/stub/amd64-darwin.macho-upxmain.h
 changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-10 20:13:44 -07:00
jreiser@BitWagon.com 5bb6f246ed Mach-O dyld: __LINKEDIT must have highest .vmaddr and .fileoff 2016-09-10 15:46:36 -07:00
jreiser@BitWagon.com 89df7451ef Rebuild stubs
changed src/stub/amd64-darwin.macho-entry.h
 changed src/stub/amd64-darwin.macho-upxmain.h
 changed src/stub/tmp/amd64-darwin.macho-entry.bin.dump
2016-09-10 15:03:55 -07:00
jreiser@BitWagon.com 1334d544f7 stubtools 20160902 2016-09-10 15:03:04 -07:00
jreiser@BitWagon.com 3fefaa7362 revamp MH_EXECUTE: try to meet expectations of MacOSX 10.12 Sierra
changed src/p_mach.cpp
 changed src/stub/src/amd64-darwin.macho-upxmain.c
2016-09-10 15:02:13 -07:00
jreiser@BitWagon.com 15d62f7b96 Mach_main_command LC_MAIN 2016-09-10 15:00:28 -07:00
jreiser@BitWagon.com 83e0aaa511 sections AMD64BXX, MACH_UNC for MacOSX 10.12 2016-09-10 14:59:23 -07:00
jreiser@BitWagon.com ee06ce1148 generic Mach_command 2016-09-10 14:57:27 -07:00
jreiser@BitWagon.com 16d6124bb4 amd64-darwin.macho-upxmain for stub on Mac OS X 10.12 "Sierra" 2016-09-05 20:37:23 -07:00
jreiser@BitWagon.com 1197beaa13 ElfLinker::init() zero length implies 0x4000 blank bytes 2016-09-05 20:36:07 -07:00
jreiser@BitWagon.com 98b428a8be Fix compiler warning 2016-09-05 20:32:52 -07:00
jreiser@BitWagon.com 17f47d3c0a p_mach*: Try for MacOSX 10.12 "Sierra" with UUID, XHDR. 2016-09-04 19:05:31 -07:00
John Reiser a9cc3b2a89 Use gcc-ppc64-linux-gnu-5.3.1-2.fc22.x86_64
But bin-upx-20130920/multiarch-ld-2.17 gets SIGSEGV for fold.h

  src/stub/Makefile
  src/stub/ppc64le-darwin.dylib-entry.h
  src/stub/ppc64le-darwin.macho-entry.h
  src/stub/ppc64le-linux.elf-entry.h
  src/stub/ppc64le-linux.kernel.vmlinux.h
2016-07-27 08:57:54 -07:00
John Reiser 199102c106 stub/src/arch/arm/v8a/lzma_d_cf.S and follow-ons
src/stub/arm64-darwin.macho-entry.h
  src/stub/src/arch/arm/v8a/lzma_d_cf.S
  src/stub/tmp/arm64-darwin.macho-entry.bin.dump
2016-07-27 08:27:06 -07:00
John Reiser c7d76fb7ab Change copyright year 2013 ==> 2016 in ppc64le files.
src/stub/ppc64le-darwin.macho-fold.h
  src/stub/src/arch/ppc64le/64/bxx.S
  src/stub/src/arch/ppc64le/64/lzma_d.S
  src/stub/src/arch/ppc64le/64/macros.S
  src/stub/src/arch/ppc64le/64/nrv2b_d.S
  src/stub/src/arch/ppc64le/64/nrv2d_d.S
  src/stub/src/arch/ppc64le/64/nrv2e_d.S
  src/stub/src/ppc64le-darwin.dylib-entry.S
  src/stub/src/ppc64le-darwin.macho-entry.S
  src/stub/src/ppc64le-darwin.macho-fold.S
  src/stub/src/ppc64le-darwin.macho-main.c
  src/stub/src/ppc64le-linux.elf-entry.S
  src/stub/src/ppc64le-linux.elf-fold.S
  src/stub/src/ppc64le-linux.elf-fold.lds
  src/stub/src/ppc64le-linux.elf-main.c
  src/stub/src/ppc64le-linux.kernel.vmlinux-head.S
  src/stub/src/ppc64le-linux.kernel.vmlinux.S
2016-07-26 21:42:07 -07:00
John Reiser ba9b86c0dc added src/stub/src/arch/arm/v8a/lzma_d_cf.S 2016-07-26 21:32:43 -07:00
John Reiser 5de83a606e Cleanup after Thierry Fauck changes for ppc64le.
We need a "UPX standard" compiler in order to re-compile the stubs for ppc64le;
meanwhile use Thierry's "pre-compiled" stubs.
Revert powerpc stubs to those produced by UPX standard powerpc.405-linux-gcc-3.4.5.
Cleanup the workarounds that Thierry used because he lacked upx-stubtools 20130920.
ARMv8 (64-bit) compiles but is incomplete and does not run yet.

 changed src/Makefile
 changed src/linker.cpp
 changed src/stub/Makefile
 changed src/stub/amd64-linux.elf-entry.h
 changed src/stub/arm64-darwin.macho-entry.h
 changed src/stub/arm64-darwin.macho-fold.h
 changed src/stub/powerpc-darwin.dylib-entry.h
 changed src/stub/powerpc-darwin.macho-entry.h
 changed src/stub/powerpc-darwin.macho-fold.h
 changed src/stub/powerpc-linux.elf-entry.h
 changed src/stub/powerpc-linux.elf-fold.h
 changed src/stub/powerpc-linux.kernel.vmlinux.h
 changed src/stub/scripts/xstrip.py
 changed src/stub/src/arch/arm/v8a/lzma_d.S
 changed src/stub/src/arch/arm/v8a/macros.S
 changed src/stub/src/arm64-darwin.macho-entry.S
 changed src/stub/tmp/arm64-darwin.macho-entry.bin.dump
2016-07-26 21:29:29 -07:00
John Reiser 01a0c8672d changeset: 2451:4e2a6c33d5fb
tag: ppc64le
user: Thierry Fauck <tfauck@free.fr>
date: Wed Jun 22 08:25:13 2016 -0400
summary: Add support for ppc64le statically linked binaries
2016-07-26 17:00:25 -07:00
John Reiser fa522c0ffc Hacking convert v4a/lzma_d-arm.S from 32-bit to 64-bit 2016-02-14 21:26:37 -08:00
John Reiser 16241d010f PUSH+POP now in macros.S 2016-02-14 21:25:28 -08:00
John Reiser 9cb8fbf178 branch merge
branch 'default'
   changed src/pefile.cpp
   changed src/pefile.h
2016-01-31 20:11:42 -08:00
John Reiser bd7ef27628 ARM64LE begins implementation
added src/stub/arm64-darwin.macho-entry.h
   added src/stub/arm64-darwin.macho-fold.h
   added src/stub/src/arch/arm/v8a/lzma_d.S
   added src/stub/src/arch/arm/v8a/macros.S
   added src/stub/src/arch/arm/v8a/nrv2b_d8.S
   added src/stub/src/arch/arm/v8a/nrv2d_d8.S
   added src/stub/src/arch/arm/v8a/nrv2e_d32.S
   added src/stub/src/arch/arm/v8a/nrv2e_d8.S
   added src/stub/src/arm64-darwin.macho-entry.S
   added src/stub/src/arm64-darwin.macho-fold.S
   added src/stub/src/arm64-darwin.macho-main.c
   added src/stub/src/arm64-linux.elf-entry.S
   added src/stub/src/arm64-linux.elf-fold.S
   added src/stub/tmp/arm64-darwin.macho-entry.bin.dump
   changed src/p_mach.cpp
   changed src/p_mach.h
   changed src/stub/Makefile
2016-01-31 20:09:38 -08:00
John Reiser 42e520e841 ElfLinkerArm64LE 2016-01-31 19:59:00 -08:00
John Reiser d8f9cd237f UPX_F_MACH_ARM64EL 2016-01-31 19:58:17 -08:00
László Molnár 33065ecf04 fixed resource bounds checking when compressing; let --force override throwing an exception 2015-08-11 13:05:10 +02:00
John Reiser 718a1da262 Bounds check shstrtab in PackVmlinuxBase<T>::canPack() 2015-08-10 05:45:52 -07:00
John Reiser b89c3ebb42 LZMA version 15.05 2015-08-03 22:36:16 -07:00
John Reiser 9d7e44feff GNU Make 4.0 does not assign to MAKEFLAGS sequentially 2015-08-03 22:35:00 -07:00
John Reiser e48a60a4f0 Add link to goupx for Go-language workaround and UI. 2015-07-28 13:40:44 -07:00
John Reiser 163e1907a4 0==.vmsize in Go-language LC_SEGMENT_64; also g++ 5.1.1 nit 2015-07-25 12:54:25 -07:00
John Reiser ac1ccaa246 Go-language PT_LOAD 2015-07-25 07:21:28 -07:00
John Reiser 53b45279ad Better diagnosis of Go-language PT_LOAD; https://sourceforge.net/p/upx/bugs/195/ 2015-07-25 07:11:57 -07:00
John Reiser f80daf5de1 CERT-FI Case 829767 UPX command line tools segfaults
The vulnerabilities were discovered by Joonas Kuorilehto and Antti Häyrynen from Codenomicon.
2015-05-16 15:33:31 -07:00
John Reiser 298ea1f0d3 ::unpack(): another check on b_info; uncompressed ElfXX_Ehdr must match input 2015-05-16 15:23:01 -07:00
John Reiser 1d13d8c4a0 PackMachBase::unpack() process lc_seg in same order as ::pack() 2015-05-16 15:20:03 -07:00
John Reiser 2238c99b61 another check on b_info in ::unpackExtent() 2015-05-16 15:18:28 -07:00
John Reiser 7d4dfbef2b cleanup IPTR_I_D 2015-05-15 20:56:34 -07:00
John Reiser 759827b404 EI_OSABI for EM_ARM is a real mess 2015-05-15 20:47:35 -07:00
John Reiser fca627d1b0 ::seek() returns resulting off_t; InputFile::seek() restricts to actual _length 2015-05-15 20:44:09 -07:00
John Reiser 404da18aed IPTR_I_D: 'import' buffer is a subset of ibuf 2015-05-15 20:42:18 -07:00
John Reiser 330fca722a too large: blocksize > 1024*1024*1024 [corrupted] 2015-05-15 05:36:21 -07:00
John Reiser 8939cd120b too small: (st.st_size < 512) 2015-05-15 05:32:52 -07:00
László Molnár 63afeb7373 added a check for corrupted packheader 2015-05-14 21:48:16 +02:00
László Molnár 6ba68a6455 PE related fixes for CERT-FI 829767 2015-05-14 21:46:52 +02:00
John Reiser 1579c74302 canPack() requires 0 < nfat 2015-05-10 14:01:48 -07:00
John Reiser 373ca15c71 size < 1024 is too short 2015-05-10 14:01:08 -07:00
John Reiser a8a3caed1c Check blocksize 2015-05-09 20:29:56 -07:00
John Reiser cb35ba4543 At ::unpack much of decompressed Mach_header must match outer Mach_header 2015-05-09 20:14:32 -07:00
John Reiser cdd152d015 Detect (int)blocksize < 0 2015-05-09 20:13:30 -07:00
John Reiser 83ce7dc62f Must not compare orig_file_size with fi->st_size() during ::unpack 2015-05-09 17:47:17 -07:00
John Reiser b182b50f24 Distinguish corruption of p_info, b_info 2015-05-09 10:13:13 -07:00
John Reiser 71a9941b84 Check getImageSize(). CERT-FI 829767
id:000058,sig:06,src:000001,op:havoc,rep:64
2015-05-09 07:29:26 -07:00
John Reiser c777da263e Check blocksize. CERT-FI 829767
id:000053,sig:06,src:000000,op:arith8,pos:10440,val:+20
2015-05-09 07:25:25 -07:00
John Reiser 2cb7b56a41 Check ph.c_len; CERT-FI 829767
id:000023,sig:06,src:000000,op:flip2,pos:10440
2015-05-09 07:18:54 -07:00
John Reiser 52f9ef14b9 Check ph.c_len; CERT-FI 829767
id:000010,sig:06,src:000000,op:flip1,pos:11584
2015-05-09 07:13:47 -07:00
John Reiser 8d6c594240 Check ph.c_len; CERT-FI 829767
id:000008,sig:06,src:000000,op:flip1,pos:205
2015-05-09 07:05:17 -07:00
John Reiser 7ad77ff540 Check blocksize. CERT-FI 829767
id:000005,sig:06,src:000000,op:havoc,rep:16
2015-05-09 06:56:32 -07:00
John Reiser acede72e9b Check ph.c_len. CERT-FI 829767
id:000002,sig:06,src:000000,op:havoc,rep:1
2015-05-09 06:49:45 -07:00
John Reiser 771fd732d1 Check e_phentsize; CERT-FI 829767
id:000064,sig:06,sync:upx-macho-crash-2,src:000096
2015-05-09 05:31:36 -07:00
John Reiser 2a79a69f59 PackUnix::unpack() is non-Elf. CERT-FI 829767
id:000057,sig:11,sync:upx-macho-crash-2,src:000108
id:000058,sig:11,sync:upx-macho-crash-2,src:000107
id:000059,sig:06,sync:upx-macho-crash-2,src:000106
id:000060,sig:06,sync:upx-macho-crash-2,src:000103
2015-05-09 05:14:12 -07:00
John Reiser 8c0321697f Check PackHeader before decompress; CERT-FI id:000002,sig:06,src:000000,op:flip1,pos:4629 2015-05-08 20:13:44 -07:00
John Reiser 0151b3f9b3 Validate Mach_segment_command.cmdsize; CERT-FI id:000000,sig:11,src:000000,op:havoc,rep:2 2015-05-08 19:45:05 -07:00
John Reiser 82a51f35ea Validate header CERT_FI id:000000,sig:11,src:000000,op:flip1,pos:1 2015-05-08 19:22:24 -07:00
John Reiser 35944cbfc1 Validate fat_head; CERT-FI id:000000,sig:06,src:000000,op:flip1,pos:7 2015-05-08 18:32:42 -07:00
John Reiser f0aef9b28b Check input data; CERT-FI upx-crashes-elf id:000000,sig:11,src:000000,op:flip1,pos:0 2015-05-08 17:04:16 -07:00
John Reiser ae37c3902c Apple codesign requires a different secTEXT.size 2015-03-27 20:41:00 -07:00
John Reiser d612585582 C/7zTypes.h #if (WITH_LZMA >= 0x938) 2015-03-15 10:30:55 -07:00
John Reiser 7ca14d209c Use upx_uint64_t instead of "unsigned long". 2015-01-10 12:26:35 -08:00
Markus F.X.J. Oberhumer c37f582c10 Merge. 2015-01-04 11:11:05 +01:00
John Reiser 6272fb3822 ARM --lzma && is_big: stub mmap must allow for cpr0.sz_unc [How did this ever work before?] 2015-01-02 17:36:26 -08:00
Markus F.X.J. Oberhumer 2582fbac59 Update src/Makefile to use more conservative gcc optimization settings. 2015-01-03 01:55:51 +01:00
Markus F.X.J. Oberhumer 5abb578e47 p_djgpp2.{cpp,h}: remove usage of "long". 2015-01-03 01:12:46 +01:00
Markus F.X.J. Oberhumer 015ebf89a5 lefile.h: remove usage of "long". 2015-01-03 01:04:41 +01:00
Markus F.X.J. Oberhumer c6724968f1 pefile.cpp: work around a gcc-3.4 limitation. 2015-01-03 00:40:28 +01:00
Markus F.X.J. Oberhumer 9fa1772ae4 Merge. 2015-01-03 00:34:42 +01:00
Markus F.X.J. Oberhumer 4551937812 Bump version year. 2015-01-03 00:26:48 +01:00
John Reiser 51ee664cae PackLinuxElf32help1 refuses if e_ident[EI_DATA] mismatches bele policy 2015-01-02 15:25:29 -08:00
Markus F.X.J. Oberhumer fb611a98f9 Welcome 2015. 2015-01-03 00:24:07 +01:00
Markus F.X.J. Oberhumer a3d5face38 Fix a comment. 2015-01-03 00:21:51 +01:00
László Molnár 424cd497d3 pe64: saved a few bytes in the nrv decompressors 2014-03-18 23:35:30 +01:00
László Molnár d46eeffaaf NEWS updated 2014-03-10 21:53:46 +01:00
László Molnár 6520f2061e arm/pe: thumb mode stub hopefully fixed 2014-03-10 21:44:23 +01:00
László Molnár 5d93f86b4b armpe_tester: better import handling 2014-03-10 21:42:11 +01:00
László Molnár b3f63ce7ae pe: fix a bug in pack0() for arm 2014-03-09 23:55:28 +01:00
László Molnár 56de770682 armpe_tester now works on android 2014-03-09 23:42:41 +01:00
László Molnár 940341bc9d arm/pe: import handling updates (untested) 2014-03-08 18:59:26 +01:00
László Molnár 804a0ce601 merge 2014-03-06 22:38:15 +01:00
László Molnár 41054a4c56 handle duplicates in ImportLinker 2014-03-06 22:26:41 +01:00
László Molnár 7b8e5d4180 pe: remove some dead code 2014-03-05 23:59:53 +01:00
László Molnár ca2369f1c1 pe: win32/win64 pack/unpack seems to work again 2014-03-05 23:40:24 +01:00
László Molnár 129cb0b3cd pe: packing of pe64 starts to work again 2014-03-04 23:51:59 +01:00
László Molnár 632b2ae1ba pe: pack() logic moved to PeFile 2014-03-02 22:34:52 +01:00
László Molnár 18e55061e1 pepfile.* disabled; PeFile64 class introduced 2014-02-20 00:10:18 +01:00
László Molnár e49b65723f pe: canUnpack moved to PeFile 2014-02-19 23:27:41 +01:00
László Molnár 8e52894763 pe: loadconf handling moved to PeFile 2014-02-19 21:45:24 +01:00
László Molnár 07cba6c774 pe32: tls refactoring 2014-02-18 00:23:42 +01:00
László Molnár 9cb639b505 pe32: refactoring of import handling and unpacking continues 2014-02-16 23:04:39 +01:00
Markus F.X.J. Oberhumer 4cf6eeeee2 README.SRC: update an URL. 2014-01-27 20:59:47 +01:00
John Reiser c0f692792f 2014 2014-01-10 19:23:41 -08:00
John Reiser bd77e0945b more LC_* constants 2014-01-10 19:22:30 -08:00
Markus F.X.J. Oberhumer f0eb171b2a Strip trailing whitespace. 2014-01-07 23:09:11 +01:00
Markus F.X.J. Oberhumer fb93662b5c Bump version for next release. 2014-01-07 23:08:00 +01:00
Markus F.X.J. Oberhumer a26c982e93 Welcome 2014. 2014-01-07 23:05:10 +01:00
Markus F.X.J. Oberhumer 7db3e98944 Small cleanups. 2014-01-07 23:03:16 +01:00
Markus F.X.J. Oberhumer 4a87834e04 New ACC version. 2014-01-07 19:15:57 +00:00
Markus F.X.J. Oberhumer bf6ecaeeb9 stub: minor cosmetic cleanups. 2013-12-02 19:37:28 +01:00
Markus F.X.J. Oberhumer f70ef86dfa help.cpp: add a missing con_fg() call. 2013-12-02 19:23:06 +01:00
John Reiser cd3132667a ARM shlib escape hatch moves to just beyond .text.
https://sourceforge.net/p/upx/bugs/223/
2013-11-22 19:26:19 -08:00
John Reiser 1c459a7bea Sync stubs. 2013-11-16 14:29:52 -08:00
John Reiser 4f0bfeab4c Round down unfilter length to a multiple of 4.
https://sourceforge.net/p/upx/bugs/223
2013-11-16 14:28:59 -08:00
John Reiser c5c9921b59 Unpack detects is_shlib more robustly. Dispute .e_shoff. 2013-11-16 14:25:53 -08:00
John Reiser 6b63aba1fc Disable jni_onload_* 2013-11-09 16:06:41 -08:00
John Reiser 382331fb11 e_phoff and e_shoff are 32/64 specific 2013-10-28 07:11:40 -07:00
John Reiser caf9af7ae4 JNI_OnLoad is a pre-DT_INIT in a shared library. 2013-10-26 09:51:25 -07:00
John Reiser 45d2adeb9c Android < 4.1 (kernel < 3.0.31) often has PT_INTERP of /system/bin/linker
with bad PT_LOAD[0].  https://sourceforge.net/p/upx/bugs/221
2013-10-21 07:27:53 -07:00
László Molnár 96708d7592 ImportLinker copied into PeFile 2013-10-12 16:48:56 +02:00
John Reiser 13090d1219 ARM close /proc/self/exe after mmap 2013-10-06 19:56:14 -07:00
László Molnár 8ab229cca9 pe: refactoring started 2013-10-06 22:57:20 +02:00
John Reiser 583cd078dc ARM elf-fold: preserve /proc/self/exe by mmap of one page into stack 2013-10-06 13:22:05 -07:00
László Molnár aa2ac1bbb8 pe: ImportLinker introduced 2013-10-04 22:48:21 +02:00
Markus F.X.J. Oberhumer 928b426672 Add tag for RELEASE_391. 2013-09-30 15:51:00 +00:00
Markus F.X.J. Oberhumer 6766b14415 Prepare release. 2013-09-30 14:21:37 +02:00
John Reiser 9d0f9e967f Avoid stmdb with write-back register in stored list,
even when stored value is don't care.
2013-09-21 09:52:21 -07:00
John Reiser d7609088e5 Silence "warning: cannot find entry symbol _start" 2013-09-21 08:39:15 -07:00
Markus F.X.J. Oberhumer b2643b6926 Start using the new intergral type names. 2013-09-20 08:19:18 +02:00
Markus F.X.J. Oberhumer 07b65ca069 Introduce integral type names using <stdint.h> terminology like "upx_uint64_t". 2013-09-20 08:16:37 +02:00
Markus F.X.J. Oberhumer 25727f7f99 Minor portability fixes. 2013-09-20 07:48:29 +02:00
Markus F.X.J. Oberhumer 880ae89307 Bump version and tentative release date. 2013-09-20 07:19:06 +02:00
Markus F.X.J. Oberhumer 1496df1989 New ACC version. 2013-09-20 07:09:35 +02:00
Markus F.X.J. Oberhumer 7d8ae6b4b1 Make amd64-win64.pep.S compile with current upx stubtools. 2013-09-20 07:08:09 +02:00
Markus F.X.J. Oberhumer 312d4cccaf stub: start using stubtools bin-upx-20130920. 2013-09-20 06:59:27 +02:00
Markus F.X.J. Oberhumer ce5f9f95ea stub: fix i386 syntax for current gas versions, and add some explicit
alignments at the end of the file so that we do not depend on gas defaults.
2013-09-20 06:15:46 +02:00
Markus F.X.J. Oberhumer d9bf8a76d9 Protect against changes from future gas versions in amd64-linux.elf-entry.S. 2013-09-20 05:22:05 +02:00
Markus F.X.J. Oberhumer f7a35fb9fe stub: save 1 byte in amd64-darwin.{dylib,macho}-entry.S. 2013-09-20 04:20:23 +02:00
Markus F.X.J. Oberhumer 3ba691ded5 Remove trailing whitespace. 2013-09-20 03:25:59 +02:00
Markus F.X.J. Oberhumer 7a7277d56f Use correct "movzwl" opcode in src/stub/src/arch/i386/macros.S. 2013-09-20 03:18:19 +02:00
László Molnár 76be5dd1d3 linker: Section::offset should be u64 2013-09-01 21:38:44 +02:00
László Molnár 53dc63f3bc linker: a small 64-bit relocation support related fix 2013-09-01 11:15:30 +02:00
László Molnár 80da0bc9d5 pepfile: infoWarning about unsupported relocation types fixed 2013-08-28 22:33:39 +02:00
László Molnár bce7af4e11 fixed 8 bit range checking in ElfLinkerAMD64::relocate1 2013-08-28 22:31:40 +02:00
László Molnár 9da09b51ed win64/pe: tls callback assembly improvements + misc cleanups 2013-08-28 21:53:23 +02:00
László Molnár 86392f197f win64/pe: lzma support added 2013-08-28 00:24:54 +02:00
László Molnár 1c13046297 win64/pe: added nrv2b and nrv2d support 2013-08-27 22:06:52 +02:00
László Molnár fbc756b531 win64/pe: filter support added 2013-08-27 21:22:21 +02:00
László Molnár 6c64b06453 win64/pe: uncompression seems to work; tls handling improvement 2013-08-26 22:07:55 +02:00
László Molnár 241834029a 64 relocation handling added; basic DLL support works 2013-08-25 23:54:13 +02:00
László Molnár 5b8a9c0b47 basic win64 PE support added 2013-08-22 22:01:09 +02:00
László Molnár 037c29d24a added full support for 64-bit relocations 2013-08-22 21:43:11 +02:00
László Molnár 893f26ac9a fix wcle fixup unpacking segfault (sf.net bug 220) 2013-08-19 13:39:44 +02:00
John Reiser d43f8e3100 Alignment bug in test or decompress of shared library;
sourceforge.net/p/upx/bugs/218/
2013-07-06 13:50:15 -07:00
John Reiser 2b42acf7b8 ARM heuristic dcache flush by sweeping 1/2 MB 2013-06-10 14:20:59 -07:00
John Reiser f65b80ed42 ARM remember readlink("/proc/self/exe",) as environment variable " =" (3 spaces) 2013-06-09 20:33:59 -07:00
John Reiser e84abbdc82 ARM __clear_cache() has bugs
Linux hostname 3.0.8-482645-user #1 SMP PREEMPT Mon Apr 30 19:43:45 KST 2012 armv7l GNU/Linux
  Processor	: ARMv7 Processor rev 3 (v7l)

  processor	: 0
  BogoMIPS	: 597.12

  processor	: 1
  BogoMIPS	: 597.12

  CPU implementer	: 0x41
  CPU architecture: 7
  CPU variant	: 0x1
  CPU part	: 0xc09
  CPU revision	: 3

  Hardware	: Espresso10
  Revision	: 000a
2013-06-09 13:03:06 -07:00
John Reiser 66269eabe9 ARM Try a hole so that kernel does not extend brk(0) 2013-06-08 08:39:08 -07:00
John Reiser 36c0928483 ARM __clear_cache() on escape hatch; http://sourceforge.net/p/upx/bugs/214/ 2013-06-07 07:08:03 -07:00
John Reiser 9237e15adc Fix ARM compress shared library. 2013-05-10 16:20:52 -07:00
Markus F.X.J. Oberhumer 0d3a2072b2 Add some more sanity checks in pefile.cpp. 2013-04-04 14:30:52 +02:00
Markus F.X.J. Oberhumer aa2ee5dfc2 New ACC version. 2013-03-20 16:48:27 +00:00
John Reiser b515fa39ec Apple codesign follies: need more flags 2013-03-07 19:47:44 -08:00
Markus F.X.J. Oberhumer 76e3f4eb92 Post-release version bump. 2013-02-20 13:50:12 +01:00
Markus F.X.J. Oberhumer 4959e5c6c2 Add tag for RELEASE_309. 2013-02-18 16:09:00 +00:00
Markus F.X.J. Oberhumer 7082594bbc Prepare release. 2013-02-18 11:03:33 +01:00
Markus F.X.J. Oberhumer 36dd35f238 Silence some compilation warnings. 2013-02-18 11:01:30 +01:00
John Reiser 9c9fb6a485 DEBUG-only bug in decimal() 2013-02-15 16:35:45 -08:00
John Reiser 5438a4837b more AT_PHDR trouble 2013-02-15 16:32:51 -08:00
Markus F.X.J. Oberhumer 84996e8cb6 Bump tentative release date. 2013-02-12 10:32:11 +01:00
Markus F.X.J. Oberhumer 87a368a857 Welcome 2013. 2013-02-12 10:14:03 +01:00
Markus F.X.J. Oberhumer 21412d93dd New ACC version. 2013-02-12 08:16:44 +00:00
John Reiser 0b11ff22b4 internal documentation: pointer to source for Apple codesign 2013-02-03 11:27:02 -08:00
John Reiser 8fafa78796 sync stubs 2013-01-31 12:33:16 -08:00
John Reiser c43158f8a2 find PT_LOAD in case ARM PT_EXIDX is first 2013-01-31 12:21:51 -08:00
John Reiser 92ad524947 clear registers at user entry (paranoia) 2013-01-31 12:20:42 -08:00
John Reiser b362a61863 fix for user brk() on ARM with static linking 2013-01-31 12:19:35 -08:00
John Reiser 468fec38d7 Fix .e_ident[EI_OSABI] for Debian armhf. 2013-01-30 13:31:35 -08:00
John Reiser 89830a5ae0 Mac OS X codesign disallows overhang of vmsize. 2013-01-25 15:58:25 -08:00
John Reiser 5977c296bd Fix codesign for Mac OS X. 2013-01-24 15:28:21 -08:00
John Reiser 47d5792d97 Updates to prepare for next release. 2012-11-14 09:07:10 -08:00
Markus F.X.J. Oberhumer 25d706a913 Whitespace cleanup. 2012-10-31 15:50:52 +01:00
John Reiser 048236aaaa Isolate change to p_mach.cpp of previous revision
(p_lx_elf.cpp and p_lx_elf.h were included by mistake.)
2012-10-10 08:58:15 -07:00
John Reiser d442c58fd1 MachO no longer needs contiguous LC_SEGMENT (SourceForge bug 3308161) 2012-10-10 08:51:52 -07:00
John Reiser f890f6bb09 ignore another .vmsize==0; fix unfold which needs another page 2012-08-23 14:26:42 -07:00
John Reiser 036d466790 allow 3-byte decompressor overrun; fix DEBUG decimal(); unify with i386 2012-08-23 14:25:32 -07:00
John Reiser dee47ba2d8 implement DEBUG 2012-08-23 14:22:55 -07:00
John Reiser be96c28b77 fix DEBUG decimal() of negative number 2012-08-23 12:37:44 -07:00
John Reiser ad1c0f578e fix DEBUG decimal() of negative number 2012-08-23 07:31:30 -07:00
John Reiser c8f7b1b72c MacOSX launcher gets SIGBUS when it cannot find mapped Mach_header.
Add segZERO, segMHDR, secMHDR.
2012-08-22 20:46:35 -07:00
John Reiser c89702ae84 skip 0==.vmsize; also DEBUG, DPRINTF 2012-08-22 20:43:00 -07:00
John Reiser 2d29a82250 PackMachBase<T>::pack1() segTEXT.vmaddr must ignore zero-length segments 2012-08-20 20:02:26 -07:00
John Reiser b36c65e654 fix Mac OS X code signing; also leave room for LC_UUID 2012-08-04 16:44:21 -07:00
John Reiser 09b072b908 Leave space for code signing on Mac OS X. 2012-08-03 13:28:33 -07:00
John Reiser 0ae9fee350 Mach_linkedit_data_command 2012-08-03 13:20:00 -07:00
John Reiser 1579182ed9 PackUnix::canUnpack() allows zero-filled last page 2012-08-03 13:19:28 -07:00
John Reiser 074671aa71 ::unpack "if (fo)"; also "delete []" (SourceForge bug 3545609) 2012-07-19 20:11:44 -07:00
John Reiser 36b7c47247 __DWARF LC_SEGMENT_64 with .vmsize==0 (SourceForge bug 3308161) 2012-07-18 15:37:41 -07:00
John Reiser 424d5b3025 UPX_LZMA_VERSION, zlib, zlib-devel, URL for lzma SDK 2012-07-16 15:22:22 -07:00
John Reiser 8a5d352733 Portability: fix "EOFException: premature end of file" doing ELF on Windows.
OutputFile::read() was bad news; fsync() should work, but was missing.
2012-07-12 14:25:28 -07:00
John Reiser f383629282 compressWithFilters(..., inhibit_compression_check=0) // SourceForge bug 3541020
Not good to check compression ratio on every block when blocksize < file_size,
as when --force_execve of Elf > 0x80000 bytes.
2012-07-12 07:04:56 -07:00
John Reiser a6d717cb04 big endian, too: ARM Linux EABI version 4 and 5 is a mess 2012-07-07 07:45:51 -07:00
Markus F.X.J. Oberhumer 84a5753301 New ACC version. 2012-05-31 16:08:14 +00:00
Markus F.X.J. Oberhumer 5d2d9c7e81 Update .hgignore. Update valgrind macros. 2012-04-26 09:05:35 +02:00
Markus F.X.J. Oberhumer 82801d1411 Fix some typos in documentation and comments. 2012-03-27 02:14:03 +02:00
John Reiser 340c3963d8 MIPS mmap_privanon in .S in case gcc learns how to 'bal'. 2012-03-14 08:24:04 -07:00
John Reiser ef15cf9847 merge 2012-03-13 19:56:30 -07:00
John Reiser 4d613ccfa7 MIPS mmap_privanon() forgot to set syscall number; also gcc __asm__() problems.
[Sourceforge upx-Bugs-3503753]
2012-03-13 19:54:47 -07:00
Markus F.X.J. Oberhumer 43ce34d547 Welcome 2012. 2012-01-01 22:35:11 +01:00
Markus F.X.J. Oberhumer eda074cd80 New ACC version. 2012-01-01 21:18:43 +00:00
Markus F.X.J. Oberhumer a2396d82f6 NEWS: spelling fixes. 2011-12-14 18:06:39 +01:00
Markus F.X.J. Oberhumer a38721db93 Remove meaningless "const" from casts. 2011-12-14 06:05:41 +01:00
Markus F.X.J. Oberhumer a06e811717 Remove extra semicolons. 2011-12-14 06:05:08 +01:00
Markus F.X.J. Oberhumer 86e534ff75 Remove trailing whitespace. Remove hard tabs. 2011-12-14 06:03:08 +01:00
John Reiser 640d5b2dec Option --preserve-build-id for Gnu ELF; contributed by Nicholas Twerdochlib
(SourceForge [ upx-Patches-3413335 ])
2011-12-13 17:26:03 -08:00
John Reiser 57e9b27085 merge 2011-12-13 10:54:55 -08:00
John Reiser c56eefc739 Document /proc/self/exe problems on arm*-linux-elf. 2011-12-13 10:53:26 -08:00
Markus F.X.J. Oberhumer cf28306997 Post-release version bump. 2011-12-13 01:30:00 +01:00
Markus F.X.J. Oberhumer 10acf3ddd1 Add tag for RELEASE_308. 2011-12-12 16:08:00 +00:00
Markus F.X.J. Oberhumer fed3ed9f9a Prepare release. 2011-12-12 11:55:45 +01:00
Markus F.X.J. Oberhumer 260138ba11 Silence some compilation warnings. 2011-12-12 11:30:02 +01:00
John Reiser 67f7e0089c NEWS summary in preparation for release 2011-12-06 08:22:44 -08:00
John Reiser d4a22c7851 Sync stub for amd64-darwin.macho-entry. 2011-12-06 07:03:53 -08:00
John Reiser 06cf986490 overlap unfolded stub on Mach-O amd64 [SourceForge upx-Bugs-3447184] 2011-12-02 22:01:13 -08:00
John Reiser adf9aa04ce overlap unfolded stub on Mach-O i386 [SourceForge upx-Bugs-3447184] 2011-12-02 20:51:13 -08:00
John Reiser 69f66fbe52 rebuild using broader dependencies of previous commit 2011-11-23 13:25:25 -08:00
John Reiser d061005c89 propagate dependency on i386-linux.elf-main.c by hand 2011-11-23 13:23:11 -08:00
John Reiser f6ee8b9f04 MSVC++ disallows zero-length array in struct 2011-11-23 13:05:00 -08:00
John Reiser 31af22c2ff ARM_is_QNX looks for PT_INTERP containing "ldqnx" 2011-10-16 15:04:18 -07:00
John Reiser c421e3f243 ARM stub: fix editing mistake 2011-10-16 13:40:21 -07:00
John Reiser 6e92902407 ARM_is_QNX() heuristic 2011-10-16 13:11:03 -07:00
John Reiser 6256381dc3 mmap_privanon() in stub for arm,i386,mips eases QNX 2011-10-16 11:39:46 -07:00
John Reiser b247b051ea QNX on armel (experimental) 2011-10-15 19:49:37 -07:00
Markus F.X.J. Oberhumer afbd553622 Silence some compilation warnings. 2011-08-30 03:40:53 +02:00
John Reiser 36bc14e884 fix PackMachFat::unpack for test mode ("-t"): fo==NULL 2011-07-11 14:37:40 -07:00
John Reiser 9c5d0ff2ff PeFile::processRelocs() defends itself against corrupt PE header 2011-06-08 10:06:42 -07:00
John Reiser cfa6c8ddf6 Fix ::pack3 for shared library. 2011-06-06 20:00:43 -07:00
John Reiser 21924bf022 move stub escape hatch for shared library to end of .text [glibc-2.13.90] 2011-06-02 07:18:50 -07:00
John Reiser eea33f6019 Document copy ONLY for old_dtinit, .e_shoff in compressed shared library. 2011-05-31 11:01:40 -07:00
John Reiser 66d48ae808 MH_BUNDLE enum 2011-05-30 07:22:31 -07:00
John Reiser de9b9fd0b1 more messages in PackLinuxElf32::canPack 2011-05-30 07:21:51 -07:00
John Reiser ece7384be4 fpad4 from st_size(), not from getBytesWritten() 2011-05-28 12:18:27 -07:00
John Reiser 0c052e4506 amd64 output PT_LOAD[0] ends after loader 2011-05-20 10:29:04 -07:00
John Reiser 1996a0a3d6 32-bit shared libraries on i386 only (SourceForge bug 3286178) 2011-04-14 09:39:55 -07:00
László Molnár 679ad9b8c6 fixed computing of tls data end (sf.net bug 3256788) 2011-03-29 15:49:20 +02:00
John Reiser d4983731e7 More l_info.l_lszie and .l_checksum TargetEndian. 2011-03-28 11:11:05 -07:00
John Reiser 4fec3c8f34 Merge. 2011-03-28 10:45:47 -07:00
John Reiser 836fd2565f Place loader immediately after compressed PT_LOADs, in "middle" of file.
This moves compressed gaps and debuginfo out of compressed PT_LOADs,
and fixes a bug where large debuginfo would cause first mmap
at runtime to erase the loader (SourceForge bug 3239079).
2011-03-28 10:44:23 -07:00
John Reiser 54618064a1 l_info.l_lsize and .l_checksum are TargetEndian 2011-03-28 10:14:06 -07:00
John Reiser 519e3e01ae OutputFile implements read() and readx(); beware --stdout. 2011-03-28 10:12:36 -07:00
László Molnár aec8f81358 fixed a warning (sf.net bug 3241423) 2011-03-25 12:02:22 +01:00
John Reiser c1d6bf4366 avoid .so with DT_TEXTREL; SourceForge bug 3190915 2011-02-24 09:38:17 -08:00
Markus F.X.J. Oberhumer 9bf2b79d9e Enter 2011. 2011-01-03 08:49:23 +01:00
Markus F.X.J. Oberhumer 4d98408995 Remove trailing whitespace. 2010-12-29 15:46:55 +01:00
Markus F.X.J. Oberhumer 7b466388f9 Detabify. 2010-12-29 15:46:34 +01:00
Markus F.X.J. Oberhumer b926fb3c66 Fix __cdecl syntax error. 2010-12-24 10:38:30 +01:00
László Molnár 6c8d5c0d0e replaced abort() with internal_error() (sf.net bug 3101319) 2010-12-21 10:28:36 +01:00
László Molnár 5a1d234260 merge 2010-12-21 09:40:16 +01:00
John Reiser fd6d42c297 i386-linux.shlib-init needs empty LEXECDYN (sourceforge 3101319) 2010-12-20 10:20:10 -08:00
László Molnár 7310ad6e92 align TLS callbacks to 4 byte boundary 2010-12-20 14:57:24 +01:00
László Molnár 7e47b1348d fixed a typo 2010-12-20 10:51:29 +01:00
László Molnár 1e3555a6b7 added some input validity checks (for sf.net bug 3122661) 2010-12-20 00:35:57 +01:00
László Molnár 9a67ce5968 do not skip dlls with no imports from the preprocessed import data (sf.net bug 3125753) 2010-12-19 23:22:58 +01:00
Markus F.X.J. Oberhumer 279d7955f8 Keep entries sorted in Makefiles. 2010-12-03 01:04:16 +01:00
Markus F.X.J. Oberhumer db977c0bf5 Add a .dump file to repo. 2010-11-29 15:28:35 +01:00
Markus F.X.J. Oberhumer ba6bc59818 Update .hgignore. 2010-11-29 15:28:10 +01:00
John Reiser 6e8be0578c improve PIC_STRING 2010-11-18 08:23:08 -08:00
John Reiser 92f7d16b5e more flexible labels on trace output 2010-11-18 08:22:36 -08:00
John Reiser 40bb3c2f5e better PIC_STRING for __mips__ 2010-11-17 20:45:39 -08:00
John Reiser 56a6096221 better PIC_STRING for __mips__ 2010-11-17 20:42:01 -08:00
John Reiser ee37b42a91 DEBUG for MIPS i386-linux.elf-main.c 2010-11-17 20:21:41 -08:00
John Reiser 0806e61df4 move DEBUG_STRCON adjacent to uses 2010-11-17 15:17:03 -08:00
John Reiser 279ffeeefa unify DEBUG STR_* into i386-linux.elf-main.c from *.elf-fold.S 2010-11-17 14:32:24 -08:00
John Reiser 80c5ee2479 use up4() 2010-11-17 14:28:00 -08:00
John Reiser 16208544e5 ELFOSABI_NETBSD 2010-11-17 14:27:00 -08:00
John Reiser 6afeb24fdb use brand_netbsd 2010-11-17 12:49:29 -08:00
John Reiser e6357b81eb NetBSD version 5 requires PT_NOTE for PaX. Also adjust other *BSD and PT_NOTE.
[Tested OK on FreeBSD 8.1, NetBSD 5.1, OpenBSD 4.8.  Cleanup needed.]
2010-11-16 21:13:42 -08:00
John Reiser dfc2efe8a6 make_hatch_arm() needs sys_munmap; also fix ARM div10. 2010-11-15 11:51:46 -08:00
John Reiser f28b96f431 Stand-alone tracing for ARM stub; "#define DEBUG 1" then re-compile.
https://sourceforge.net/tracker/?func=detail&atid=102331&aid=3105926&group_id=2331
2010-11-13 21:30:34 -08:00
John Reiser a10293f8f7 ARM copy .e_flags from input to output to preserve soft_FP flag, etc. 2010-11-09 11:05:55 -08:00
John Reiser b1f02f91d7 NetBSD 5.0 wants PT_NOTE and branded executables 2010-11-09 10:47:53 -08:00
Markus F.X.J. Oberhumer e76fa45d86 Small upx_sanity_check() update. 2010-11-08 23:59:34 +01:00
Markus F.X.J. Oberhumer 06f43892a5 Set sane abort() default behaviour when using msvcrt. 2010-11-08 20:48:50 +01:00
Markus F.X.J. Oberhumer a094332b0d Silence some compilation warnings. 2010-10-23 11:40:41 +02:00
Markus F.X.J. Oberhumer 7b8779f534 Portability updates. 2010-10-20 01:46:38 +02:00
Markus F.X.J. Oberhumer 371bf20d19 New ACC version. 2010-10-17 10:10:23 +02:00
Markus F.X.J. Oberhumer 0f633ddd15 Bump version for next release. 2010-09-08 18:04:39 +02:00
Markus F.X.J. Oberhumer 7886ca7f5f Add tag for RELEASE_307. 2010-09-08 15:07:00 +00:00
Markus F.X.J. Oberhumer 9b4c11954d Prepare release. 2010-09-08 16:56:49 +02:00
László Molnár a1b724f30a NEWS updated 2010-09-08 16:02:04 +02:00
László Molnár 7c3b2fb9cc relocation entry for TLS callbacks is only needed when we do have TLS callbacks 2010-09-08 15:06:56 +02:00
Markus F.X.J. Oberhumer acef68d67e Bump version for next release. 2010-09-04 20:23:02 +02:00
Markus F.X.J. Oberhumer 7e393d5f1e Add tag for RELEASE_306. 2010-09-04 15:06:00 +00:00
Markus F.X.J. Oberhumer 955c31b165 Prepare release. 2010-09-04 13:11:59 +02:00
László Molnár e307cd48ad merge 2010-09-02 12:30:16 +02:00
László Molnár 25f8b9e451 added Stefan to THANKS 2010-09-02 12:27:50 +02:00
Markus F.X.J. Oberhumer e8ba14a2c1 Silence some compilation warnings. 2010-09-01 14:49:26 +02:00
Markus F.X.J. Oberhumer 9670d3341c Makefiles: sort result from wildcard, needed for unwise GNU make 3.82 change. 2010-09-01 14:10:14 +02:00
László Molnár cec9778fd5 added a NEWS entry for the win32 TLS callback stuff 2010-08-31 14:35:59 +02:00
John Reiser 7451db4a68 merge 2010-08-17 11:32:02 -07:00
John Reiser e31777ec53 ARM ELF EABI version 5
https://sourceforge.net/tracker/?func=detail&atid=102331&aid=3040129&group_id=2331
2010-08-17 11:30:17 -07:00
László Molnár 7aa0b3dc7a merge 2010-08-16 13:49:54 +02:00
László Molnár e7b2d5dc01 coding style updates - only whitespace changes 2010-08-16 13:36:10 +02:00
László Molnár 47d728667d merge 2010-08-16 13:20:28 +02:00
László Molnár e1f8989d54 removed dosish file endings 2010-08-16 13:09:27 +02:00
Stefan Widmann 1d8cb47830 TLS handling updated to v2, ASLR fix in unpacking 2010-08-13 17:44:21 +02:00
Markus F.X.J. Oberhumer faaa7c37a9 Remove duplicate file. 2010-08-08 16:32:59 +02:00
Markus F.X.J. Oberhumer 0aff9d8df4 Use consistent syntax for boolean preprocessor expressions. 2010-08-08 16:20:16 +02:00
Markus F.X.J. Oberhumer 30c3f8c1ac New ACC version. 2010-08-08 16:10:30 +02:00
John Reiser bcd2469e01 merge 2010-08-06 13:31:54 -07:00
John Reiser 983c6ae73d amd64 stub: relocate ADRX and ADRU after copy 2010-08-06 13:29:32 -07:00
Markus F.X.J. Oberhumer 6d8e1fe776 Start using acc_getopt. 2010-08-05 15:08:06 +02:00
Markus F.X.J. Oberhumer 99b4921309 New ACC version. 2010-08-05 15:06:03 +02:00
John Reiser 3c231c3c9e FreeBSD 8.x got picky about MAP_ANONYMOUS 2010-07-21 10:19:11 -07:00
John Reiser 175c0a6236 --unmap-all-pages affects i386-*BSD, too 2010-07-20 12:47:33 -07:00
John Reiser 0031ceb06c propagate changes from auxv_find() in i386-linux.elf-main.c 2010-07-17 08:22:09 -07:00
John Reiser e3cc5a63df don't erase AT_SYSINFO* if no conflict with decompressed folded stub 2010-07-17 08:19:50 -07:00
John Reiser 3cb61402c2 merge 2010-07-16 21:01:45 -07:00
John Reiser 5336c51199 Fix conflict between VDSO and unfolded decompressor for ET_DYN
(-fPIE) with unlimited stack on Linux-2.6.34 et al.
2010-07-16 20:58:52 -07:00
Markus F.X.J. Oberhumer 52aa658aaa Silence some compilation warnings. 2010-07-14 20:03:09 +02:00
John Reiser d08a51d7e4 fix don't-care uninit from valgrind(memcheck) 2010-07-07 09:52:58 -07:00
John Reiser d97a557ac3 unpacking PackMachFat::CPU_TYPE_X86_64 2010-06-28 16:02:57 -07:00
John Reiser 8a68d9cded more MACH_SEGMENT_ENUM; no code yet 2010-06-15 09:22:59 -07:00
László Molnár b031f7e902 always initialize variable use_tls_callbacks 2010-06-15 15:04:48 +02:00
Markus F.X.J. Oberhumer 963ffecb96 Update upx-tools link in README.SRC. 2010-06-09 15:15:37 +02:00
Markus F.X.J. Oberhumer 8f8aaca818 Remove trailing whitespace. 2010-06-06 22:40:10 +02:00
László Molnár 801f92b7e7 merge 2010-06-04 17:56:52 +02:00
László Molnár 44db45700e new version of .dump file 2010-06-04 17:55:13 +02:00
Stefan Widmann 25902005f6 win32/pe TLS handling added 2010-06-01 19:21:52 +02:00
John Reiser ffec71e0d8 Fix vmlinux/ppc32 at compress time. Runtime needs work. 2010-04-28 20:43:50 -07:00
John Reiser 99a208110b Detect LC_SEGMENT beyond end-of-file in PackMachBase<T>::find_SEGMENT_gap. 2010-04-28 20:05:23 -07:00
Markus F.X.J. Oberhumer e56799c993 Bump version for next release. 2010-04-27 17:26:05 +02:00
Markus F.X.J. Oberhumer 957eb300f8 Add tag for RELEASE_305. 2010-04-27 15:05:00 +00:00
Markus F.X.J. Oberhumer 626025d539 Prepare release. 2010-04-27 16:09:41 +02:00
Markus F.X.J. Oberhumer 9e8a0a020f Remove outdated ChangeLog target. 2010-04-26 18:29:28 +02:00
Markus F.X.J. Oberhumer 40f592eade Add one .dump file. 2010-04-26 18:27:54 +02:00
Markus F.X.J. Oberhumer 5e899f0be4 Silence some annoying compiler warnings. 2010-04-19 03:15:22 +02:00
Markus F.X.J. Oberhumer f2748284b1 New ACC version. 2010-04-19 03:15:01 +02:00
Markus F.X.J. Oberhumer a15ce00934 Fix some small memory leaks. Minor cleanup. 2010-04-10 13:57:25 +02:00
John Reiser 9e3e80261b merge 2010-03-31 14:15:18 -07:00
John Reiser c72c685434 Diagnose PT_LOAD beyond end-of-file.
https://sourceforge.net/tracker/?func=detail&atid=102331&aid=2979240&group_id=2331
2010-03-31 14:09:28 -07:00
Markus F.X.J. Oberhumer 0177a8d277 Use upx_snprintf instead of snprintf. 2010-03-31 02:23:06 +02:00
Markus F.X.J. Oberhumer b6a9b0a4c9 Silence some compilation warnings. 2010-03-31 02:16:32 +02:00
John Reiser f4f8bd8d42 Fix for "upx --help" constructs with (0===f) 2010-03-17 18:33:30 -07:00
John Reiser 6e4aeffc0c Withdraw support for shared libraries (.dylib) on Darwin (Apple Mac OS X). 2010-03-12 10:20:18 -08:00
John Reiser dba256d384 Fix amd64-darwin.dylib-entry.S so it compiles. 2010-03-11 14:37:17 -08:00
John Reiser 910008e9e7 Hack on amd64-darwin.dylib-entry.S 2010-03-10 18:58:38 -08:00
John Reiser 8cb9545c41 Hack on amd64-darwin.dylib-entry.S 2010-03-10 15:19:18 -08:00
John Reiser 59c16da6fb PackMachBase::pack4dylib avoid sliding if offset or reloff is 0. 2010-03-10 13:14:52 -08:00
John Reiser 630df5bbd2 Fix structs from Apple mach-o/loader.h for 64-bit. (Apple goofed.) 2010-03-10 10:29:41 -08:00
John Reiser f550111400 PackDylibAMD64 (Mac OS X shared library on x86_64) 2010-03-09 19:02:25 -08:00
John Reiser 77377195aa Allow CPU_TYPE_X86_64 for MH_EXECUTE in fat (universal) binaries,
but no MH_DYLIB yet.  infoWarning() for unsupported cputype.
2010-03-09 13:35:06 -08:00
John Reiser 7e2e72bd40 infoWarning for shlib with no DT_INIT 2010-03-09 13:03:03 -08:00
John Reiser aa7a13bd02 Linux kernels must be ET_EXEC 2010-03-09 09:22:57 -08:00
John Reiser 5895058a17 Linux kernels must be ET_EXEC 2010-03-09 09:20:46 -08:00
John Reiser ffb60d5149 memmove instead of overlapping memcpy 2010-03-08 22:01:25 -08:00
John Reiser 1e2cb279b0 Fix memory leak in --lzma compression. 2010-03-08 22:00:35 -08:00
John Reiser e7f766f5ba i386-linux.shlib: stub commonality with non-shlib 2010-03-08 17:33:56 -08:00
John Reiser 8de5aa9409 Fix ET_DYN main program on amd64-linux.elf. 2010-03-08 16:59:53 -08:00
John Reiser bf28a4df49 MIPS stub NRV_HEAD always saves $ra on stack.
bits.ash has the only __MIPSEL__/__MIPSEB__ dependency: lwl/lwr swl/swr.
2010-03-08 10:49:11 -08:00
Markus F.X.J. Oberhumer fe1a0ab371 Bump tentative release date. 2010-03-06 16:50:17 +01:00
Markus F.X.J. Oberhumer 01daccfaf7 Avoid compiler warnings. 2010-03-06 16:35:18 +01:00
Markus F.X.J. Oberhumer 94e861e298 Rebuild stubs. 2010-03-06 16:34:05 +01:00
Jens Medoch d36af2ed5c Import 3-upx-hg_mips-r3k_base.patch. 2010-03-06 16:27:38 +01:00
Jens Medoch 7104b33214 Import 2-upx-hg_mips-r3k_makefile.patch. 2010-03-06 16:26:32 +01:00
Jens Medoch 32998e5377 Import 1-upx-hg_mips-stub_clean-up.patch. 2010-03-06 16:25:58 +01:00
Jens Medoch af0c9ef092 Import 0-upx-hg_mips-r3k_ucl.patch. 2010-03-06 16:25:29 +01:00
Markus F.X.J. Oberhumer 3bc3b3d10e Detabify. Remove trailing whitespace. 2010-03-01 01:28:03 +01:00
John Reiser f03f42ca4d Linux preserve /proc/self/exe; --unmap-all-pages option 2010-02-28 15:58:08 -08:00
John Reiser 79783abeb1 merge 2010-02-20 20:48:42 -08:00
John Reiser 895b0bd602 merge 2010-02-20 20:46:20 -08:00
John Reiser 2ee5ee92f8 merge 2010-02-20 20:44:54 -08:00
John Reiser 3e619423b1 merge 2010-02-20 20:40:32 -08:00
John Reiser b524e18bdf merge 2010-02-20 20:40:20 -08:00
John Reiser 6aa4579db8 merge 2010-02-20 20:40:04 -08:00
John Reiser 17fb86c0f1 merge 2010-02-20 20:39:52 -08:00
John Reiser 62ecfe4873 merge 2010-02-20 20:39:39 -08:00
John Reiser 04e55e6b9a merge 2010-02-20 20:39:19 -08:00
John Reiser f432aa1090 merge 2010-02-20 20:39:04 -08:00
John Reiser 7add104313 merge 2010-02-20 20:38:20 -08:00
John Reiser 36de249066 merge 2010-02-20 20:36:34 -08:00
John Reiser b7a54dcffd merge 2010-02-20 20:26:08 -08:00
John Reiser 6bb28deab2 merge 2010-02-20 20:24:55 -08:00
John Reiser 7f88d15c86 ELF ::unpack decompressing ElfXX_Ehdr changes .e_phnum 2010-02-20 19:57:34 -08:00
John Reiser 94c5014e23 merge 2010-02-15 11:09:28 -08:00
John Reiser c5a8256500 mention Elf32_auxv[AT_EXECFN] 2010-02-15 11:07:46 -08:00
Markus F.X.J. Oberhumer 5f39884bf7 Silence a compiler warning. 2010-02-07 00:10:49 +01:00
Markus F.X.J. Oberhumer d96825a242 Fix a typo. 2010-02-07 00:10:38 +01:00
Markus F.X.J. Oberhumer 443a938091 New ACC version. 2010-02-06 17:18:46 +01:00
Markus F.X.J. Oberhumer 6bc3197721 Enter 2010. 2010-02-06 17:15:49 +01:00
John Reiser 269cc91fd5 Support share libraries on i386 and amd64 under linux. 2010-01-17 19:58:58 -08:00
Markus F.X.J. Oberhumer c1ddea479d Minor portability fixes. 2009-12-03 19:58:23 +01:00
John Reiser 5f3a95962c PackLinuxElf32::unpack fix ARM (thumb) 2009-10-26 13:35:14 -07:00
John Reiser ee1a8e6a32 eabi-linux.shlib unfilter in thumb mode 2009-10-26 10:37:11 -07:00
John Reiser eeae73296e thumb-eabi-linux.shlib, and use it (for smaller size) instead of ARM.
[Consider compress-time option to choose ARM vs thumb?]
2009-10-26 09:05:12 -07:00
John Reiser 4ca8357af4 Merge 2009-10-26 08:11:37 -07:00
John Reiser 8a5b8c87fb arm.shlib-init: escape hatch is 8 bytes; speedup movsl 2009-10-25 20:40:26 -07:00
John Reiser 6ab04d7bbc ::buildLinuxLoader empty FOLDEXED for shlib 2009-10-25 13:52:41 -07:00
Markus F.X.J. Oberhumer a5a1380636 Add missing .dump files to repo. 2009-10-24 13:55:36 +02:00
John Reiser eeab1aef64 Synonyms R_ARM_THM_PC22 and R_ARM_THM_XPC22 for R_ARM_THM_CALL. 2009-10-22 21:05:05 -07:00
John Reiser 4e1c342e55 arm-linux.shlib escape hatch: munmap temporary pages 2009-10-21 09:32:42 -07:00
John Reiser d8ed259bce arm-linux.shlib allow thumb interworking for DT_INIT 2009-10-21 08:13:09 -07:00
John Reiser 9f6cb5de4c armel-eabi-linux.shlib: improve integration with system calls. 2009-10-20 09:53:45 -07:00
John Reiser ba634118d7 Shorten runtime copying for armel-eabi-linux.shlib. 2009-10-19 22:28:44 -07:00
John Reiser 63da091d36 Compress shared library for armel-eabi-linux. 2009-10-19 20:48:46 -07:00
John Reiser ad0dc88a33 Cleanup some FIXME. amd64-linux.shlib forces 4KiB page size to save space. 2009-10-18 16:03:26 -07:00
John Reiser 147acf4b57 Compress shared library for amd64-linux. 2009-10-17 21:55:03 -07:00
John Reiser 5085f3a15e Allow ET_DYN on amd64-linux.elf 2009-10-16 17:47:16 -07:00
John Reiser 22a95ad8ea fix comment 2009-10-16 17:46:41 -07:00
John Reiser df4bd6a60c move PackLinuxElf32x86::unpack up the class hierarchy to PackLinuxElf32 2009-10-16 11:00:33 -07:00
John Reiser 813e7b05e4 fix .ui_total_passes when shlib 2009-10-16 10:56:15 -07:00
John Reiser ab8b486b4a Fix -Wshadow complaints. 2009-10-16 10:01:29 -07:00
Markus F.X.J. Oberhumer 590f666ec9 Enable -Wshadow compiler option. 2009-10-16 18:06:16 +02:00
Markus F.X.J. Oberhumer 9adaee915b Detabify. 2009-10-16 16:29:09 +02:00
Markus F.X.J. Oberhumer bce0f06fe9 Rebuild stubs so that they actually match the source code! 2009-10-16 16:27:52 +02:00
John Reiser 856ecb84a0 Compress shared library for i386-linux. DT_INIT must exist. Everything
needed by ld-linux for runtime relocation must be at the beginning of the
first PT_LOAD, etc.
2009-10-15 20:35:07 -07:00
John Reiser 90ddc06c98 DT_INIT, DT_CHECKSUM, DT_VERSYM, DT_VERDEF, DT_VERNEEDED 2009-10-14 17:50:35 -07:00
John Reiser 405abc4e95 ::packExtent updates ph.u_adler to satisfy verifyOverlappingDecompression()
even when 0==hdr_u_len
2009-10-14 17:47:02 -07:00
John Reiser 549c59ecf5 fix OutputFile::seek() for SEEK_SET and SEEK_END 2009-10-14 17:44:29 -07:00
John Reiser 0a485eafcb Better detection of Position Independent main Executables (gcc -pie -FPIC). 2009-10-10 14:50:30 -07:00
John Reiser e0c11956a6 ElfXX_Rel, ElfXX_Rela 2009-10-10 14:41:01 -07:00
John Reiser da6a9bf3eb Move conditional side effect (reset .all_methods_use_lzma)
out of ::PackExe constructor, so that Visitor pattern avoids it.
2009-10-09 16:09:53 -07:00
John Reiser dacd11e1cc Fix sourceforge bug #2874848: Mach/fat needs seek() after set_extent(). 2009-10-08 12:53:02 -07:00
Markus F.X.J. Oberhumer fc854b4c77 Bump version for next release. 2009-09-27 20:08:49 +02:00
Markus F.X.J. Oberhumer 4dcc1f0374 Add tag for RELEASE_304. 2009-09-27 20:07:28 +02:00
Markus F.X.J. Oberhumer fc57390242 Bump release date. 2009-09-27 20:06:01 +02:00
Markus F.X.J. Oberhumer bd15ef0a0c Bump tentative 3.04 release date. 2009-09-21 05:44:19 +02:00
Markus F.X.J. Oberhumer 967ecafc33 Small compatibility updates. 2009-09-21 05:41:49 +02:00
John Reiser 29576da985 catch up to bugfix for arm-darwin stub 2009-09-01 07:33:08 -07:00
John Reiser 200a2556ef New format Mach/AMD64 for 64-bit x86 programs on Apple Macintosh 2009-09-01 07:30:37 -07:00
John Reiser ae0ab5025e fix debug mixup 2009-09-01 07:21:18 -07:00
John Reiser aa74276b25 gcc-4.4.1 is more strict about 'const' 2009-08-30 19:44:45 -07:00
Markus F.X.J. Oberhumer b03112a5dd Silence some compilation warnings. 2009-06-09 13:11:21 +02:00
Markus F.X.J. Oberhumer a3f49df62d Remove trailing whitespace. 2009-06-09 09:43:00 +02:00
Markus F.X.J. Oberhumer aa2af3f6dd Add missing stub to repo. 2009-06-09 09:40:25 +02:00
John Reiser 20dcbc593c PackMachFat for MH_DYLIB, too. 2009-06-01 16:23:13 -07:00
John Reiser 472ba8c1fd UPX_F_DYLIB_PPC32 is big endian, so move to >=128 2009-06-01 12:38:20 -07:00
John Reiser d8345a44a4 Dylib/ppc32 format works. 2009-05-31 12:57:10 -07:00
John Reiser a187cb6c9c work on stub for powerpc-darwin.dylib-entry.S 2009-05-29 22:08:08 -07:00
John Reiser b89c0b35d1 bugfix: PackMachBase::pack2 first extent is Mach_header plus Mach_segment_commands 2009-05-29 13:38:43 -07:00
John Reiser 7ffcc0a5e7 powerpc-darwin.dylib 2009-05-27 10:19:50 -07:00
John Reiser bde43fbdfb PackMachBase<T>::pack4dylib to prepare for more architectures 2009-05-23 21:13:44 -07:00
John Reiser 3728b2208f Cleanup declaration of PackDylibI386. 2009-05-22 08:37:44 -07:00
John Reiser dc52a756ee i386-darwin.dylib-entry.bin.dump 2009-05-21 22:06:26 -07:00
John Reiser 98dc886841 i386-darwin kernel expects 64-bit off_t; we always use 0 for top 32 bits. 2009-05-21 21:50:17 -07:00
John Reiser d0cf104e43 Announce Dylib/i386 format in NEWS. 2009-05-20 08:11:04 -07:00
John Reiser d7ed2412f6 386-darwin.dylib decompressor chains to user .init_address 2009-05-20 07:10:14 -07:00
John Reiser 7d38f0e234 i386-darwin.dylib ::unpack 2009-05-19 15:57:18 -07:00
John Reiser 3e8d072d24 i386-darwin.dylib requires existing LC_ROUINTES command;
decompressor must not overwrite Mach_headers.
2009-05-19 09:43:05 -07:00
John Reiser 84ac771893 Decompression part for Mach dylib i386. 2009-05-18 11:59:11 -07:00
John Reiser 3a9e0b5be6 Compression part for Mach dylib i386. 2009-05-13 10:40:21 -07:00
Markus F.X.J. Oberhumer 9694ff433f Fix grammar in version date. 2009-04-19 20:14:24 +02:00
Markus F.X.J. Oberhumer 2e82e78b98 Bump tentative release date. 2009-04-19 18:46:31 +02:00
Markus F.X.J. Oberhumer aaef4bee27 Prefer memcpy() over struct-copy. 2009-04-19 18:44:17 +02:00
Markus F.X.J. Oberhumer 4ca8569488 Remove trailing whitespace. 2009-04-19 18:36:42 +02:00
John Reiser 8377ada3e0 catch up stubs for arm 2009-03-01 11:19:05 -08:00
John Reiser 8a034d59ed arm linux kernel --small: hand assembly for LzmaDecode 2009-02-26 13:07:11 -08:00
John Reiser 8e492d8798 arm linux kernel: decompress_kernel() returns length, not pointer 2009-02-25 13:50:55 -08:00
John Reiser 7974ef80d7 branch merge 2009-02-12 12:42:57 -08:00
John Reiser 3664d86430 i386-linux.elf-fold fix compressed size for ET_DYN 2009-02-12 12:41:10 -08:00
Markus F.X.J. Oberhumer 9adef80d6b Replace all __attribute_packed by new __packed_struct macros. 2009-02-12 05:20:23 +01:00
Markus F.X.J. Oberhumer be57adaee7 Update tools/armpe_tester. 2009-02-12 03:33:14 +01:00
Markus F.X.J. Oberhumer d117e442a4 Silence a compiler warning. 2009-01-27 19:05:18 +01:00
Markus F.X.J. Oberhumer 8820bc0796 Add support for LZMA SDK 4.62. Compiles, but pretty much untested. 2009-01-03 23:33:25 +01:00
Markus F.X.J. Oberhumer 57a64de023 Small conf.h update. 2009-01-01 13:40:52 +01:00
Markus F.X.J. Oberhumer 5ed689ceb0 Enter 2009. 2008-12-31 17:07:18 +01:00
Markus F.X.J. Oberhumer 25f1765f36 Support building with OpenWatcom 1.8. Silence some compiler warnings. 2008-12-31 16:56:38 +01:00
Markus F.X.J. Oberhumer 063bd58802 Silence gcc's -Wstrict-aliasing=1 warnings. 2008-12-29 23:15:56 +01:00
Markus F.X.J. Oberhumer 901c6b34fa New ACC version. 2008-12-29 23:14:54 +01:00
Markus F.X.J. Oberhumer 5b2d6488a2 Silence some compilation warnings. 2008-12-29 22:22:28 +01:00
László Molnár f6f35415d1 check processor type in PackW32Pe::canUnpack 2008-12-20 14:48:13 +01:00
Markus F.X.J. Oberhumer 6c6069e963 New ACC version. 2008-12-16 23:59:37 +01:00
Markus F.X.J. Oberhumer 6219d82560 Detabified some sources. 2008-11-16 19:03:40 +01:00
John Reiser 1dcd7a16ab add missing source file 2008-11-16 08:01:40 -08:00
John Reiser b60caeb9dd source files for arm-darwin.macho-*.S 2008-11-16 07:35:53 -08:00
John Reiser 4c4768aaf3 derived .h fles for arm-darwin.macho 2008-11-15 14:46:03 -08:00
John Reiser 2f4ac0a663 format UPX_F_MACH_ARMEL, class PackMachARMEL: iPhone 2008-11-15 14:44:19 -08:00
John Reiser 23a446f852 unshare armel-linux.elf-main.o vs. arm-linux.elf-main.o (for comiler flags) 2008-11-15 14:09:06 -08:00
John Reiser ec48334a1a propagate changes into stub/amd64-linux.elf-fold.h 2008-11-15 08:52:02 -08:00
John Reiser f4c061d412 amd64-linux.elf: workaround for SIGSEGV on Centos 5.2
https://sourceforge.net/tracker/?func=detail&atid=102331&aid=2136491&group_id=2331
2008-11-15 08:49:13 -08:00
John Reiser 31a076d7b3 PackVmlinuzARMEL: only 8-bit control words for compression 2008-11-15 08:44:50 -08:00
John Reiser 6bd43d986c sync stub for armel-linux.kernel.vmlinuz.h 2008-09-15 13:51:55 -07:00
John Reiser dd32a2f15a forgot source for armel-linux.kernel.vmlinuz stubs 2008-09-15 10:35:53 -07:00
John Reiser c88c20820f new format vmlinuz/armel for Debian NSLU2 (etc.) linux kernel 2008-09-15 10:18:19 -07:00
John Reiser 86de510731 bvmlinuz boot protocol 2.08 (not yet complete?) 2008-08-04 17:30:44 -07:00
John Reiser 0b31fbf827 armel-eabi sets Elf32_Ehdr::EI_ABIVERSION = 4 2008-08-04 17:29:59 -07:00
John Reiser 34ad1450eb boot protocol 2.08 for bvmlinuz; Extended ABI version 4 for armel-eabi 2008-08-04 17:28:23 -07:00
John Reiser e6ba71390d armel-eabi choose proper decompressor 2008-07-20 15:35:19 -07:00
John Reiser f0c8dbe0ec armel-eabi-linux.elf (Debian) new protocol for system calls 2008-07-20 05:41:51 -07:00
John Reiser bf046a8ccb more checking when treating ELF as .bin 2008-07-20 05:40:00 -07:00
John Reiser b05ba7683e bvmlinuz/386 boot protocol 2.08 has gzipped ELF [needs more work] 2008-07-18 15:02:28 -07:00
John Reiser aedf8dad15 amd64 argc can be zero 2008-07-16 14:56:44 -07:00
John Reiser 74ebb7c722 more get_te32(&...) needed for endian neutrality 2008-07-16 13:49:28 -07:00
John Reiser 1307f66494 stub/i386-*.*-fold.S: allow 0==argc 2008-05-15 09:05:20 -07:00
John Reiser 448a24cb36 PackVmlinuzI386::getStrategy(), and Bvmlinuz guesses 60% .text;
stack for Bvmlinuz uses vacant Vmlinuz low memory (512 KiB)
2008-05-02 04:59:39 -07:00
Markus F.X.J. Oberhumer 7266f23450 New ACC version. 2008-04-30 02:45:13 +02:00
Markus F.X.J. Oberhumer c0ad31acfc Bump version for next release. 2008-04-27 18:46:52 +02:00
Markus F.X.J. Oberhumer 25d3a0de27 Added tag for RELEASE_303. 2008-04-27 11:38:15 +02:00
John Reiser 1e38bbfbc1 merge 2008-04-26 13:08:13 -07:00
John Reiser 1c62e95812 Bvmlinuz fix filters 2008-04-26 13:04:13 -07:00
Markus F.X.J. Oberhumer d453cc27a3 Style: start using correct IEC binary prefix (KiB, MiB, ...) - see
http://en.wikipedia.org/wiki/Binary_prefix for more details.
2008-04-26 08:48:13 +02:00
Markus F.X.J. Oberhumer 2c3e841d8a Fix comment. 2008-04-26 08:23:05 +02:00
John Reiser 50668c462f Bvmlinuz h.sys_size, and more heuristics 2008-04-25 12:07:38 -07:00
John Reiser 8d1192e832 Bvmlinuz,Vmlinuz make room for largest possible decompression stack
by moving kernel command line up, and real mode area down
2008-04-24 12:15:07 -07:00
John Reiser 4a8e2e9ed4 grub-0.97-33.fc9 does not leave enough room for lzma 2008-04-23 16:37:16 -07:00
Markus F.X.J. Oberhumer 12fc45220a Shorten --help text. 2008-04-17 14:07:03 +02:00
Markus F.X.J. Oberhumer 6bce68fbe7 Bump tentative release date. 2008-04-17 12:16:23 +02:00
Markus F.X.J. Oberhumer d54f947c98 Add Packer::hasLoaderSection() to handle missing CFLUSH sections. 2008-04-07 18:44:00 +02:00
Markus F.X.J. Oberhumer 6c8bb3a22e Rebuild all stubs with new formatting - no binary changes. 2008-04-04 17:21:24 +02:00
Markus F.X.J. Oberhumer ed29ce5183 bin2h.py: improve formatting. 2008-04-04 17:20:17 +02:00
Markus F.X.J. Oberhumer a51d269b7c Use new bin2h.py mode. 2008-04-04 16:37:12 +02:00
Markus F.X.J. Oberhumer 8283e4e6d6 bin2h.py: add support for --mode=gas-be32 and --mode=gas-le32. 2008-04-04 16:35:58 +02:00
John Reiser 23ce91eb55 MIPS big-endian lzma build rules 2008-04-03 09:01:55 -07:00
John Reiser 545ac7fcfa Merge 2008-04-02 19:10:39 -07:00
John Reiser 3926ccccad MIPS-linux.elf flush icache after moving decompressor 2008-04-02 19:09:31 -07:00
Markus F.X.J. Oberhumer f431307ef2 Silence some compilation warnings. 2008-04-02 19:24:05 +02:00
Markus F.X.J. Oberhumer ca368e0f9b Add a note about broken scanf() implementations. 2008-04-02 16:34:31 +02:00
John Reiser 8afeb56c11 Big-endian MIPS NRV nested subroutine must save+restore register ra. 2008-04-01 22:09:14 -07:00
John Reiser 2a6f90c5f3 Big-endian MIPS must fetch NRV 32-bit "control" words as little endian. 2008-04-01 20:06:27 -07:00
John Reiser 271031128e Fix ElfLinkerMipsBE::relocate1. Create CFLUSH section in
mipsel.r3000-linux.elf-entry.S and powerpc-darwin.macho-entry.S .
2008-03-31 08:55:35 -07:00
John Reiser b991f954d0 Fix "Failure with Ubuntu 7.10" SourceForge Bug tracker 1825006
when --force-execve with kernel 2.6.22-14-generic et al.
2008-03-27 15:51:19 -07:00
John Reiser f12bb3f80d bvmlinuz must preserve register esi 2008-03-04 15:41:42 -08:00
Markus F.X.J. Oberhumer 6dc978e8d8 Remove trailing whitespace. 2008-02-28 00:04:32 +01:00
John Reiser 9f05a873bc Merge 2008-02-26 12:17:21 -08:00
John Reiser 703d498772 Implement cache flush for PowerPC. 2008-02-26 12:15:09 -08:00
Markus F.X.J. Oberhumer ed3b9543bb Cosmetic Makefile update. 2008-02-26 02:59:00 +01:00
Markus F.X.J. Oberhumer fc7efba7d8 Silence some compilation warnings. 2008-02-26 02:55:39 +01:00
Markus F.X.J. Oberhumer b3178fe8f4 stub/Makefile: cosmetic updates. 2008-01-30 16:39:45 +01:00
Markus F.X.J. Oberhumer e36798a993 Remove unused stub/amd64-linux.kernel.vmlinuz. 2008-01-30 16:19:46 +01:00
Markus F.X.J. Oberhumer a143605465 Remove trailing whitespace. 2008-01-30 07:22:32 +01:00
Markus F.X.J. Oberhumer d3ad35b21e Rebuild stubs. 2008-01-30 07:20:45 +01:00
Markus F.X.J. Oberhumer 68134941bf Small Makefile update. 2008-01-30 07:20:19 +01:00
John Reiser 54d0fef559 BvmlinuzI386 runtime-relocatable kernels 2008-01-29 10:33:45 -08:00
Markus F.X.J. Oberhumer 7f9c47176a Introduce target endianness accessors get_teXX() and set_teXX() in packer.h to
replace all [gs]et_nativeXX() member functions.
2008-01-09 13:57:47 +01:00
Markus F.X.J. Oberhumer 9060ac7897 Rename template integral types from U32 to TE32 to emphasize on target
endianness.
2008-01-09 12:45:44 +01:00
John Reiser d9073e4a17 PackVmlinuzI386 detects non-relocated kernel 2008-01-08 09:03:21 -08:00
Markus F.X.J. Oberhumer de1c1d7cc2 Update help header message. 2008-01-02 11:40:16 +01:00
Markus F.X.J. Oberhumer 6ff1bd5917 Update my email address. 2008-01-02 10:12:42 +01:00
Markus F.X.J. Oberhumer a6b04f426e Bump version year. 2008-01-02 09:47:52 +01:00
Markus F.X.J. Oberhumer fa49dbe2cb Enter 2008. 2008-01-02 09:42:31 +01:00
Markus F.X.J. Oberhumer 682eb04a52 New ACC version. 2008-01-02 09:34:45 +01:00
Markus F.X.J. Oberhumer 77064fb09e Makefile update. 2008-01-02 09:32:32 +01:00
Markus F.X.J. Oberhumer be8d93563a Introduce first --mp-xxx options. 2007-12-20 06:39:31 +01:00
Markus F.X.J. Oberhumer d4a6a5216d Makefile updates. 2007-12-18 22:37:30 +01:00
Markus F.X.J. Oberhumer 1cb1427050 Detabify. 2007-12-17 06:00:33 +01:00
Markus F.X.J. Oberhumer e4f4eace1c Added support for LZMA SDK 4.57. Compiles, but pretty much untested. 2007-12-17 05:54:08 +01:00
Markus F.X.J. Oberhumer 30a98b7e8c Remove trailing whitespace. 2007-12-17 05:49:34 +01:00
Markus F.X.J. Oberhumer d36c8d95ad Bump version for next release. 2007-12-16 15:10:44 +01:00
Markus F.X.J. Oberhumer 506bd0abcf Add tag for RELEASE_302. 2007-12-16 15:08:32 +01:00
Markus F.X.J. Oberhumer 8dd810c41d Bump release date. 2007-12-16 15:07:05 +01:00
John Reiser d9d0dc5201 get_native(&Elf32_Phdr.p_align) 2007-12-15 10:07:09 -08:00
Markus F.X.J. Oberhumer 72880d9e03 Disable leftover debug printf statements. 2007-12-12 08:36:03 +01:00
Markus F.X.J. Oberhumer 6c7ec6eb1b Update brandelf.py. 2007-12-12 05:25:15 +01:00
Markus F.X.J. Oberhumer 705fc5d116 Rebuild stubs. 2007-11-27 01:12:45 +01:00
Markus F.X.J. Oberhumer d20b575b9b Merge. 2007-11-27 01:12:09 +01:00
John Reiser c949beab9c mipsel.r3000-linux.elf-entry.S syscall clobbers t8 2007-11-26 14:56:23 -08:00
Markus F.X.J. Oberhumer 3fb857c435 Cleanup brandelf.py. 2007-11-26 19:57:00 +01:00
Markus F.X.J. Oberhumer 0a4f999ade Fix missing rebuild from previous commit. 2007-11-25 08:59:52 +01:00
John Reiser f0b7147881 mips*.r3000-linux.elf clear stack to workaround suspected bug in glibc-2.3.2 2007-11-24 15:24:10 -08:00
John Reiser b36a42cd0a PackVmlinuzI386 detects relocatable kernel (cannot handle yet) 2007-11-20 12:01:50 -08:00
Markus F.X.J. Oberhumer 000309b47f stub: remove filename from dumps in order reduce diff noise when renaming files. 2007-11-20 06:34:48 +01:00
Markus F.X.J. Oberhumer 5cb12988f0 Merge. 2007-11-20 06:31:16 +01:00
John Reiser 50c4b749ec PackVmlinuxBase<T>::pack always defineFilterSymbols(), esp. for PackVmlinuxAMD64 2007-11-19 18:39:25 -08:00
Markus F.X.J. Oberhumer 5db2734e6f Small Makefile updates. 2007-11-19 09:48:27 +01:00
Markus F.X.J. Oberhumer e9e5507483 stub: rename "mipseb" to "mips". 2007-11-14 04:54:33 +01:00
Markus F.X.J. Oberhumer d63dc7adfb stub: we can reuse our existing mipsel-* tools for mips (big endian). 2007-11-14 04:40:40 +01:00
John Reiser 27db44a8db generated headers for mipseb.r3000-linux.elf 2007-11-13 17:54:05 -08:00
John Reiser 1a035e2866 PackLinuxElf32::canPack must use explicit get_native32 2007-11-13 11:11:31 -08:00
John Reiser 887aa20116 ElfLinkerMipsBE is big endian 2007-11-13 11:09:15 -08:00
John Reiser 5e03d86695 new PackLinuxElf32mipseb 2007-11-13 11:08:48 -08:00
John Reiser 95075aa28e MIPSEB implementation [still broken because no big-endian tools] 2007-11-12 09:23:45 -08:00
John Reiser 0260f0790a mipseb.r3000-linux.elf [broken because no big-endian tool chain] 2007-11-12 09:12:51 -08:00
John Reiser 34d65ba292 ET_DYN -fPIE position-independent executables 2007-11-12 09:11:16 -08:00
John Reiser 27a77a15ed prepare to deal with DT_GNU_HASH instead of DT_HASH 2007-11-12 09:05:36 -08:00
John Reiser 76025bfae1 _NR_link 2007-11-12 08:54:34 -08:00
John Reiser 4957faf482 DT_GNU_HASH, DT_JMPREL, etc. 2007-11-12 08:54:02 -08:00
Markus F.X.J. Oberhumer 0d8e16d5c8 Rename nocopy to noncopyable. 2007-11-07 23:13:20 +01:00
Markus F.X.J. Oberhumer 07baed1581 Improved IO error checking. 2007-11-06 03:21:32 +01:00
Markus F.X.J. Oberhumer eab5da075a And yet some more dos/exe size reduction. 2007-09-14 16:59:19 +02:00
Markus F.X.J. Oberhumer 0d1bbb19ce Small Makefile cleanup. 2007-09-14 16:31:17 +02:00
Markus F.X.J. Oberhumer 58d6cbc6ac More dos/exe lzma size reduction. 2007-09-14 16:03:51 +02:00
Markus F.X.J. Oberhumer 4d3b627839 Save some more bytes in dos/exe lzma stub. 2007-09-14 15:47:18 +02:00
Markus F.X.J. Oberhumer 49455c99ad Save 1 byte in dos/exe stub. 2007-09-14 13:48:00 +02:00
Markus F.X.J. Oberhumer 31bb6bedbd stub i086: use decimal constants. 2007-09-13 22:52:43 +02:00
Markus F.X.J. Oberhumer 8d54678ea1 Switch back to using binutils-multiarch-2.17. 2007-09-13 20:14:29 +02:00
Markus F.X.J. Oberhumer 590767c299 Make stub files compatible with binutils-multiarch-2.18. 2007-09-13 19:59:41 +02:00
John Reiser ec1bd342b8 fix error checking in mmap for i386-linux.elf [triggered by -fPIE] 2007-09-08 06:55:47 -07:00
John Reiser b031c9e7f6 fix unmapping on arm-linux.elf 2007-08-30 11:55:58 -07:00
John Reiser ea0dfe83b7 arm-linux.elf-entry.S clobbered ADRU with sz_unc of fold 2007-08-30 11:53:16 -07:00
Markus F.X.J. Oberhumer bdd90f2c57 Allow setting the compression method in the environment variable (popular
request from our users).
2007-08-04 12:13:09 +02:00
Markus F.X.J. Oberhumer 288dac5d70 Bump version for next release. 2007-07-31 22:50:23 +02:00
Markus F.X.J. Oberhumer 9d22e1c35e Added tag for RELEASE_301. 2007-07-31 22:42:40 +02:00
Markus F.X.J. Oberhumer ace2359e7b Bump tentative release date. 2007-07-31 15:06:53 +02:00
Markus F.X.J. Oberhumer 617e6510a5 docs: mention a workaround for --exact option. 2007-07-31 15:00:38 +02:00
Markus F.X.J. Oberhumer 26024770b8 For the moment we always throwCantPack() for arm/pe and win32/pe. 2007-07-30 17:47:42 +02:00
Markus F.X.J. Oberhumer d556f58e34 Fix screen problems by not relying on pass number in startCallback(). 2007-07-30 17:27:43 +02:00
Markus F.X.J. Oberhumer b6f302dfc0 Makefile: use /bin/echo for better portability. 2007-07-30 12:56:35 +02:00
Markus F.X.J. Oberhumer 8e9b5f14af Small Makefile updates. 2007-07-11 07:03:05 +02:00
Markus F.X.J. Oberhumer 3635c00143 Added support for LZMA SDK 4.49. Compiles, but pretty much untested. 2007-07-08 13:58:08 +02:00
Markus F.X.J. Oberhumer abc71baaa6 Avoid some warnings. 2007-07-08 11:42:45 +02:00
John Reiser 959aaebede bvmlinuz piggy.o need not be last in bzImage 2007-07-02 14:27:31 -07:00
John Reiser d17f8c5049 linux-2.6.21.5 CONFIG_PARAVIRT 2007-07-02 12:48:14 -07:00
Markus F.X.J. Oberhumer 42a7201a70 Updated README.1ST. 2007-06-19 15:26:02 +02:00
Markus F.X.J. Oberhumer 1f1744a49a Added new options --no-mode, --no-owner and --no-time. 2007-06-19 15:14:12 +02:00
Markus F.X.J. Oberhumer fd7dbe5bd9 Update docs of --exact option. 2007-06-19 14:49:53 +02:00
Markus F.X.J. Oberhumer 984549400d Clean up various names in getFullName(). 2007-06-12 14:25:00 +02:00
Markus F.X.J. Oberhumer cf0c49277e Add processing instructions to gpp_inc.py. 2007-06-12 13:40:35 +02:00
Markus F.X.J. Oberhumer 16c3f9fa9c Small Makefile updates. 2007-06-12 12:46:56 +02:00
John Reiser 2f2539cf34 workaround weak python script gpp_inc.py 2007-06-10 06:54:10 -07:00
John Reiser e66823d017 mipsel.r3000-linux: flush cache for NRV, fix stub copying when big 2007-06-09 17:13:50 -07:00
John Reiser 881c32a3df fix NRV_HEAD and NRV_TAIL in stub for mipsel.r3000-linux 2007-06-09 13:52:56 -07:00
John Reiser ea0a361c35 fix argv[0] on PowerPC with --lzma 2007-06-04 10:13:14 -07:00
László Molnár dc60f8bb7b merge 2007-05-18 16:11:11 +02:00
László Molnár 9e92c9ea12 pe: added a check for too small object alignment 2007-05-17 18:02:50 +02:00
John Reiser a503a54240 mipsel remember /proc/self/exe in environment 2007-05-16 15:37:22 -07:00
John Reiser 265957712a merge 2007-05-16 13:56:37 -07:00
John Reiser c26962bb71 fix build glitch 2007-05-16 13:53:17 -07:00
John Reiser a428eddf93 catch up automatically-generated files 2007-05-16 13:51:44 -07:00
John Reiser dc4f7eb2f9 mipsel close() 2007-05-16 13:51:00 -07:00
John Reiser d54ac1ba91 use register $25 for trampoline 2007-05-16 13:50:16 -07:00
John Reiser a3d46b18ac cacheflush 2007-05-16 13:49:54 -07:00
John Reiser e81dd05666 bug in make_hatch_*(); simplify xfind_pages() when MAP_FIXED; update AT_BASE 2007-05-16 13:48:44 -07:00
Markus F.X.J. Oberhumer 29394935e3 Use -Wstrict-prototypes CFLAGS in stub/Makefile. 2007-05-16 04:34:30 +02:00
Markus F.X.J. Oberhumer df8acc4ed7 Added .NOTPARALLEL to stub/Makefile. 2007-05-14 11:30:40 +02:00
John Reiser 81928d4ab1 mipsel stub escape hatch for munmap 2007-05-10 13:13:11 -07:00
John Reiser 3ebf93e03d mipsel syscall read+write of same register 2007-05-09 22:17:09 -07:00
John Reiser 59e4032f1f mipsel stub syscall registers 2007-05-08 13:33:00 -07:00
John Reiser 8f15777427 merge 2007-05-08 10:43:50 -07:00
John Reiser 748c4bf780 mipsel stub system calls 2007-05-08 10:41:13 -07:00
László Molnár befcf6d2b3 merge 2007-05-08 18:25:00 +02:00
László Molnár 48236ecd3c fixed an incorrect error message caused by a bug in relocation handling 2007-05-08 18:23:41 +02:00
Markus F.X.J. Oberhumer f340f84de7 Avoid warnings. 2007-05-08 16:12:42 +02:00
Markus F.X.J. Oberhumer 40e19293f9 Added throwOutOfMemoryException(). 2007-05-08 15:28:35 +02:00
John Reiser f252f824a4 mipsel conditional stub/src/i386-linux.elf-main.c 2007-05-08 05:48:15 -07:00
John Reiser 1d7e5a8130 typedef struct Extent 2007-05-08 05:18:41 -07:00
John Reiser cb2ff92c2f mipsel hack stub 2007-05-07 21:03:58 -07:00
John Reiser ef373ab54f mipsel hacking 2007-05-07 19:20:25 -07:00
John Reiser 9141a78c29 mipsel stub for mmap on Linux (not NetBSD); and subroutine arg[4..6]
in t0..t2 instead of on stack, to match LMZA_DEC20
2007-05-07 07:02:16 -07:00
John Reiser 10a6370738 hacking UPX_F_LINUX_ELF32_MIPSEL 2007-05-06 14:21:25 -07:00
John Reiser 573009eeb6 new format UPX_F_LINUX_ELF32_MIPSEL [work in progress] 2007-05-06 06:17:49 -07:00
John Reiser c3363712d9 PackVmlinuxBase<T>::pack() EM_PPC filter only contiguous instruction sections 2007-05-01 19:12:55 -07:00
John Reiser faa33d89a2 Documentation: UPX_F_VMLINUX_PPC32 changes to arch/powerpc/boot/main.c 2007-04-30 13:48:50 -07:00
John Reiser f347458c53 new format UPX_F_VMLINUX_PPC32 Linux kernel for PowerPC (32-bit) 2007-04-30 13:34:06 -07:00
Markus F.X.J. Oberhumer 530e6d9196 Bump version for next release. 2007-04-30 19:34:26 +02:00
Markus F.X.J. Oberhumer b398e18e12 Added tag for RELEASE_300. 2007-04-30 19:32:35 +02:00
Markus F.X.J. Oberhumer 747e8370e0 Remove debug leftover. 2007-04-26 16:20:01 +02:00
Markus F.X.J. Oberhumer 2c67875781 Pass and verify original data in all xxx_test_overlap() functions. 2007-04-26 16:15:49 +02:00
Markus F.X.J. Oberhumer c96e8a8c19 Better underflow and overflow handling in Packer::findOverlapOverhead(). 2007-04-26 13:59:01 +02:00
Markus F.X.J. Oberhumer 5f203fc082 Avoid warnings. 2007-04-26 13:13:26 +02:00
John Reiser b943c9b471 fix upx_zlib_test_overlap 2007-04-25 20:24:30 -07:00
John Reiser 1a90a1daa8 Implement upx_zlib_test_overlap() following upx_lzma_test_overlap() 2007-04-25 20:19:40 -07:00
John Reiser 72dfc743fd upx_lzma_test_overlap cleanup 2007-04-25 20:11:04 -07:00
John Reiser 465307655b Implement real upx_lzma_test_overlap().
Also make Packer::findOverlapOverhead() more pessimistic in worst case.
2007-04-25 16:11:33 -07:00
John Reiser 6ce71e6694 upx_lzma_test_overlap revert to 256 [FIXME] 2007-04-25 10:54:00 -07:00
John Reiser 7f01b3b92a upx_lzma_test_overlap() heuristic overlap_overhead up to 0xA00 2007-04-25 09:19:29 -07:00
John Reiser 76950d56b9 PackUnix::canPack allow incompressible extents in getPackHeader() 2007-04-25 09:18:31 -07:00
Markus F.X.J. Oberhumer c11e0d02b3 Added parm "allow_incompressible" to Packer::{get,read}PackHeader(). 2007-04-25 17:33:39 +02:00
Markus F.X.J. Oberhumer 4c798c1718 Use official name "armeb" instead of "armbe". 2007-04-25 16:50:51 +02:00
Markus F.X.J. Oberhumer 450d7e9ad4 Merge. 2007-04-25 16:42:41 +02:00
Markus F.X.J. Oberhumer b8ab79c83e Use offical name "arm" instead of "armel". 2007-04-25 16:42:08 +02:00
John Reiser 6934bdd533 allow unpack of incompressible extents, such as
http://www.equi4.com/pub/tk/8.4.13/tclkit-linux-x86.gz
2007-04-25 07:34:24 -07:00
John Reiser 84dedb73a5 propagate changes arm*-linux.elf-fold.h 2007-04-24 16:08:34 -07:00
John Reiser 8964aa5221 fix endian issue with .b_method (arm-linux.elf-entry.S) 2007-04-24 12:05:53 -07:00
Markus F.X.J. Oberhumer 3481ae236c Added missing armeb generated files. 2007-04-23 18:11:24 +02:00
John Reiser 46adc5f8a4 armeb-linux.kernel.vmlinux.S 2007-04-23 09:00:28 -07:00
John Reiser 5296df5899 add armeb-linux.kernel.vmlinux-head.S 2007-04-23 08:53:53 -07:00
John Reiser 13dad4be16 merge 2007-04-23 07:22:36 -07:00
John Reiser b5d0c343b4 sync src/Makefile with Markus bfb3d24c1fe7 2007-04-23 07:15:42 -07:00
Markus F.X.J. Oberhumer b00b945264 src/Makefile: avoid rebuilding .depend file on clean targets 2007-04-23 08:23:01 +02:00
John Reiser 3bda09e105 more cleanup armel etc 2007-04-22 20:04:13 -07:00
John Reiser 32d32c4e4a cleanup ARMEL etc. 2007-04-22 19:52:23 -07:00
John Reiser 497441b54e merge 2007-04-22 16:19:13 -07:00
John Reiser 9c564fd4c7 Add file formst UPX_F_LINUX_ELF32_ARMEB and normalize spelling
of ARMEL, ARMEB, armel, armeb.
2007-04-22 16:09:18 -07:00
John Reiser 0c2263d0e9 fix O_INP etc because cto8 is not pushed.
This change should have paralleled 1382:367eb149f29c
(Sun Aug 20 11:19:37 2006 -0700)
2007-04-22 15:50:24 -07:00
John Reiser 3d4d30766d merge 2007-04-22 15:24:17 -07:00
John Reiser 99d84d44fc propagate change to O_INP 2007-04-22 14:50:58 -07:00
John Reiser 41ba7077ad propagate change to O_INP 2007-04-22 14:50:58 -07:00
John Reiser 8a929a91c3 Fix O_INP etc because calling sequence changed to omit cto8.
This parallel change was forgotten at:
   changeset:   1382:367eb149f29c
   date:        Sun Aug 20 11:19:37 2006 -0700
   summary:     i386-linux.elf decompress does not need cto8
2007-04-22 14:47:08 -07:00
Markus F.X.J. Oberhumer 0604f06841 Backed out changeset 1b7b0715e0ab0d3b2e8afc96ac95d46d44bf3618 2007-04-23 07:36:46 +02:00
John Reiser 229924adf9 Fix O_INP etc because calling sequence changed to omit cto8.
This parallel change was forgotten at:
   changeset:   1382:367eb149f29c
   date:        Sun Aug 20 11:19:37 2006 -0700
   summary:     i386-linux.elf decompress does not need cto8
2007-04-22 14:47:08 -07:00
Markus F.X.J. Oberhumer df988b7c69 Bump tentative release date. 2007-04-22 16:55:41 +02:00
John Reiser e8106e2e34 propagate change to 'loadcon8' macro 2007-04-18 09:55:15 -07:00
John Reiser c21d3e24f8 fix 'loadcon8'; was bad for big-endian vmlinux ARM 2007-04-18 09:52:52 -07:00
Markus F.X.J. Oberhumer 2d87aa0753 Better ctok32 fix. 2007-04-02 18:57:42 +02:00
László Molnár b2ad4dc9a0 another fix for ctok32 2007-04-02 14:12:16 +02:00
László Molnár 370f2ea98f tmt/adam: fixed a ctok32 related bug 2007-04-01 17:31:48 +02:00
László Molnár a05ca565ff fixed a bug in ctok32 2007-04-01 17:07:43 +02:00
László Molnár 52255637f2 give an error for x86/wince files 2007-03-22 13:45:03 +01:00
Markus F.X.J. Oberhumer 0fcaa3a2f5 Work around broken scanf() implementations. 2007-03-22 07:30:16 +01:00
László Molnár 0e2fa6eb9d no need to warn for x86 wince files 2007-03-20 09:30:30 +01:00
Markus F.X.J. Oberhumer 1aac462c83 Remove trailing whitespace. 2007-03-15 07:36:58 +01:00
Markus F.X.J. Oberhumer 2a0edfd8f7 Small update from Jens. 2007-03-15 01:41:07 +01:00
László Molnár 1f59a9f846 more PS1 updates from Jens 2007-03-12 12:11:17 +01:00
László Molnár 80c20a90ea PS1 updates from Jens 2007-03-12 11:56:16 +01:00
Markus F.X.J. Oberhumer 56a35649fe Update Makefiles. 2007-03-09 07:59:50 +01:00
Markus F.X.J. Oberhumer f07cea0b79 Update help string. 2007-03-09 07:59:36 +01:00
Markus F.X.J. Oberhumer 4c1b08a281 Bump version for next release. 2007-03-08 08:26:28 +01:00
Markus F.X.J. Oberhumer 117f9eddcd src/Makefile: use an explicit .depend file. 2007-03-08 08:19:27 +01:00
Markus F.X.J. Oberhumer 7bbbfce482 Added tag for RELEASE_293. 2007-03-08 06:16:24 +01:00
Markus F.X.J. Oberhumer f37a7811f9 Merge. 2007-03-08 03:00:00 +01:00
László Molnár 9173c10239 yet another spelling fix 2007-03-07 17:00:18 +01:00
László Molnár 318b31550d spelling fixes 2007-03-07 14:22:37 +01:00
Markus F.X.J. Oberhumer c18ebc63a6 dos/exe: enable optimized code paths. 2007-03-06 18:14:32 +01:00
Markus F.X.J. Oberhumer d704694272 Merge. 2007-03-06 15:57:13 +01:00
Markus F.X.J. Oberhumer 1cfec3bdf7 dos/exe: enable one small optimization. 2007-03-06 15:56:51 +01:00
John Reiser fe6ea6bc10 merge 2007-03-06 06:44:26 -08:00
Markus F.X.J. Oberhumer d29c8df45e dos/exe improvements, not enabled yet. 2007-03-06 15:08:24 +01:00
John Reiser 71f996af95 spelling 2007-03-05 21:26:36 -08:00
Markus F.X.J. Oberhumer d9722ad6b3 dos/exe: make sure minsp is even. 2007-03-04 19:27:04 +01:00
Markus F.X.J. Oberhumer 398fd8028c Spelling fixes. 2007-03-04 17:39:21 +01:00
Markus F.X.J. Oberhumer 1345a3cfd3 Bump tentative release date. 2007-03-04 17:13:11 +01:00
Markus F.X.J. Oberhumer 7eb0b195b8 dos/exe: don't clear the dirty stack - DOS does not do this either 2007-03-04 17:10:32 +01:00
Markus F.X.J. Oberhumer 009caee82d docs: typo fixes. 2007-03-04 17:01:50 +01:00
Markus F.X.J. Oberhumer 3bdc805a22 dos/exe: only use bx_magic when needed. 2007-03-04 17:01:32 +01:00
Markus F.X.J. Oberhumer ac457792b4 Minor dos/exe stub optimizations. 2007-03-04 16:47:13 +01:00
Markus F.X.J. Oberhumer 1377b54b9e dos/exe: optimize M_PIA_small. 2007-03-04 15:20:09 +01:00
Markus F.X.J. Oberhumer 66418ffc8c Reorganize dos/exe. No stub changes. 2007-03-04 15:14:44 +01:00
László Molnár b4c4b1fb70 dos/exe: fixed a bug in relocation handling 2007-03-01 16:57:12 +01:00
Markus F.X.J. Oberhumer ffe4a4b047 dos/exe: clear the dirty stack. 2007-02-26 13:55:12 +01:00
László Molnár 753ce45310 dos/exe: better minsp approximation 2007-02-26 12:54:49 +01:00
Markus F.X.J. Oberhumer fece0d73e7 Update NEWS. Bump version date. 2007-02-26 01:37:03 +01:00
Markus F.X.J. Oberhumer edce076e68 Minor Makefile updates. 2007-02-26 01:33:08 +01:00
Markus F.X.J. Oberhumer 675d0a009a Use M_IS_LZMA. 2007-02-26 01:32:36 +01:00
Markus F.X.J. Oberhumer 5d41b5a4db Fix shld macro. 2007-02-26 00:52:18 +01:00
László Molnár fe53b135eb pe: better icon compression handling 2007-02-24 23:25:11 +01:00
László Molnár 5b1c154ee2 NEWS update 2007-02-23 13:46:52 +01:00
László Molnár 816d882611 dos/exe: nrv2b compressed lzma decompressor added 2007-02-23 13:34:12 +01:00
Markus F.X.J. Oberhumer 12bcb09051 Small Makefile updates. 2007-02-21 17:11:42 +01:00
László Molnár c59c69a85f p_exe.cpp: added some comments 2007-02-20 13:49:18 +01:00
Markus F.X.J. Oberhumer bdd0daaf6f Added ElfLinker::addLoaderVA(). 2007-02-20 07:36:34 +01:00
Markus F.X.J. Oberhumer cfad7c8356 Small cleanups. 2007-02-19 03:52:33 +01:00
John Reiser b2b8a128d0 merge 2007-02-18 10:10:17 -08:00
Markus F.X.J. Oberhumer 1cfad80ca2 Introduce a special "ignore_reloc_overflow" section. 2007-02-18 18:29:26 +01:00
John Reiser a5a80e41b8 merge 2007-02-18 09:09:17 -08:00
Markus F.X.J. Oberhumer 152f8e92bf Yet some more Watcom optimizations. 2007-02-18 05:43:31 +01:00
Markus F.X.J. Oberhumer 0323560b49 More Watcom optimizations. 2007-02-18 04:41:33 +01:00
Markus F.X.J. Oberhumer d3bc84a2f7 Some Watcom optimizations. 2007-02-18 03:55:46 +01:00
Markus F.X.J. Oberhumer 8a82c259bd Switching back to using Watcom C - this seems to work. 2007-02-18 03:02:00 +01:00
Markus F.X.J. Oberhumer 46009c7658 i086 Makefile.extra update. 2007-02-18 02:32:47 +01:00
Markus F.X.J. Oberhumer 6f760308bd Some cleanasm.py updates. 2007-02-18 01:32:30 +01:00
John Reiser c346f8f17d merge 2007-02-16 08:06:37 -08:00
John Reiser af1d059fff PackUnix::getLoader() result is not 'const' 2007-02-16 08:05:10 -08:00
John Reiser 5562b21a20 PackMach* checkAlreadyPacked() 2007-02-16 08:02:59 -08:00
Markus F.X.J. Oberhumer 8f68f31877 Use Wine + Digital Mars C/C++ in small model. Does not work yet. 2007-02-16 15:22:01 +01:00
Markus F.X.J. Oberhumer ce7e94030c Added i086/l_test.c. Cleanups. 2007-02-16 08:52:31 +01:00
Markus F.X.J. Oberhumer ccf5a1b972 Add some more funcs to cc_test.c. 2007-02-13 09:48:37 +01:00
Markus F.X.J. Oberhumer 0d5ae77efc Some more dos/exe updates. 2007-02-13 02:25:32 +01:00
Markus F.X.J. Oberhumer 1695096d18 Commit rebuilt files as well. 2007-02-13 00:39:43 +01:00
Markus F.X.J. Oberhumer 6db0b7cf18 lzma for dos/exe works! 2007-02-13 00:39:15 +01:00
John Reiser 575b43b0d4 NEWS: Mach/i386 and Mach/fat 2007-02-12 15:22:22 -08:00
László Molnár 7b39b05894 lzma for dos/exe seems to work with tainted watcom macros 2007-02-12 18:28:24 +01:00
László Molnár 8bea9e0a5e fixed some watcom support macros 2007-02-12 15:38:47 +01:00
László Molnár 2255b32e45 LZMA for dos/exe integration work. Does not work yet. 2007-02-12 15:12:36 +01:00
Markus F.X.J. Oberhumer b62573ae8f More work on lzma for dos/exe. 2007-02-11 21:20:00 +01:00
Markus F.X.J. Oberhumer 44ed84f5cf Added lzma for dos/exe. Glue code and integration is still missing. 2007-02-11 07:54:16 +01:00
Markus F.X.J. Oberhumer d008c834be Merge. 2007-02-11 04:52:53 +01:00
Markus F.X.J. Oberhumer 2d3a914aee Some i086 updates. 2007-02-11 04:52:33 +01:00
John Reiser 7324f4c3d1 PackMach* filters only the [1st] largest executable LC_SEGMNET 2007-02-10 17:47:04 -08:00
Markus F.X.J. Oberhumer 50c8860a50 Added first version of a clean-room wcc support library implementation. 2007-02-11 01:06:37 +01:00
Markus F.X.J. Oberhumer 6456de7188 i086: added cc_test for examining internal compiler library calls. 2007-02-11 01:02:36 +01:00
John Reiser 23c629f2aa i386-darwin.macho works! 2007-02-10 13:14:27 -08:00
John Reiser 2bf154f74f i386-darwin.macho: decompressor overrun, bswap Mach_fat_header 2007-02-10 10:57:02 -08:00
John Reiser b598ad1bc0 i386-darwin.macho runtime stub 2007-02-10 09:16:49 -08:00
Markus F.X.J. Oberhumer ace24ad68e Minor portability fixes. 2007-02-08 16:17:32 +01:00
Markus F.X.J. Oberhumer 750c1a0f27 Avoid compiler warnings. 2007-02-08 15:00:42 +01:00
John Reiser 52d89bd66b PackMachFat has trouble with --fileinfo 2007-02-07 22:24:42 -08:00
John Reiser 8cfb9d35e9 fix ui report after PackMachFat::unpack 2007-02-07 22:03:15 -08:00
John Reiser 2f529158a0 OutputFile::unset_extent() sets bytes_written 2007-02-07 22:02:28 -08:00
John Reiser 6e68ab6d9e canUnpack() and unpack() for PackMachBase, PackMachFat 2007-02-07 21:30:18 -08:00
John Reiser 7a3c55af35 fix SEEK_END when set_extent() 2007-02-07 21:21:19 -08:00
John Reiser fb39d6304a Enable --lzma for PackMach*. 2007-02-07 11:23:21 -08:00
John Reiser 4cb57d9059 OutputFile::unset_extent(); endianness in Mach_fat_* and PackMachBase::b_info 2007-02-06 13:11:31 -08:00
John Reiser 42d69bd0e5 debug PackMachFat 2007-02-05 22:34:23 -08:00
John Reiser f27b399f81 PackMachFat 2007-02-05 14:00:41 -08:00
John Reiser a545a3938f FileBase::set_extent(offset, length) constrains seek() and tell() 2007-02-03 13:31:44 -08:00
John Reiser d1e352c9ee PackMachI386 2007-02-03 11:40:25 -08:00
John Reiser 99be1e798b PackMachPPC32 2007-02-03 11:04:57 -08:00
John Reiser 2132a28a17 UPX_F_MACH_i386 and skeleton stub. (Much of PackMachI386 is incomplete.) 2007-02-02 13:51:51 -08:00
John Reiser 8b1cc28783 templates to prepare for Mach-O i386 and Universal ("fat") executables 2007-01-31 20:25:13 -08:00
Markus F.X.J. Oberhumer 78364ac830 Small Watcom updates. 2007-01-31 14:28:15 +01:00
Markus F.X.J. Oberhumer 6e5f5732b5 brandelf.py: do not write "Linux" any longer as newer ldd's (e.g.
from glibc-common-2.5-10.fc6) do not like this.
2007-01-31 05:58:17 +01:00
Markus F.X.J. Oberhumer 87844254d1 Minor Makefile updates. 2007-01-31 05:53:38 +01:00
Markus F.X.J. Oberhumer 08ef9f69fb Very minor portability fixes. 2007-01-30 20:36:59 +01:00
Markus F.X.J. Oberhumer 5fbd1b78e7 Added non-working experimental infrastructure for using OpenWatcom 1.6
to support i086 + lzma.
2007-01-30 20:25:20 +01:00
Markus F.X.J. Oberhumer 39f5eb753f Bump version for next release. 2007-01-23 22:17:02 +01:00
Markus F.X.J. Oberhumer f4cbe3f300 Added tag for RELEASE_292. 2007-01-23 22:13:01 +01:00
Markus F.X.J. Oberhumer 70632e5541 Bump release date. 2007-01-23 22:11:23 +01:00
John Reiser 0bba700105 merge 2007-01-23 10:35:20 -08:00
John Reiser b71aaccff3 fix amd64-linux.elf-entry.S invoking large programs (>3MB compressed) 2007-01-23 10:34:33 -08:00
Markus F.X.J. Oberhumer 7271ae9611 Small updates. 2007-01-23 13:50:39 +01:00
László Molnár 6e32dff2ad armpe_tester.c updated to work with files containing 4 sections 2007-01-17 21:53:18 +01:00
László Molnár 8f7c898c08 use an exception instead of assert() for overlay checking (bug #1624840) 2007-01-16 12:58:35 +01:00
Markus F.X.J. Oberhumer f4a9815f48 Keep entries sorted in stub/Makefile. 2007-01-15 07:46:22 +01:00
John Reiser 0f8d5c7e98 arm-linux.kernel.vmlinux.S remove unused sections 2007-01-14 13:40:50 -08:00
Markus F.X.J. Oberhumer 5e83596a1b Enter 2007. 2007-01-14 13:08:58 +01:00
Markus F.X.J. Oberhumer 6361213e07 More portability fixes. 2007-01-14 12:47:38 +01:00
John Reiser 9c59a5d9b6 p_vmlinx test jig for ARM 2007-01-13 17:30:03 -08:00
John Reiser bb04844bd5 Decompressor for UPX_F_VMLINUX_ARM follows ELF convention 2007-01-13 15:26:05 -08:00
Markus F.X.J. Oberhumer 0b988176fa Portability fixes. 2007-01-10 17:16:59 +01:00
Markus F.X.J. Oberhumer a354f18a2d Consistently use .arch nojumps on i086 and i386. 2007-01-09 22:40:01 +01:00
Markus F.X.J. Oberhumer a7ca0fec88 Merge. 2007-01-09 18:31:13 +01:00
Markus F.X.J. Oberhumer 06eec508df Cosmetic macros.S cleanups. 2007-01-09 18:27:53 +01:00
John Reiser 10dc580a3a tweak i386-linux.kernel.vmlinux-head.S 2007-01-08 13:56:47 -08:00
John Reiser 2f6ae3ef01 merge 2007-01-07 16:33:04 -08:00
John Reiser 392e803905 vmlinux/AMD64 works 2007-01-07 16:31:46 -08:00
John Reiser 83a5fb585b ELF External_Note 2007-01-03 06:54:48 -08:00
László Molnár c6205ffbe0 tls index should be zero after decompression 2007-01-02 18:16:16 +01:00
Markus F.X.J. Oberhumer c04737ce20 Cosmetic cleanup. 2006-12-31 15:51:17 +01:00
John Reiser 11b92172fe PackVmlinuxBase my_boot_label; kernel Makefiles 2006-12-25 13:55:28 -08:00
László Molnár 3a6c574376 pe: correctly handle import table with 0 entries during decompression (#1620733) 2006-12-24 16:25:36 +01:00
Markus F.X.J. Oberhumer b21ce925fb Factor out a common Packer::defineFilterSymbols(). Enable filters
0x49 and 0x49 for all i386-dos32.* formats. Needs testing.
2006-12-22 16:39:42 +01:00
Markus F.X.J. Oberhumer de9dcc4ed6 Enable filters 0x49 and 0x46 for win32/pe. This needs some more testing. 2006-12-22 15:28:14 +01:00
Markus F.X.J. Oberhumer 9e77dbfe20 Added an assertion to make sure I've really understood the semantics
of the ctok32 filter length.
2006-12-22 15:19:51 +01:00
Markus F.X.J. Oberhumer 4cee0676a4 Consistently rename section names of ctok32 filter. 2006-12-22 14:22:45 +01:00
Markus F.X.J. Oberhumer 8ad9d21db3 Also add ICHECK() calls to p_armpe.cpp. 2006-12-22 13:37:19 +01:00
Markus F.X.J. Oberhumer 8ba8317eea sf.net bug #1620733: As a very first step, added two calls to
ICHECK(dname,1). Of course we still need a proper fix for this.
2006-12-22 13:35:39 +01:00
Markus F.X.J. Oberhumer d221187f24 Misc cosmetical cleanups. 2006-12-22 12:36:55 +01:00
Markus F.X.J. Oberhumer db54ec294f Added some missing stub/tmp/*.bin.dump files. 2006-12-20 10:50:49 +01:00
John Reiser 1d39796e3f PackVmlinuxBase::canPack bug for AMD64 with holes between PT_LOAD 2006-12-19 18:18:47 -08:00
John Reiser cd6a318903 cleanup merge 2006-12-19 16:19:19 -08:00
John Reiser 73090b98ab merge 2006-12-19 16:16:20 -08:00
John Reiser 745de1abab refactor PackVmlinuxBase::pack() 2006-12-19 16:12:59 -08:00
John Reiser 961031efc1 make_st_info() 2006-12-19 16:12:15 -08:00
Markus F.X.J. Oberhumer 2487595778 vmlinux: U32 already has target-endian representation, so there is no need
to call BeLePolicy::get32() here.
2006-12-19 22:39:37 +01:00
John Reiser 5c4863d504 refactor PackVmlinuxBase ::canUnpack(), ::unpack() 2006-12-19 10:58:20 -08:00
Markus F.X.J. Oberhumer 5e3a658932 Made a method pure virtual. 2006-12-19 16:21:57 +01:00
Markus F.X.J. Oberhumer cb4704c821 Cosmetic cleanups. 2006-12-19 15:22:50 +01:00
Markus F.X.J. Oberhumer cc0b7d1492 Use the preprocessor to make sure that the ELF types are PODs. 2006-12-19 14:43:14 +01:00
Markus F.X.J. Oberhumer f8ebbf8b08 Rework p_elf.h. 2006-12-19 14:24:35 +01:00
Markus F.X.J. Oberhumer 8795f60bf1 vmlinux: use template types throughout. 2006-12-19 11:06:58 +01:00
Markus F.X.J. Oberhumer f00c0a9436 Fix typo. 2006-12-19 11:04:47 +01:00
Markus F.X.J. Oberhumer 767bc71870 Expose integral types in p_elf.h. 2006-12-19 10:49:13 +01:00
John Reiser 4c068e3e00 PackVmlinuxBase::canPack(); templates are fun! 2006-12-18 22:55:38 -08:00
John Reiser 277d862172 PackVmlinuxBase try template definitions in .cpp file 2006-12-18 20:17:10 -08:00
John Reiser dbed6a47bb PackVmlinuxBase use simple templates 2006-12-18 20:08:24 -08:00
Markus F.X.J. Oberhumer 94f3749784 vmlinux refactoring: move destructor into PackVmlinuxBase. 2006-12-19 00:48:38 +01:00
Markus F.X.J. Oberhumer 728e6d851e Introduce ElfClass and PackVmlinuxBase for refactoring elf based packers. 2006-12-19 00:37:35 +01:00
Markus F.X.J. Oberhumer 11e863545f Strip trailing whitespace. 2006-12-18 16:56:14 +01:00
Markus F.X.J. Oberhumer dde49f0bb4 Try to avoid fatal filter failures by better scanning during the setup phase. 2006-12-18 16:54:14 +01:00
Markus F.X.J. Oberhumer a37a75aecc First step for preprocessing dumps with xstrip.py. Not working yet. 2006-12-18 16:39:57 +01:00
John Reiser e43e3aeb1c arm-linux.kernel documentation update for Debian on nslu2 2006-12-17 18:49:38 -08:00
John Reiser a8fe529814 arm-linux.kernel preserve .e_flags 2006-12-17 17:39:47 -08:00
John Reiser d9f5e2bb08 arm-linux.kernel alignment fix 2006-12-17 16:34:21 -08:00
John Reiser dfa83b0ac8 arm-linux.kernel methods 2006-12-17 15:34:13 -08:00
John Reiser bd5cef1411 unfilter for arm-linux.kernel 2006-12-17 14:53:10 -08:00
John Reiser cd70b48831 src/stub/src/arch/arm/v5a directory 2006-12-17 13:24:14 -08:00
John Reiser 50ebf8088a R_ARM_ABS8 2006-12-17 13:19:37 -08:00
John Reiser c5cfb7eb40 more arm-linux.kernel work 2006-12-16 22:02:51 -08:00
John Reiser bccaafda6d arm-linux stub interfacing for lzma 2006-12-16 17:16:32 -08:00
John Reiser bf0086d7b5 arm-linux.kernel decompressor 2006-12-16 14:52:22 -08:00
John Reiser 7e65938ca6 fix filename in initial comment 2006-12-16 08:40:41 -08:00
John Reiser 112eff2509 add UPX_F_VMLINUX_AMD64, UPX_F_VMLINUX_ARM 2006-12-16 08:13:34 -08:00
Markus F.X.J. Oberhumer d7837d9179 Use FT_ULTRA_BRUTE. 2006-12-12 10:06:24 +01:00
Markus F.X.J. Oberhumer 6cdd057f80 Coding style cleanups. 2006-12-12 10:05:57 +01:00
Markus F.X.J. Oberhumer 5a03b213fb More stricter check in xstrip.py. 2006-12-12 07:50:05 +01:00
Markus F.X.J. Oberhumer f270213246 Make sure ph.first_offset_found is set. 2006-12-12 07:49:50 +01:00
László Molnár 2e1795c5ba win32/pe: loadconf data should not be put into section 2 2006-12-10 23:42:27 +01:00
Markus F.X.J. Oberhumer 732d6710d3 Remove misleading "const" from Linker::preprocessXX(). 2006-12-10 00:38:28 +01:00
Markus F.X.J. Oberhumer edf384d2ee Micro-optimization: save 1 byte in tmt/adam stub. 2006-12-09 13:56:47 +01:00
László Molnár c307640826 use memcmp instead of strncmp when searching for ljmp 2006-12-08 19:20:35 +01:00
Markus F.X.J. Oberhumer a77b598f82 Implement a micro-optimization which has been on our TODO list for ages:
remove "or ebp,-1" when not needed
2006-12-08 09:20:14 +01:00
Markus F.X.J. Oberhumer 217420cfa5 Also verifyOverlappingDecompression() for watcom/le. 2006-12-06 12:20:22 +01:00
Markus F.X.J. Oberhumer f2b9dff596 More work so that watom/le now uses compressWithFilters(). 2006-12-06 11:08:32 +01:00
Markus F.X.J. Oberhumer ae945ed315 Clean up help and avoid using backticks as quoting chars. 2006-12-06 08:11:55 +01:00
Markus F.X.J. Oberhumer 770c153c76 Start using FT_ULTRA_BRUTE. 2006-12-06 07:42:43 +01:00
Markus F.X.J. Oberhumer 29c4a7e606 Remove debugging leftover. 2006-12-06 07:34:57 +01:00
Markus F.X.J. Oberhumer 8875470b37 Refactored compressWithFilters(). 2006-12-06 07:27:23 +01:00
Markus F.X.J. Oberhumer 6e52364bcb Minor cleanup of callback code. 2006-12-05 17:09:18 +01:00
Markus F.X.J. Oberhumer 7015d616b4 Whitespace changes. 2006-12-05 17:06:37 +01:00
László Molnár 92e6da3260 use the current version of http://www.gnu.org/licenses/gpl.txt 2006-12-05 12:16:42 +01:00
László Molnár 9220b6f1d5 win32/pe should only handle ix86 files 2006-12-03 10:46:14 +01:00
Markus F.X.J. Oberhumer 1d0d538d0c Added new option '--ultra-brute'. 2006-12-01 02:47:46 +01:00
Markus F.X.J. Oberhumer 83052eafae Minor cleanups. 2006-12-01 00:57:03 +01:00
Markus F.X.J. Oberhumer fa95c3c4a2 Display full format name with --fileinfo. 2006-11-30 23:34:19 +01:00
Markus F.X.J. Oberhumer 665dcf221b Cosmetic cleanup. 2006-11-30 23:21:47 +01:00
Markus F.X.J. Oberhumer 8f73dbd253 Mention --compress-icons=3. 2006-11-30 23:18:21 +01:00
Markus F.X.J. Oberhumer 826312cbad Show all supported formats in show_help(). 2006-11-30 23:17:22 +01:00
Markus F.X.J. Oberhumer 72a18f2b3f Added Packer::getFullName() method. 2006-11-29 06:44:48 +01:00
Markus F.X.J. Oberhumer a6b5e3d0ae Bump version for next release. 2006-11-29 05:41:39 +01:00
Markus F.X.J. Oberhumer 1b321f4fa3 Added tag for RELEASE_291. 2006-11-29 05:14:25 +01:00
Markus F.X.J. Oberhumer fbde0b9f35 Bump release date. 2006-11-29 03:43:29 +01:00
Markus F.X.J. Oberhumer 0e5f5e54cc Initalize isrtm member. 2006-11-27 17:35:16 +01:00
Markus F.X.J. Oberhumer cbb5902066 Improve xstrip.py. 2006-11-25 15:36:56 +01:00
Markus F.X.J. Oberhumer 92ec1b0598 Add and use stub/scripts/xstrip.py. 2006-11-23 05:27:40 +01:00
Markus F.X.J. Oberhumer a62fc3abff Try to remove .shstrtab, .strtab and .symtab sections. This does not seem to
work with objcopy.
2006-11-23 03:31:43 +01:00
Markus F.X.J. Oberhumer 08f8e55446 More updates on bin2h.py. 2006-11-23 03:11:53 +01:00
Markus F.X.J. Oberhumer 68f54a3247 Updated bin2h.py. 2006-11-23 02:23:39 +01:00
Markus F.X.J. Oberhumer 29c099fe56 Disallow --exact with --overlay=strip. 2006-11-22 19:29:07 +01:00
Markus F.X.J. Oberhumer 76b81c7b35 More stricter check for arm-wince Debian. 2006-11-22 18:52:57 +01:00
László Molnár d6b33ffd6b pe: --compress-icons=3 option added to compress all icons 2006-11-22 15:28:35 +01:00
Markus F.X.J. Oberhumer 16b9873fa8 Quick workaround for arm-wince build with Debian cross-compiler packages. 2006-11-22 01:56:59 +01:00
Markus F.X.J. Oberhumer ba4a686d1c Fix endian issue in execve formats. 2006-11-21 18:42:38 +01:00
László Molnár 4be3d79e12 arm/pe: fix "missing" icon & version info resource problem for wince 5 2006-11-21 18:25:23 +01:00
Markus F.X.J. Oberhumer 2569b09dbe Added debugging option --disable-random-id. 2006-11-21 18:17:51 +01:00
Markus F.X.J. Oberhumer 5d71e69941 Added two checks for throwCantPackExact. 2006-11-21 18:01:16 +01:00
Markus F.X.J. Oberhumer 16163bf20b Initial support for option '--exact'. 2006-11-21 17:53:11 +01:00
Markus F.X.J. Oberhumer f1a97fecbd Minor cleanups. 2006-11-21 17:35:22 +01:00
Markus F.X.J. Oberhumer a050f82f0e Implemented the remaining missing pieces of compress_zlib. 2006-11-21 17:19:24 +01:00
Markus F.X.J. Oberhumer ef7beea334 Cosmetic cleanups. 2006-11-21 16:17:47 +01:00
Markus F.X.J. Oberhumer 3f4acb33f9 First step for possibly using ElfLinker with linux execve/interp/shell stubs
as well.
2006-11-21 16:00:25 +01:00
Markus F.X.J. Oberhumer 14822e6395 Now that it seems to work, disable usage of pre-compressed stubs again. 2006-11-21 07:14:07 +01:00
Markus F.X.J. Oberhumer e82db4ed38 Use proper const_cast. 2006-11-21 06:32:13 +01:00
Markus F.X.J. Oberhumer 87b7ea9cf3 Add LZMA support for pre-compressed stubs. 2006-11-21 06:09:04 +01:00
Markus F.X.J. Oberhumer 787b1fceff Actually generate and use pre-compressed stubs. Currently this is mainly
for testing as the self-packed upx binary does get _larger_ this way.
2006-11-21 05:29:29 +01:00
Markus F.X.J. Oberhumer 140d6ad839 Avoid compiler warning. 2006-11-21 05:09:01 +01:00
Markus F.X.J. Oberhumer 46e8e22236 Prepare generating pre-compressed stubs. 2006-11-21 05:03:25 +01:00
Markus F.X.J. Oberhumer c386db2b33 Small cosmetic changes. 2006-11-21 05:01:54 +01:00
Markus F.X.J. Oberhumer 8dad091c6b Decompress pre-compressed stubs in Linker::init(). 2006-11-21 05:01:00 +01:00
Markus F.X.J. Oberhumer 3365ccbb9c Implemented upx_zlib_decompress(). 2006-11-21 04:42:47 +01:00
Markus F.X.J. Oberhumer 2ced230965 Updated packers to use new stub names. 2006-11-21 03:40:11 +01:00
Markus F.X.J. Oberhumer 989d10a3e1 Rebuilt all stubs with new bin2h.py and --ident=auto-stub. 2006-11-21 03:36:48 +01:00
Markus F.X.J. Oberhumer 62d8c69774 Enhanced bin2h.py: added --ident=auto, added --compress=XXX. 2006-11-21 03:34:08 +01:00
Markus F.X.J. Oberhumer cf704257b0 Remove some traces of patch_le32. 2006-11-20 18:19:37 +01:00
Markus F.X.J. Oberhumer a6cb6f57d3 Introduce Packer::relocateLoader(). This is the first step of finally getting
rid of all Packer::patchXXX() methods.
2006-11-20 18:10:23 +01:00
Markus F.X.J. Oberhumer 141c703ed5 Use ld option --no-warn-mismatch when generating binary output. 2006-11-20 17:36:04 +01:00
John Reiser 796d58867b use separate stub/armeb-linux.elf-entry and fold 2006-11-20 08:02:28 -08:00
Markus F.X.J. Oberhumer 2f483ec8e8 Fix compression ratio check. 2006-11-20 13:48:34 +01:00
Markus F.X.J. Oberhumer e338918773 Disable new/delete for bele policies. 2006-11-20 12:57:49 +01:00
Markus F.X.J. Oberhumer d9effc58cf Added initial version of armeb-linux.elf stubs. Completely untested. 2006-11-20 12:40:57 +01:00
Markus F.X.J. Oberhumer 05d03f97fc Introduce Packer::bele. 2006-11-20 12:01:59 +01:00
Markus F.X.J. Oberhumer 03e891c0e8 Remove implicit magic from OptVar copy operator and introduce oassign()
function instead.
2006-11-20 11:04:31 +01:00
Markus F.X.J. Oberhumer 4dfe9d52e9 Don't be too strict when checking the compression ratio (sf.net
feature request #1596111).
2006-11-20 09:40:46 +01:00
John Reiser 9e65692b69 Merge 2006-11-19 14:32:28 -08:00
John Reiser 0687c9a57a PackLinuxElf32::ARM_buildLoader endianness bugs 2006-11-19 14:28:15 -08:00
Markus F.X.J. Oberhumer ffe1287016 Added option '--cpr-lzma-ds=XX'. 2006-11-19 18:50:35 +01:00
Markus F.X.J. Oberhumer 75b7e7260f Merge. 2006-11-19 05:16:12 +01:00
Markus F.X.J. Oberhumer d631e081bc arm-linux.elf: make two symbols global. 2006-11-19 05:09:01 +01:00
John Reiser db5843d904 branch merge 2006-11-18 19:57:56 -08:00
John Reiser 5ec16153f7 PackLinuxElf64amd::defineSymbols forgot a get_native64() 2006-11-18 19:52:55 -08:00
Markus F.X.J. Oberhumer 8c873ccdc8 watcom/le: initialize memory when aligning. 2006-11-18 21:59:59 +01:00
Markus F.X.J. Oberhumer c95088f8d5 Merge. 2006-11-18 20:55:07 +01:00
Markus F.X.J. Oberhumer 519fa55df7 ps1/exe: fill pad.code section with zeros. 2006-11-18 20:54:10 +01:00
John Reiser b8dda033ed branch merge 2006-11-18 11:51:23 -08:00
John Reiser 0359e9c5c7 members of struct l_info loader header must be little endian 2006-11-18 11:42:08 -08:00
Markus F.X.J. Oberhumer d822b4a62a Store shentsize in target byte-order. 2006-11-18 18:25:11 +01:00
Markus F.X.J. Oberhumer d9e8c953b1 Fixed some ElfLinker endian issues. 2006-11-18 17:43:29 +01:00
Markus F.X.J. Oberhumer 9eca502026 Make upx build with gcc-2.95 again. 2006-11-18 14:37:22 +01:00
Markus F.X.J. Oberhumer cd0efe3edb Some atari/tos cleanups. 2006-11-18 02:39:11 +01:00
Markus F.X.J. Oberhumer 8146e9cbcd Implemented some small atari/tos optimizations. 2006-11-17 18:47:33 +01:00
Markus F.X.J. Oberhumer 5d95275024 Add some more calls to f-objstrip. 2006-11-17 14:50:59 +01:00
Markus F.X.J. Oberhumer 49a97eea4b More brandelf.py updates. 2006-11-17 14:50:42 +01:00
Markus F.X.J. Oberhumer 36e9c27e9c Updated brandelf.py. 2006-11-16 22:23:01 +01:00
Markus F.X.J. Oberhumer 6e5153cd07 Minor Makefile updates. 2006-11-16 21:14:58 +01:00
Markus F.X.J. Oberhumer c73da864c8 Avoid -Wshadow warnings. 2006-11-16 20:14:14 +01:00
Markus F.X.J. Oberhumer 071bb75700 Use new addLoader() method. 2006-11-16 20:12:53 +01:00
Markus F.X.J. Oberhumer 99374de340 Clean up stub sources. 2006-11-16 19:36:13 +01:00
Markus F.X.J. Oberhumer db7ae4ed5d Improve Packer:addLoader(). We're still somewhat limited because of gcc-bug
#29823 (see http://gcc.gnu.org/PR29823).
2006-11-16 18:52:20 +01:00
Markus F.X.J. Oberhumer e61f481881 Added .DELETE_ON_ERROR rules. 2006-11-16 18:49:34 +01:00
Markus F.X.J. Oberhumer 396a3ad2fc Small atari cleanups. 2006-11-13 10:51:45 +01:00
Markus F.X.J. Oberhumer be235ddc38 Removed unused Packer::freezeLoader(). Changed return type of
buildLoader() from "int" to "void".
2006-11-12 20:57:08 +01:00
Markus F.X.J. Oberhumer 9e72ecd93d Fix version date. 2006-11-12 18:49:48 +01:00
Markus F.X.J. Oberhumer 8e0bd936eb atari/tos now seems to work again. 2006-11-12 18:25:46 +01:00
Markus F.X.J. Oberhumer 9d0270dcd6 We have to bswap32 lzma_properties on big-endian machines. 2006-11-12 18:10:42 +01:00
Markus F.X.J. Oberhumer 713415c354 Fix broken "glibc sscanf bug workaround". 2006-11-12 14:47:50 +01:00
Markus F.X.J. Oberhumer 786550572e More work on atari/tos. 2006-11-12 13:46:38 +01:00
Markus F.X.J. Oberhumer 46caeddc81 Added some more debugging support to Linker. 2006-11-12 13:45:27 +01:00
Markus F.X.J. Oberhumer 71bfde2bfe Bump tentative release date. 2006-11-12 10:59:27 +01:00
Markus F.X.J. Oberhumer 76771b845a Started work on atari/tos. 2006-11-12 10:58:04 +01:00
Markus F.X.J. Oberhumer a74e239e28 Major cleanup of ElfLinker. 2006-11-12 10:57:18 +01:00
Markus F.X.J. Oberhumer 6e763b0b42 Updated options. 2006-11-12 10:56:17 +01:00
Markus F.X.J. Oberhumer 2f41ece017 Minor cleanups. 2006-11-10 13:49:22 +01:00
Markus F.X.J. Oberhumer 01cd5fe0d5 Added tag BRANCHPOINT_FOR_upx2.hg . 2006-11-08 21:09:50 +01:00
Markus F.X.J. Oberhumer ed12ff7bb3 Updated NEWS from 2.03 release. 2006-11-07 19:56:15 +01:00
Markus F.X.J. Oberhumer f1386bb60d Update NEWS. 2006-11-07 14:07:43 +01:00
Markus F.X.J. Oberhumer 417bd06e76 Fixed --brute and --lzma for dos/exe. 2006-11-07 13:58:32 +01:00
Markus F.X.J. Oberhumer 91e46e3cf8 Small cleanups. 2006-11-07 13:43:43 +01:00
Markus F.X.J. Oberhumer deb5139c4d Re-enable --crp-ms= option. 2006-11-07 13:37:46 +01:00
Markus F.X.J. Oberhumer 862ac5d014 Update options_t::crp_t to directly use the XXX_compress_config_t types. 2006-11-07 13:11:36 +01:00
Markus F.X.J. Oberhumer 028235d421 Keep variable names sorted. 2006-11-07 10:24:54 +01:00
Markus F.X.J. Oberhumer 143d399849 Updated two "xchg" commands to produce byte-identical results with UPX 2.02. 2006-11-07 09:35:00 +01:00
László Molnár 375f171e47 dos/com&sys: correctly set carry bit by using "sub si,-xx" instead of "add si,xx" 2006-11-06 17:54:37 +01:00
László Molnár 387edcf4b2 dos/com: fix fatal bug #1589758 2006-11-03 15:52:20 +01:00
Markus F.X.J. Oberhumer 011cd37cfb Small cleanup of arm sources. 2006-10-30 14:10:51 +01:00
Markus F.X.J. Oberhumer 0d4254f319 Added tc_objdump_disasm_options. 2006-10-30 13:21:48 +01:00
Markus F.X.J. Oberhumer 4c407c2850 Rebuild all stubs. Minor Makefile cleanup. 2006-10-25 04:08:59 +02:00
John Reiser 829e2d6c5d set e_shentsize to work around bug in binutils [mostly cosmetic] 2006-10-24 09:43:50 -07:00
John Reiser a31c4bd474 more renaming for i386-linux.kernel.vmlinux-head.h 2006-10-24 09:29:01 -07:00
John Reiser 17f24dc377 PackBvmlinuzI386 allow x86_64 2006-10-18 08:35:25 -07:00
John Reiser de3e9f2809 vmlinuz/386 fix for physical_start not at bzimage_offset 2006-10-16 17:18:19 -07:00
John Reiser 4442a282e1 fix filename in #includ 2006-10-16 10:52:57 -07:00
John Reiser 261010f23d fix comment 2006-10-16 06:12:58 -07:00
John Reiser ede44ca6ee vmlinux/386 naming convention for source files 2006-10-16 06:11:49 -07:00
John Reiser 452a953234 vmlinux/386 check for __ksymtab; fix unpack 2006-10-15 14:51:02 -07:00
John Reiser 2b122562ad new file i386-linux.kernel.head-vmlinux.S 2006-10-14 14:55:10 -07:00
John Reiser 6891bc3da3 vmlinux/i386: fix filters, 0x400000 start, integration with kernel build 2006-10-14 14:52:30 -07:00
Markus F.X.J. Oberhumer b31b8cd7f0 Added option '--crp-lzma-fb='. Started tuning lzma compression
levels '-1' and '-2'.
2006-10-12 14:23:22 +02:00
Markus F.X.J. Oberhumer e1379ac5ce Removed debugging leftover. 2006-10-12 13:48:07 +02:00
Markus F.X.J. Oberhumer 0ef3f75d7a Introduced class OptVar for tracking optionally set options. Also
added three new options for finetuning lzma compression.
2006-10-12 13:47:15 +02:00
Markus F.X.J. Oberhumer 407a9e5be0 Clean up NEWS. 2006-10-11 13:47:12 +02:00
Markus F.X.J. Oberhumer 892bb9bf30 Re-add "beta" string to versions. 2006-10-11 13:06:17 +02:00
Markus F.X.J. Oberhumer 47ac871a12 Added version_string() functions for the compression algorithms. Also
reserved M_DEFLATE and added a mostly empty compress_zlib.cpp.
2006-10-11 12:56:28 +02:00
László Molnár a38c3e7f6d ps1: initialize an uninitialized variable 2006-10-10 15:44:02 +02:00
Markus F.X.J. Oberhumer 08818355d1 Updated README.SRC. 2006-10-10 11:23:32 +02:00
Markus F.X.J. Oberhumer 0a68afef00 Bump version for next release. 2006-10-08 22:38:57 +02:00
Markus F.X.J. Oberhumer 2c0783e327 Added tag for RELEASE_290. 2006-10-08 22:35:47 +02:00
Markus F.X.J. Oberhumer c2e5e45c84 Fix UINT64_MAX. 2006-10-06 08:42:12 +02:00
John Reiser 014236c861 amd64 stub: fix length of move for non-small programs 2006-10-04 08:38:06 -07:00
Markus F.X.J. Oberhumer 610fd7561b Bump tentative release date. Update NEWS. 2006-10-04 09:26:34 +02:00
Markus F.X.J. Oberhumer d6f4480a4f Removed debugging leftover. 2006-10-04 09:17:59 +02:00
Markus F.X.J. Oberhumer 28a6ac09ad Initialize a field in constructor. 2006-10-04 09:14:13 +02:00
John Reiser 86e4d24476 avoid circularity of sz_pack2 in PackLinuxElf64amd::defineSymbols() 2006-10-03 20:21:36 -07:00
John Reiser 913a697ab2 Remove dead code and uses of sz_pack2 from PackLinuxElf32::ARM_defineSymbols() 2006-10-03 19:28:08 -07:00
Markus F.X.J. Oberhumer ebef2b1e44 Avoid a printf warning. 2006-10-04 00:16:55 +02:00
Markus F.X.J. Oberhumer a61457b422 Added some debugging support via Linker::dumpSymbols(). 2006-10-03 23:48:19 +02:00
László Molnár 8f7f1135df win32/pe: size of tls_value should be 32 bits 2006-10-03 17:01:47 +02:00
John Reiser 89612c10c9 NEWS and document /proc/self/exe 2006-10-03 07:20:59 -07:00
John Reiser d55bfb32f1 merge 2006-10-03 07:01:55 -07:00
John Reiser d2b72cf496 sync 2006-10-03 06:59:10 -07:00
László Molnár 8d90fffd46 NEWS updates for 2.90 2006-10-03 15:56:39 +02:00
John Reiser b84af27a86 typo "pop %eax" [not caught by assembler?] 2006-10-01 16:19:17 -07:00
John Reiser b45f28f3e9 propagate changes from *.S to *.h 2006-10-01 14:42:39 -07:00
John Reiser bfa1b5656a preserve readlink("/proc/self/exe",,) in environment " =" 2006-10-01 14:41:09 -07:00
John Reiser 47f946cd65 fix the comments 2006-10-01 14:25:14 -07:00
John Reiser 970e7bfcda CPU_TYPE_I386 2006-10-01 14:24:20 -07:00
John Reiser a81c7a7cd6 PackBSDI386 clarify osabi issues. 2006-09-27 14:38:42 -07:00
John Reiser b0e1bd239f Pack shell scripts for Linux only (and not *BSD, for example [no stub!]) 2006-09-26 16:21:28 -07:00
John Reiser 53ca41717a Document /proc/self/exe and workaround. 2006-09-25 13:02:07 -07:00
Markus F.X.J. Oberhumer 6a5bee0cdd Updated test-stub-compression. 2006-09-09 13:03:04 +02:00
Markus F.X.J. Oberhumer fd3ae51f83 Remove trailing whitespace. 2006-09-09 11:00:33 +02:00
Markus F.X.J. Oberhumer 5e5954a808 Use gcc-4.1.1 again for mipsel. 2006-09-09 10:57:13 +02:00
John Reiser add8540909 Integrate upx-2.90beta1-ps1-20060908.bz2 from Jens. 2006-09-08 14:09:30 -07:00
John Reiser 06a302aed0 Integrate upx-2.90beta1-ps1-20060907 from Jens. 2006-09-07 10:44:19 -07:00
John Reiser 147432d38d list fastest possible inline expansion (saves 3 cycles) 2006-09-06 11:19:18 -07:00
John Reiser 2a003ff72b merge 2006-09-06 10:55:37 -07:00
John Reiser 8660d3324d "revert -r eae1090d512738ac64c783be70258ababc8b6513" to sync with Markus 2006-09-06 10:52:06 -07:00
John Reiser 6c59b73ae5 PackLinuxElf64::generateElfHdr() .p_flags are only 32 bits 2006-09-06 10:36:50 -07:00
Markus F.X.J. Oberhumer 80218c1eca Atari/tos is currently broken, so throw an InternalError. 2006-09-06 14:31:30 +02:00
John Reiser f24d96d59f document alternate getbit 2006-09-04 20:09:03 -07:00
Markus F.X.J. Oberhumer d14bd49f46 Updated mips Makefile. 2006-09-04 14:23:21 +02:00
Markus F.X.J. Oberhumer 1a692a0873 Tuned mips compiler flags. 2006-09-03 19:14:49 +02:00
Markus F.X.J. Oberhumer 631a1a4ddc Cosmetic changes. 2006-09-03 19:13:35 +02:00
Markus F.X.J. Oberhumer 57df7601d9 mipsel: use -mtune=r4000 and -fno-sched-spec for small size reduction. 2006-09-02 14:53:31 +02:00
Markus F.X.J. Oberhumer f7650000aa Enable -fwrapv for mipsel. 2006-09-02 14:16:46 +02:00
Markus F.X.J. Oberhumer 6f93c2d9b2 Updated Makefiles. 2006-09-02 14:14:15 +02:00
Markus F.X.J. Oberhumer 1654764968 Disable lua for now. 2006-09-01 02:38:35 +02:00
Markus F.X.J. Oberhumer 1a1b8416e2 Use f-embed_objinfo for arm-linux. 2006-09-01 02:36:24 +02:00
Markus F.X.J. Oberhumer 36c66d52a6 Added SQUEEZE macro to better canonicalize the dumps. 2006-09-01 02:09:16 +02:00
Markus F.X.J. Oberhumer 68fe43d488 Strip trailing whitespace. 2006-09-01 01:35:51 +02:00
Markus F.X.J. Oberhumer 877b9ee23b Stub: provide debugging disassembly for arm. 2006-09-01 01:34:20 +02:00
Markus F.X.J. Oberhumer 80ff93beeb Explicitly strip section .note.GNU-stack from objects. 2006-08-30 20:15:07 +02:00
Markus F.X.J. Oberhumer b9ddd2812b Create disassembly for i386-dos32.djgpp2-stubify.h. 2006-08-30 19:38:39 +02:00
László Molnár ba54b56de4 another update for ps1/exe from Jens 2006-08-30 12:42:49 +02:00
Markus F.X.J. Oberhumer 85be67bc2d Removed some temporary tags. Info: you can use the file .hg/localtags
to define per-repository local tags which are not shared.
2006-08-30 00:21:13 +02:00
Markus F.X.J. Oberhumer ae20e01d2c Started renaming some loader symbols - now that we have a real
linker we really should improve readability and avoid those
old cryptic names.
2006-08-30 00:11:40 +02:00
Markus F.X.J. Oberhumer d094e8c3fc Added stub/tmp/*.dump files to the Mercurial repository.
These .dump files are embedded in the .h stubs anyway, but we
really want to see some diffs to better understand what has
changed in a commit.
2006-08-30 00:06:47 +02:00
Markus F.X.J. Oberhumer f009fe1f63 Start work on updating p_tos. 2006-08-29 23:46:21 +02:00
Markus F.X.J. Oberhumer 2007fe5f49 More small Makefile changes. 2006-08-29 23:08:26 +02:00
László Molnár 84989ffa04 merge 2006-08-29 17:11:03 +02:00
László Molnár 31b629a19c ps1/exe updated from jens 2006-08-29 16:25:59 +02:00
Markus F.X.J. Oberhumer e762d9e274 Yet another minor Makfile update. 2006-08-29 16:05:17 +02:00
Markus F.X.J. Oberhumer 6833267b19 Cleanups in stub Makefiles. 2006-08-29 14:37:06 +02:00
Markus F.X.J. Oberhumer 05f2833388 Detabified. 2006-08-29 13:43:06 +02:00
Markus F.X.J. Oberhumer 0d026ef18d Removed trailing whitespace. 2006-08-29 13:41:13 +02:00
Markus F.X.J. Oberhumer b756d93891 Use absolute symbols to store offsets in m68k stub. 2006-08-28 09:48:01 +02:00
Markus F.X.J. Oberhumer f54513586d Implemented alignCode() for m68k. 2006-08-28 09:09:29 +02:00
Markus F.X.J. Oberhumer 6c519c237e Renamed Linker::align() to alignCode(). We still have to add
some way to express alignData().
2006-08-28 08:58:43 +02:00
John Reiser 4ffde4db98 8-byte align LZMA_DEC20 2006-08-27 10:03:12 -07:00
Markus F.X.J. Oberhumer 41847d31e7 More m68k rearrangments. 2006-08-26 13:25:37 +02:00
Markus F.X.J. Oberhumer 24ce25bb5c Updated READMEs. 2006-08-26 13:25:04 +02:00
Markus F.X.J. Oberhumer e051b69e80 Use -fwrapv for m68k stubs. 2006-08-26 12:57:21 +02:00
Markus F.X.J. Oberhumer 59283d1164 More work on m68k. 2006-08-24 20:48:09 +02:00
Markus F.X.J. Oberhumer 0de32a5edc Small Makefile cleanup. 2006-08-24 14:07:53 +02:00
Markus F.X.J. Oberhumer 4f80066dcb New ACC version. 2006-08-24 12:39:45 +02:00
Markus F.X.J. Oberhumer 04ddc8003f Started work on m68k. 2006-08-24 03:56:11 +02:00
Markus F.X.J. Oberhumer 3213f98d66 Added recursive targes extra-all and extra-clean. 2006-08-24 01:34:57 +02:00
Markus F.X.J. Oberhumer 1f16f85c51 Reorganized Makefile.extra. 2006-08-24 01:34:24 +02:00
Markus F.X.J. Oberhumer c03cb3a11c All stubs now depend on Makefile and thus will get rebuilt more often. 2006-08-24 01:34:06 +02:00
László Molnár 62e29a6546 let us see the relocation info in the disassembled stubs 2006-08-23 14:43:37 +02:00
László Molnár 3574b065d6 fixed prototype of ElfLinkerMipsLE::relocate1 2006-08-23 14:35:28 +02:00
Markus F.X.J. Oberhumer c0c47f41be Added initial lzma support for m68k. 2006-08-23 13:58:16 +02:00
Markus F.X.J. Oberhumer 37761d580f Updated for bin-upx-20060823. 2006-08-23 13:11:01 +02:00
Markus F.X.J. Oberhumer e075c8e691 Updated unused code. 2006-08-23 11:30:42 +02:00
Markus F.X.J. Oberhumer 0c61ca1a6b Renamed addLinkerSymbols() to defineSymbols(). 2006-08-23 11:20:06 +02:00
John Reiser 1846fa1f54 PackLinuxElf start loader at 0 mod 8 2006-08-22 21:22:49 -07:00
John Reiser 579ce20cad remove patchFilter32() 2006-08-22 20:49:28 -07:00
John Reiser 12e4bcba5d Elf64 sets .p_flags for 0-length .bss 2006-08-22 11:23:55 -07:00
László Molnár b4f57dee3b arm.v4t-wince.pe: minor cleanups 2006-08-22 14:16:46 +02:00
Markus F.X.J. Oberhumer f11673ae3f Removed Packer::patchDecompressor(). 2006-08-22 11:05:18 +02:00
Markus F.X.J. Oberhumer a27af7dd7e Small update. 2006-08-22 11:02:54 +02:00
Markus F.X.J. Oberhumer 2b26a3cc14 Updated .hgignore. 2006-08-22 10:59:16 +02:00
Markus F.X.J. Oberhumer 47c4849694 Added support for debug.dump_stub_loader. 2006-08-22 10:48:04 +02:00
John Reiser 30a4adf331 Reduce usage of patchDecompressor() 2006-08-21 21:19:48 -07:00
John Reiser 117a721166 ElfLinker::addSection ==> addLoader 2006-08-21 19:52:09 -07:00
John Reiser 1a219e62ba Bvmlinuz: linker->defineSymbol() instead of patchDecompressor() 2006-08-21 14:26:42 -07:00
John Reiser c8d54b324b Only PC-relative relocations get range checked. 2006-08-21 14:26:08 -07:00
John Reiser 0ac2971fc1 add UPX_F_BSD_ELF_i386 to the exceptions for patchDecompressor() 2006-08-21 12:09:46 -07:00
Markus F.X.J. Oberhumer 348a40201b Introduce $(tc_bfdarch) and generate disassemblies to verify code quality. 2006-08-21 20:55:37 +02:00
Markus F.X.J. Oberhumer 9f20ddc800 Removed Packer::patchVersion() and Packer::patchVersionYear(). 2006-08-21 20:28:14 +02:00
Markus F.X.J. Oberhumer 6f1cc2c1e5 Renamed ElfLinker::addSection(sname) to addLoader(). 2006-08-21 20:07:42 +02:00
Markus F.X.J. Oberhumer 601cd95277 Removed Packer::getIdentstr(). 2006-08-21 19:57:43 +02:00
Markus F.X.J. Oberhumer 8e9ce59ef2 Minor Makefile cleanups. 2006-08-21 16:40:20 +02:00
László Molnár d76ef8e3cf arm/pe: use embed_objinfo in the Makefile
made some symbols globals in arm.v4a-wince.pe.S & arm.v4t-wince.pe.S
2006-08-21 15:20:20 +02:00
John Reiser c19ffafd8d i386-linux.elf decompress does not need cto8 2006-08-20 11:19:37 -07:00
Markus F.X.J. Oberhumer 996a99ad75 Some linker.cpp cleanups. 2006-08-20 11:15:36 +02:00
Markus F.X.J. Oberhumer affb926d44 Whitespace cleanups. 2006-08-20 11:08:38 +02:00
John Reiser c506e534aa propagate to .h in stub/ 2006-08-19 18:41:45 -07:00
John Reiser 9994315070 un-debug 2006-08-19 18:40:49 -07:00
John Reiser 4f0d89ef8b convert PackMachPPC32 to new Linker 2006-08-19 15:28:16 -07:00
Markus F.X.J. Oberhumer aab984618d Fix newLinker() for mach/ppc32. 2006-08-19 14:29:40 +02:00
Markus F.X.J. Oberhumer 8b662bc6b5 Removed trailing whitespace. 2006-08-19 14:01:39 +02:00
Markus F.X.J. Oberhumer 03ce7a8db3 Removed all old linker classes - we exclusively use ElfLinker now. 2006-08-19 14:00:22 +02:00
Markus F.X.J. Oberhumer 033e7928b5 Minor Makefile updates. 2006-08-19 13:05:16 +02:00
Markus F.X.J. Oberhumer b095f2a158 Strip trailing whitespace from objdump info. 2006-08-18 13:22:38 +02:00
Markus F.X.J. Oberhumer 196c0e0ebc Added embed_objinfo macro. 2006-08-18 13:18:10 +02:00
Markus F.X.J. Oberhumer 8ab309630b Keep old alloca() code around. 2006-08-18 12:26:41 +02:00
Markus F.X.J. Oberhumer 42bac47a71 Improve automatic dependency information by using '-MT'. 2006-08-18 12:26:06 +02:00
Markus F.X.J. Oberhumer 3bc4de2236 Added missing stubs to hg repo. 2006-08-18 12:25:34 +02:00
John Reiser a6e4b45a38 --force-execve for *BSD/386 2006-08-17 17:35:33 -07:00
John Reiser 28e97ccaf2 avoid symbol 'byte' 2006-08-17 17:18:37 -07:00
Markus F.X.J. Oberhumer 255781c029 Minor cleanups. 2006-08-17 13:09:51 +02:00
John Reiser 7f5635ea8c Section LZMA_ELF00 saves time (but no space) by not clearing CProb[]. 2006-08-16 19:49:09 -07:00
Markus F.X.J. Oberhumer 4f18ec726c Rebuilt with bin-upx-20060816 (untested mipsel changes). 2006-08-16 19:40:33 +02:00
Markus F.X.J. Oberhumer 263622d628 Updated for bin-upx-20060816. 2006-08-16 19:37:25 +02:00
László Molnár 1dfd2443ac name of file comments fixed 2006-08-16 15:29:11 +02:00
Markus F.X.J. Oberhumer 881bd53f60 Small Makefile cleanups. 2006-08-16 09:50:00 +02:00
Markus F.X.J. Oberhumer ec4404b1ba We have to use "dword ptr" instead of "dword" ! 2006-08-16 09:38:49 +02:00
Markus F.X.J. Oberhumer badaeac81f Use "jmps" macro instead of #define. 2006-08-16 09:34:27 +02:00
Markus F.X.J. Oberhumer 618d5ddaff More renaming. 2006-08-16 09:24:31 +02:00
Markus F.X.J. Oberhumer 4ed74af868 More renaming. 2006-08-16 09:07:00 +02:00
Markus F.X.J. Oberhumer 123d9af7d0 More renaming in arch/i386. 2006-08-16 08:39:58 +02:00
Markus F.X.J. Oberhumer 4f17b30915 Started renaming .asm files to .S. 2006-08-16 08:13:36 +02:00
Markus F.X.J. Oberhumer 1fc265b0aa Use symbolic stride again. 2006-08-16 07:59:21 +02:00
John Reiser afae9b8d17 merge 2006-08-15 14:01:53 -07:00
John Reiser 481be44879 Work around assembler bug: double-indexing by symbolic stride fails. 2006-08-15 14:00:35 -07:00
Markus F.X.J. Oberhumer b8530b0f0b Whitespace cleanups. 2006-08-15 22:48:04 +02:00
Markus F.X.J. Oberhumer 69de79684f Removed some unused files. 2006-08-15 22:41:05 +02:00
Markus F.X.J. Oberhumer 6e6fd057b5 Cleaned up stub/Makefile. 2006-08-15 22:38:40 +02:00
John Reiser 4b0ebf2b80 merge 2006-08-15 12:11:36 -07:00
John Reiser ee82c32119 'dword' is a symbol to libexec/gcc/i686-unknown-linux-gnu/3.4.6/cc1 2006-08-15 12:10:54 -07:00
Markus F.X.J. Oberhumer 3fe6731035 Disable WITH_LUA for now. 2006-08-15 19:23:03 +02:00
Markus F.X.J. Oberhumer 1c3f3b5705 Removed last dependency on nasm assembler. 2006-08-15 18:50:41 +02:00
Markus F.X.J. Oberhumer def1ccffc4 Rebuilt with bin-upx-20060815. 2006-08-15 18:39:05 +02:00
Markus F.X.J. Oberhumer fa2e531343 Updated for bin-upx-20060815. 2006-08-15 18:38:38 +02:00
Markus F.X.J. Oberhumer 814ddbc6cc Remove duplicate inclusion. 2006-08-15 17:20:23 +02:00
John Reiser 267e8dcfb6 Omit double include of macros2.ash. 2006-08-15 07:22:52 -07:00
John Reiser 49ec1561f8 merge 2006-08-15 07:11:06 -07:00
John Reiser e2dc612153 Add cl1_d32_2.ash. 2006-08-15 07:08:50 -07:00
Markus F.X.J. Oberhumer 8f225431fe Minor updates to Makefile and stubs. 2006-08-15 10:23:45 +02:00
Markus F.X.J. Oberhumer 194be5e0b7 Moved o2bin.pl to UNUSED. 2006-08-15 09:21:39 +02:00
John Reiser 6788a05dd1 convert powerpc-darwin.macho-entry.h to new linker 2006-08-14 21:20:30 -07:00
John Reiser 6a7066ac2f Avoid linker->setLoaderAlignOffset(). 2006-08-14 19:21:15 -07:00
John Reiser ec5ff4e973 merge 2006-08-14 13:06:53 -07:00
John Reiser fe6d460531 rebuild: arm-unknown-linux-gnu-gcc-4.1.0, i386-linux-gcc-3.4.6;
powerpc/32/ppc_regs.h
2006-08-14 12:30:33 -07:00
John Reiser 9cb97af10f begin conversion to new linker 2006-08-14 12:10:34 -07:00
John Reiser 1c784eea3d typo for i386-bsd.elf-main.o 2006-08-14 12:09:42 -07:00
László Molnár 59dd33a461 ps1/exe updates from Jens 2006-08-14 17:15:26 +02:00
László Molnár 97ebd912dc rebuilt arm.v4t-wince.pe.h 2006-08-14 14:26:40 +02:00
Markus F.X.J. Oberhumer 742fcc060c Update NEWS. 2006-08-14 08:46:55 +02:00
Markus F.X.J. Oberhumer 3ad5cb8a23 Merge. 2006-08-14 08:44:58 +02:00
John Reiser 0d1f12e31a Use better name osabi_note. 2006-08-13 20:14:14 -07:00
John Reiser a8ddf8f66d Detect PT_NOTE for NetBSD, OpenBSD. 2006-08-13 20:00:44 -07:00
John Reiser f7a9c0a248 Mention lzma, *BSD, linux workaround [needs clarification.] 2006-08-13 12:44:40 -07:00
John Reiser 190badb395 arm-unknown-linux-gnu-gcc-4.1.0 2006-08-13 12:32:42 -07:00
Markus F.X.J. Oberhumer 3d91ab6c31 Introduced bele_policy.h. 2006-08-13 15:30:26 +02:00
Markus F.X.J. Oberhumer c15b8d71bc Removed trailing whitespace. 2006-08-13 14:47:24 +02:00
John Reiser 5a707dba8a fix NRV_TAIL, ELFMAINY 2006-08-11 20:45:43 -07:00
John Reiser ffd2fcde6b sections NRV_HEAD, NRV_TAIL replace NRV_COMMON 2006-08-11 20:29:51 -07:00
László Molnár 8e4056c1e4 vmlinuz/386: fixed zlib uncompression problem on dos 2006-08-11 17:59:12 +02:00
László Molnár 1554e2b135 lzma support for ps1 from Jens 2006-08-11 11:18:01 +02:00
John Reiser 4715cbb70d PackLinuxI386::newLinker() is a new ElfLinkerX86;
re-generate i386-linux.elf.execve-entry.h after lzma_d_cs.S
2006-08-10 18:48:32 -07:00
John Reiser fd1611079a auto-define symbol *ABS* in section *ABS*
(for i386-linux.elf.execve-entry.h  R_386_PC  *ABS*)
2006-08-10 17:02:36 -07:00
John Reiser 8edc03df64 PackLinuxI386::newLinker(); also use arm-unknown-linux-gnu-gcc-4.1.0
to re-compile stub/src/arch/arm/v4t/lzma_d_cf.S, lzma_d_cs.S .
2006-08-10 16:52:20 -07:00
László Molnár 9f5c0af5b8 step 0 of refactoring arm/pe & win32/pe ready 2006-07-26 14:00:36 +02:00
László Molnár 6d6eeba5d5 refactoring of arm/pe and win32/pe started 2006-07-25 18:30:12 +02:00
László Molnár 5dfb64ef71 arm.v4a-wince.pe.h rebuilt 2006-07-25 12:31:45 +02:00
John Reiser e5bda7add7 save 28 bytes (> 10%) in arch/arm/v4a/nrv2b_d8.S 2006-07-24 14:48:06 -07:00
John Reiser 77f9b336bd ARM lzma_d_cf.S use .Lf labels to save space in arm-linux.elf-entry.h 2006-07-24 06:26:04 -07:00
László Molnár cf930d0dde merge 2006-07-24 11:06:06 +02:00
László Molnár f01c94e8bc arm/pe: nrv2b support for v4a mode 2006-07-23 21:50:51 +02:00
László Molnár 0d774527b4 merge. arm/pe lzma updates 2006-07-23 21:08:27 +02:00
John Reiser 58ba9496d0 arm-linux lzma_d.c omit -fPIC enables using r10 2006-07-23 09:13:47 -07:00
John Reiser 1993e94e53 ARM lzma bug in cacheflush 2006-07-23 07:19:35 -07:00
László Molnár 3bcc06ed09 arm/pe: lzma works for v4t too
minor changes in v4a code
2006-07-23 16:13:10 +02:00
John Reiser 2f6ce88e28 ARM Linux lzma work 2006-07-22 20:53:15 -07:00
John Reiser cd1dec9fc7 PackLinuxElf32arm lzma cache flush; 5th arg to f_decompress is on stack 2006-07-22 11:39:29 -07:00
John Reiser 05872d7650 arm-linux nrv2b works: conditon code bug, cache flush, cache lookahead 2006-07-22 08:48:04 -07:00
László Molnár 1dcee2ffa2 lzma for arm/pe v4a works 2006-07-22 17:30:09 +02:00
John Reiser 5f622efb77 nrv2e PackLinuxElf32armLe works 2006-07-21 19:10:48 -07:00
John Reiser 52e8326d54 work on PackLinuxElf32arm; add nrv2b_d8.S 2006-07-21 13:11:02 -07:00
László Molnár 436532bed7 arm/pe: lzma support for v4a (untested) 2006-07-21 15:08:29 +02:00
László Molnár d15e789200 nrv2d support for arm/pe v4a mode 2006-07-20 18:11:14 +02:00
John Reiser 98942f5528 work on PackLinuxElf32arm, including nrv2d and lzma 2006-07-19 17:29:17 -07:00
László Molnár c7c21dc122 rebuilt some i386 stubs 2006-07-18 13:45:22 +02:00
László Molnár 4500c1d1a4 lzma should be working again for most of the i386 formats 2006-07-18 13:44:44 +02:00
John Reiser b8b983dded nrv2d decompressor for PackLinuxElf64amd 2006-07-17 15:02:37 -07:00
John Reiser d6a6673971 nrv2d decompressor for PackLinuxElf32ppc 2006-07-17 13:23:49 -07:00
László Molnár 0580fe8db8 merge 2006-07-17 17:39:45 +02:00
László Molnár c727e24138 win32/pe works with lzma again 2006-07-17 17:38:44 +02:00
László Molnár b83698ebf5 Packer::defineDecompressorSymbols added 2006-07-17 17:34:03 +02:00
László Molnár 3fbbaa5130 really fixed i386 lzma stub 2006-07-17 17:33:03 +02:00
John Reiser 2f48b840ae merge 2006-07-17 08:06:06 -07:00
John Reiser efdee11d5a lzma PackLinuxElf32ppc works! 2006-07-17 08:05:31 -07:00
László Molnár 4c87e11aeb 8 bit relocation overflow detection added to ElfLinker 2006-07-17 16:58:24 +02:00
László Molnár e881e008b8 fixes for the i386 nrv2b & nrv2d stubs 2006-07-17 16:56:17 +02:00
László Molnár 1b2837915d small conversion related fix to the lzma stub 2006-07-17 16:54:41 +02:00
László Molnár d076a6724f merge 2006-07-17 12:13:08 +02:00
John Reiser 386af71c39 add lzma_d.S for PackLinuxElf32ppc 2006-07-16 22:35:35 -07:00
John Reiser 49f277192c hacking lzma PackLinuxElf32ppc 2006-07-16 22:32:55 -07:00
John Reiser 5974a6276b undebug powerpc-linux.elf-entry.S 2006-07-16 19:06:04 -07:00
John Reiser e06a390771 PackLinuxElf32ppc works (except lzma) 2006-07-16 19:01:17 -07:00
John Reiser b34e204676 PackLinuxElf32ppc conversion; alignment in *::Section 2006-07-16 15:04:16 -07:00
John Reiser 755d990dfd unify buildLinuxLoader using addStubEntrySections and addLinkerSymbols 2006-07-16 09:48:22 -07:00
John Reiser 7185358b98 lzma PackLinuxElf64amd works! 2006-07-15 20:05:41 -07:00
John Reiser 3843ec1e02 lzma for PackLinuxElf64amd 2006-07-15 16:01:53 -07:00
John Reiser cfc5631d5d PackLinuxElf64amd works (except for lzma) 2006-07-15 13:46:37 -07:00
John Reiser e64555aca0 hacking PackLinuxElf64amd 2006-07-14 19:43:38 -07:00
John Reiser ef52ebb529 workaround i386 assembler misfeature 2006-07-14 06:33:40 -07:00
John Reiser c98136ca4f fix error in assembler conversion 2006-07-13 21:10:42 -07:00
László Molnár 65f44d24ca miniacc support for arm-wince-pe 2006-07-13 16:50:26 +02:00
John Reiser 44f20782fd cleanup after merge; AMD64 ElfLinker 2006-07-12 11:42:03 -07:00
John Reiser 9b1d76a5d0 Added tag main-2006-07-12 for changeset 72fe9925b247073cd8342d8bff07adc47b72173f 2006-07-12 11:26:15 -07:00
John Reiser 21b5074ce8 Added tag jfr-2006-07-12 for changeset 8afead5e7182950592970330c218913fecfbe390 2006-07-12 11:24:52 -07:00
John Reiser 0b8825fecb i386 conversion stub conversion; nrv2b_d32_2.ash etc. 2006-07-12 11:15:14 -07:00
László Molnár 3d3c20e507 ElfLinker improvements
Sections/symbols/relocations are allocated dynamically
Sections use an internal copy of their input data
2006-07-11 14:40:58 +02:00
László Molnár 67a282f19f class nocopy introduced 2006-07-11 13:58:13 +02:00
John Reiser 92023b533a merge 2006-07-10 13:26:39 -07:00
John Reiser c1d14c150e How to debug i386-linux.kernel.vmlinu[xz] under qemu 2006-07-10 13:25:39 -07:00
László Molnár aa656c74d5 merge 2006-07-10 13:30:04 +02:00
László Molnár e39b7ffe30 ps1/exe updates from Jens Medoch 2006-07-10 13:28:27 +02:00
John Reiser 1897148abc convert i386-bsd.elf-entry.asm 2006-07-09 20:07:37 -07:00
John Reiser b76118802a ElfLinkerPpc32 2006-07-09 19:52:23 -07:00
John Reiser 8266aa3343 i386/nrv2d_d32_2.ash 2006-07-09 19:15:03 -07:00
John Reiser ab0c349261 workaround ElfLinker not handling addSection(,,) from dynamic block 2006-07-09 17:29:22 -07:00
John Reiser d5e0e66426 PackLinuxElf32x86::newLinker() 2006-07-09 16:59:41 -07:00
John Reiser c5b3107f83 start converting PackLinuxElf32x86 to ElfLinker 2006-07-09 10:17:52 -07:00
John Reiser 1a0a64e4de ::addStubEntrySections() with default ELFMAINX 2006-07-09 08:48:06 -07:00
John Reiser 6bd9805bcc start converting PackLinuxElf64amd to ElfLinker 2006-07-09 08:14:04 -07:00
László Molnár f74c2af65c conversion of atari/tos to ElfLinker finished 2006-07-07 17:49:30 +02:00
László Molnár 9531bdf674 fixed a bug in ElfLinker 2006-07-07 16:57:15 +02:00
László Molnár 76e705e7ee more atari/tos work 2006-07-07 09:20:43 +02:00
László Molnár d35211328e ElfLinker: rela support added 2006-07-07 08:51:48 +02:00
László Molnár b7bbd81dda conversion of atari/tos to ElfLinker started 2006-07-06 18:30:34 +02:00
László Molnár 9836dd5d10 merge 2006-07-06 10:27:31 +02:00
László Molnár 2109ad320d ps1: nrv2b & nrv2d converted to gas
updated README.SRC
removed app-asm5900.pl
2006-07-06 09:20:05 +02:00
László Molnár c026121c0e mips conversion to ElfLinker almost ready 2006-07-06 00:54:14 +02:00
László Molnár ee0c87f7b1 mips conversion started 2006-07-05 18:32:52 +02:00
John Reiser 709fb93a22 sizeof(shstrtab) already includes terminating '\0' 2006-07-05 05:40:24 -07:00
László Molnár b38cd0a48d merge 2006-07-05 13:02:14 +02:00
László Molnár 264435c32d rebuilt the stubs 2006-07-05 13:00:42 +02:00
László Molnár c285929ad3 i386/macros2.ash: ctojr32 fixes 2006-07-04 23:30:50 +02:00
John Reiser 1cbea8157d merge 2006-07-04 08:59:29 -07:00
John Reiser 0a10334f1b more *BSD, especially do_xmap() for OpenBSD 2006-07-04 08:59:00 -07:00
László Molnár f0d5a6ebac vmlinu[xz] using nrv2e converted to ElfLinker 2006-07-04 17:36:54 +02:00
László Molnár db7086b5e6 pe: ignore duplicated relocation records 2006-07-04 14:11:56 +02:00
John Reiser 0e92280b33 *BSD elf-fold escape hatch differs from Linux 2006-07-03 19:35:56 -07:00
John Reiser 0d7255158a OpenBSD "pro-active security" causes headaches 2006-07-03 16:35:21 -07:00
László Molnár 33564b68dd loader.txt updated 2006-07-03 15:13:53 +02:00
Markus F.X.J. Oberhumer ba942b952a Merge. 2006-07-03 14:56:45 +02:00
Markus F.X.J. Oberhumer bd7f28896e Minor cleanups. 2006-07-03 14:54:50 +02:00
John Reiser 18fe124696 ::generateElfHdr() sets .e_ident[Elf32_Ehdr::EI_OSABI] 2006-07-03 05:51:45 -07:00
John Reiser ea3a3b6e1c Elf32_Ehdr::ELFOSABI_LINUX 2006-07-03 05:47:01 -07:00
Markus F.X.J. Oberhumer e6c06aacff New brandelf.py script. 2006-07-03 13:00:53 +02:00
Markus F.X.J. Oberhumer 1aee92cd5c Introduced $(tc_bfdname). 2006-07-03 12:19:20 +02:00
Markus F.X.J. Oberhumer 40c4cad491 Rebuilt. 2006-07-03 12:07:34 +02:00
László Molnár 013d46fb02 merge 2006-07-03 10:46:32 +02:00
László Molnár f0f465411f win32/pe using nrv2e converted to ElfLinker 2006-07-03 09:21:51 +02:00
John Reiser 32ce83475d more *BSD arrangements 2006-07-02 21:54:44 -07:00
John Reiser ec0d3f5b5d merge 2006-07-02 19:28:19 -07:00
John Reiser 75294b9146 FreeBSD, NetBSD, OpenBSD on equal footing 2006-07-02 19:27:08 -07:00
Markus F.X.J. Oberhumer 26a0eb68ef Merge. 2006-07-03 01:42:12 +02:00
Markus F.X.J. Oberhumer b983e29fb0 Fix compilation on big endian machines. Remove trailing whitespace. 2006-07-03 01:40:59 +02:00
John Reiser 68dadabc29 BSD/elf386 2006-07-02 16:25:31 -07:00
László Molnár ed9fd3f0e0 watcom/le using nrv2e converted to ElfLinker 2006-07-02 23:21:15 +02:00
László Molnár fa9573436a tmp/adam using nrv2e converted to ElfLinker 2006-07-02 22:39:53 +02:00
László Molnár 6d2058c3b7 reloc32 uncommented 2006-07-02 22:32:12 +02:00
John Reiser 0d7f93b877 unused: getrusage personality msync getcwd 2006-07-02 12:04:12 -07:00
László Molnár f022c9d510 dos/djgpp2 using nrv2e converted to ElfLinker 2006-07-01 17:29:41 +02:00
László Molnár 5964a06386 arm/pe works with ElfLinker 2006-07-01 12:36:07 +02:00
László Molnár f14dc4a4e9 ElfLinkerArmLe fixes 2006-07-01 12:25:26 +02:00
László Molnár fd56e2534c fixed alignment handling typo 2006-07-01 09:40:12 +02:00
László Molnár 08962a74ab started the arm/pe conversion to ElfLinker 2006-07-01 00:21:53 +02:00
László Molnár f850d36c52 dos/com & dos/sys: use the new ElfLinker features 2006-07-01 00:21:06 +02:00
László Molnár c5fb161477 ElfLinker updates
commented out the debugging printfs
now it's possible to set the offset of sections
aligment handling simplified
ElfLinkerArmPE introduced
2006-07-01 00:10:02 +02:00
László Molnár bfc2fab33f use "//" instead of "#" for comments 2006-07-01 00:01:35 +02:00
John Reiser ec9d6c4fd2 workaround linux bug which demands writeable PT_LOAD for .bss 2006-06-29 19:07:02 -07:00
John Reiser 6135d61e3d *-fold.h depends on *.lds 2006-06-29 17:01:38 -07:00
John Reiser a677242a2c Bvmlinuz remember to patchDecompressor() 2006-06-29 13:58:41 -07:00
John Reiser 6602f30112 true==checkCompressionRatio() means success 2006-06-29 12:07:01 -07:00
Markus F.X.J. Oberhumer a4b8dc18c1 Strip unneeded symbols and sections from i086-* stubs. 2006-06-29 19:09:16 +02:00
Markus F.X.J. Oberhumer c0d4741f88 Merge. 2006-06-29 18:43:36 +02:00
László Molnár b33718180c ElfLinkerX86 introduced.
Simple alignment handling added to ElfLinker.
dos/exe device drivers can be compressed again.
2006-06-29 18:21:01 +02:00
John Reiser 3872393b29 call freezeLoader 2006-06-29 06:08:57 -07:00
John Reiser 1d72a7df99 propagate IMAGE_OFFSET from commandline 2006-06-29 05:57:28 -07:00
Markus F.X.J. Oberhumer 5455908772 Merge. 2006-06-29 14:39:42 +02:00
Markus F.X.J. Oberhumer 8882192fac Minor cleanups. 2006-06-29 14:38:18 +02:00
Markus F.X.J. Oberhumer 7b77491c06 Refactoring: move fields ui_pass and ui_total_passes from class
Packer into class UiPacker.
2006-06-29 14:37:01 +02:00
László Molnár 20bf214d6e dos/com & dos/sys: xchg si,di vs. xchg di,si difference fixed. i086-dos16.com.h rebuilt 2006-06-29 14:27:25 +02:00
Markus F.X.J. Oberhumer 8ab3e63aeb First start of refactoring field ph out of class Packer. 2006-06-29 14:26:49 +02:00
László Molnár 0dc03214c5 merge 2006-06-29 11:51:47 +02:00
John Reiser 362e98b43d lzma: limit stack to ~28KB for decompressing kernel 2006-06-28 22:34:12 -07:00
John Reiser 193e085cf0 limit stack to ~28KB for decompressing kernel 2006-06-28 22:30:05 -07:00
John Reiser e0df2a342b merge 2006-06-28 22:20:24 -07:00
John Reiser ba19ccac43 tabify the commented Makefile 2006-06-28 22:18:48 -07:00
Markus F.X.J. Oberhumer d7261b7a78 Remove debugging code. 2006-06-29 07:00:06 +02:00
Markus F.X.J. Oberhumer 0d80173efd Update some structs for future features. 2006-06-29 06:42:17 +02:00
Markus F.X.J. Oberhumer 930f07d15e Move upx_compress_result_t handling into right place. 2006-06-29 06:24:24 +02:00
Markus F.X.J. Oberhumer 66df7389d2 Refactoring: pass upx_compress_config_t to Packer::compressWithFilters()
so that formats can set conf_lzma.max_num_probs.

Also renamed compression parameters to use cconf & cresult.
2006-06-29 06:15:28 +02:00
Markus F.X.J. Oberhumer c7bf0b6ddd Removed trailing whitespace. 2006-06-29 05:12:39 +02:00
Markus F.X.J. Oberhumer 0bc361adeb Introduced conf_lzma.max_num_probs to limit stack size for decompression. 2006-06-29 05:12:01 +02:00
John Reiser 4fff523a6d Merge 2006-06-28 19:45:58 -07:00
John Reiser 67e09fb342 kernel Makefile; fix cross-platform endian trouble 2006-06-28 19:44:02 -07:00
Markus F.X.J. Oberhumer c360806f47 Small Makefile updates. 2006-06-29 04:16:58 +02:00
Markus F.X.J. Oberhumer 7b74b73b08 Start using binutils-multiarch-2.17. 2006-06-29 01:52:05 +02:00
László Molnár e9a851c0d4 dos/exe: migrated to ElfLinker 2006-06-29 00:44:12 +02:00
Markus F.X.J. Oberhumer b13b169149 Fixed assembly for binutils-2.16.91. 2006-06-29 00:38:12 +02:00
László Molnár 455329a745 dos/sys: got rid of the "next" symbol 2006-06-29 00:28:47 +02:00
László Molnár a68b76c8b4 undefined symbols are initialized to "0xdeaddead" 2006-06-29 00:22:45 +02:00
László Molnár 96e3899216 increased the maximum number of symbols 2006-06-29 00:22:03 +02:00
Markus F.X.J. Oberhumer 771ab5ea9a Added notes about binutils-multiarch-2.17. 2006-06-29 00:11:06 +02:00
László Molnár 3c87e6b270 merge 2006-06-28 15:10:01 +02:00
László Molnár 6d8afec510 ElfLinker started. Dos/com & dos/sys formats converted 2006-06-28 14:45:58 +02:00
John Reiser 89e25657d8 fix cross-platform endian trouble with ELF headers 2006-06-27 13:07:31 -07:00
John Reiser 29387f1fcf lzma Elf i386 minor tuning 2006-06-27 09:53:28 -07:00
John Reiser 58e885c052 un-debug 2006-06-26 17:21:45 -07:00
John Reiser 984dfcd7e1 adapt to new 2-byte replacement for LzmaDecodeProperties() 2006-06-26 17:16:45 -07:00
Markus F.X.J. Oberhumer 3785479086 Use custom encoding for LZMA properties. 2006-06-26 17:28:46 +02:00
Markus F.X.J. Oberhumer 8ed280907c Merge. 2006-06-26 14:36:29 +02:00
Markus F.X.J. Oberhumer d742671205 Update comment. 2006-06-26 14:36:10 +02:00
John Reiser 87e72c28a4 no PROT_WRITE for .text on i386-linux.elf.shell 2006-06-25 06:05:53 -07:00
John Reiser 4dee357362 optimize PackLinuxI386::buildLinuxLoader 2006-06-25 05:56:36 -07:00
John Reiser 431f4b9b0d fix i386-linux.elf.shell 2006-06-25 05:44:39 -07:00
John Reiser dd5b7825d5 save 4 bytes in __LZMA_ELF00__ 2006-06-24 16:48:43 -07:00
John Reiser 02bc48925a lzma ELF minimal CLzmaDecoderState each time 2006-06-24 14:44:40 -07:00
John Reiser 4eb505755e lzma for ELF 2006-06-24 14:00:41 -07:00
Markus F.X.J. Oberhumer 83e94a70ea Narrow try/catch. 2006-06-24 17:53:26 +02:00
Markus F.X.J. Oberhumer 8a150b27c3 Update comment. 2006-06-24 17:39:10 +02:00
John Reiser 1a51451ec2 ELF stub uses getSizeForCompression() 2006-06-23 19:32:29 -07:00
Markus F.X.J. Oberhumer 41e51bfb77 Assert dst_len buffer size in upx_compress(). 2006-06-23 17:50:39 +02:00
Markus F.X.J. Oberhumer 7e1d9bc768 Split options_t::crp into multiple structs. 2006-06-23 16:23:31 +02:00
Markus F.X.J. Oberhumer ba065ec1d8 Improve error code reporting in compression wrappers. 2006-06-23 15:52:10 +02:00
Markus F.X.J. Oberhumer fe057a91c8 Cleanup: removed upx_bool and upx_uint types. 2006-06-23 15:00:33 +02:00
László Molnár d2c36eefc9 pe: fixed unpack problem in rebuildImports() 2006-06-23 11:17:26 +02:00
John Reiser 28d56bab04 Merge 2006-06-22 21:30:59 -07:00
John Reiser 2500eff90d more LZMA debugging for Linux i386 ELF 2006-06-22 21:25:18 -07:00
Markus F.X.J. Oberhumer 153446b3a1 Fixed debugging code. 2006-06-23 05:40:35 +02:00
Markus F.X.J. Oberhumer 391f5caaa2 Added precondition assertions to upx_decompress(). 2006-06-23 05:27:42 +02:00
Markus F.X.J. Oberhumer cc0df92444 Added some more checks. 2006-06-23 04:02:06 +02:00
John Reiser 03910d67c3 M_LZMA bug tracking: decompress fails but says OK 2006-06-22 17:18:17 -07:00
Markus F.X.J. Oberhumer fec5cc864e Update Makefile. 2006-06-23 01:02:47 +02:00
Markus F.X.J. Oberhumer cb78362713 Use inner class UiPacker::State. 2006-06-22 19:40:43 +02:00
Markus F.X.J. Oberhumer 4c5b1a6ff4 Added some assertions to track down a win32/pe unpack problem which
shows up on 64-bit machines.
2006-06-22 16:47:10 +02:00
László Molnár 83c5727698 merge 2006-06-22 16:17:09 +02:00
László Molnár 80838ff1e9 watcom/le: lzma seems to work 2006-06-22 16:15:32 +02:00
Markus F.X.J. Oberhumer 29e8d072b7 Simplify C++ style in Linker. 2006-06-22 16:12:48 +02:00
Markus F.X.J. Oberhumer d7592f01e1 Renamed method. 2006-06-22 16:00:03 +02:00
László Molnár 392f283d9e added some comments 2006-06-22 15:54:25 +02:00
Markus F.X.J. Oberhumer bcd738ebbb Introduced Packer::patchDecompressorGetExtraStacksize(). 2006-06-22 15:35:38 +02:00
László Molnár 8020c52c48 merge 2006-06-22 15:04:39 +02:00
László Molnár 3f566e541d djgpp2: lzma seems to work 2006-06-22 15:00:15 +02:00
Markus F.X.J. Oberhumer be4a631dc8 Bump version. 2006-06-22 14:50:09 +02:00
Markus F.X.J. Oberhumer 0bfdf908c1 Fixed typo. 2006-06-22 14:20:05 +02:00
Markus F.X.J. Oberhumer 6f2fc23f77 Added LZMA license information. 2006-06-22 14:11:58 +02:00
Markus F.X.J. Oberhumer f3a47c7e70 Add more lzma_d.ash includes. 2006-06-22 14:07:23 +02:00
Markus F.X.J. Oberhumer 36349ffabb Removed trailing whitespace. 2006-06-22 14:06:21 +02:00
John Reiser b13f7366cf freezeLoader() sooner in PackLinuxElf32x86::buildLinuxLoader() 2006-06-21 17:08:58 -07:00
John Reiser 9181bcd9a7 CT24ARM needs big+little endian versions 2006-06-21 13:57:12 -07:00
Markus F.X.J. Oberhumer 7dbc1d894b Add default defines like -Dstub_i386_dos32_djgpp2=1 to nasm. 2006-06-21 21:31:20 +02:00
Markus F.X.J. Oberhumer 5720445d15 Use ebx for state pointer. Decrease local stack size. 2006-06-21 14:34:23 +02:00
Markus F.X.J. Oberhumer a90027521d Prepare Makefile for integrating lua-5.1.1 into upx. 2006-06-20 15:35:23 +02:00
Markus F.X.J. Oberhumer e02d400bf6 Avoid djgpp2 link error. 2006-06-20 15:25:38 +02:00
Markus F.X.J. Oberhumer efadb8fd31 More lzma stubs. 2006-06-19 23:19:34 +02:00
Markus F.X.J. Oberhumer a19d06561b Added amd64 implementations of lzma. 2006-06-19 22:33:18 +02:00
Markus F.X.J. Oberhumer 0b685d11c9 More lzma updates - win32/pe + lzma seems to work. 2006-06-19 22:08:06 +02:00
Markus F.X.J. Oberhumer 28f019d672 Merge. 2006-06-19 19:21:23 +02:00
Markus F.X.J. Oberhumer bf5cbfffc2 Start major refactoring. 2006-06-19 19:20:50 +02:00
László Molnár fe021e7c51 w32/pe: added Virtualloc and VirtualFree to the import list 2006-06-19 15:05:28 +02:00
Markus F.X.J. Oberhumer c42fb54bc6 Assorted cleanups. 2006-06-17 18:54:11 +02:00
Markus F.X.J. Oberhumer 9382b68781 Fix srcdir for VPATH build. 2006-06-16 20:08:21 +02:00
Markus F.X.J. Oberhumer 178198a417 Merge. 2006-06-16 17:52:50 +02:00
John Reiser 7068e90771 Merge 2006-06-16 06:53:56 -07:00
Markus F.X.J. Oberhumer 1c762f23d0 Simplify stub/Makefile. 2006-06-16 15:51:59 +02:00
John Reiser fd2b9a6e21 filter 0x51 (ARM call trick, big-endian at compress time) 2006-06-16 06:49:37 -07:00
Markus F.X.J. Oberhumer db43910288 Enter 2006. 2006-06-16 15:17:29 +02:00
Markus F.X.J. Oberhumer f248c0460e Use -mcpu=405 for powerpc stubs. Also run sstrip on powerpc-linux.elf-fold. 2006-06-16 14:36:13 +02:00
Markus F.X.J. Oberhumer b8e3c0ceb4 Allow ~/bin/bin-upx in addition to ~/local/bin/bin-upx. 2006-06-16 14:11:11 +02:00
Markus F.X.J. Oberhumer b5053d889e Updated toplevel Makefile. 2006-06-16 14:09:22 +02:00
Markus F.X.J. Oberhumer 12ba7776b3 Comment out unused upx_crc32(). 2006-06-16 14:08:56 +02:00
Markus F.X.J. Oberhumer 7817e88d03 Updated stub/Makefile. 2006-06-16 13:26:36 +02:00
Markus F.X.J. Oberhumer 8dec65853d Fixed another bad merge issue. 2006-06-16 12:34:37 +02:00
Markus F.X.J. Oberhumer 88e3cb3be1 Stub: remove files again which seem to have been brought back by some merge. 2006-06-16 12:31:14 +02:00
John Reiser fa702b48e3 unify PackLinuxElf32arm...::pack1() 2006-06-15 15:41:00 -07:00
John Reiser 299dcf6686 Merge 2006-06-15 12:21:01 -07:00
Markus F.X.J. Oberhumer 27f9ae5bbb Small cleanups. 2006-06-15 19:59:30 +02:00
Markus F.X.J. Oberhumer 9cb3a853f1 Added option --MMD= to gpp_inc.py for automated dependencies. 2006-06-15 19:03:18 +02:00
Markus F.X.J. Oberhumer 95c8ef4148 Added a number of convenience Makefiles. 2006-06-15 18:07:23 +02:00
Markus F.X.J. Oberhumer a41bb52014 Updated comments. 2006-06-15 18:03:24 +02:00
Markus F.X.J. Oberhumer 914cd7221e Updated. 2006-06-15 17:57:22 +02:00
Markus F.X.J. Oberhumer 2dfc0a58ab Renamed src/stub/util/ to src/stub/tools/ . 2006-06-15 17:56:57 +02:00
Markus F.X.J. Oberhumer 0c9f3c638a Explicitly list all required files for ~/local/bin/bin-upx/. 2006-06-15 17:52:30 +02:00
Markus F.X.J. Oberhumer a966d6acf1 Mention GNU make 3.81. 2006-06-15 17:27:04 +02:00
Markus F.X.J. Oberhumer 1e0c38b5f9 Renamed i386-linux-sstrip to sstrip. 2006-06-15 08:41:33 +02:00
Markus F.X.J. Oberhumer d3323d6550 Major refactoring of src/stub directory. 2006-06-15 08:17:50 +02:00
John Reiser ebed0b9f20 allow brev() in-place 2006-06-14 20:21:39 -07:00
John Reiser f654a453dc ARM_pack3() unifies big/little endian and HostPolicy 2006-06-14 16:06:50 -07:00
John Reiser 10decf94cc fix delete[] file_image 2006-06-14 11:41:49 -07:00
John Reiser 96dd4817f1 unify PackLinuxElf32...::canPack(); also ARM buildLinuxLoader() 2006-06-14 11:33:16 -07:00
Markus F.X.J. Oberhumer 72906cdc6a Removed all files from src/stub directory. 2006-06-14 17:37:59 +02:00
Markus F.X.J. Oberhumer fba4375be0 Cleanups. 2006-06-14 17:06:33 +02:00
Markus F.X.J. Oberhumer 75120676ad Introduced BEPolicy and LEPolicy. 2006-06-14 14:45:49 +02:00
Markus F.X.J. Oberhumer 7daf63fd3f Merge. 2006-06-14 11:48:44 +02:00
Markus F.X.J. Oberhumer 014de25f6f Disable lzma by default for now. 2006-06-14 11:42:24 +02:00
John Reiser 3fc6535012 un-debug Makefile 2006-06-13 19:02:21 -07:00
John Reiser 4fc0a32572 Do not brev() strings in stub for PackLinuxEl32armBe. 2006-06-13 18:55:26 -07:00
John Reiser dcc704a357 debug PackLinuxElf32armBe. Also unify subroutines. 2006-06-13 15:51:29 -07:00
John Reiser bd8acbde97 PackLinuxElf32armBe (Linux ARM big-endian) 2006-06-13 11:48:54 -07:00
John Reiser 112b10c19d avoid randomness for progid in Elf 2006-06-13 08:53:41 -07:00
John Reiser d89e561a85 PackLinuxElf32armLe, PackLinuxElf32armBe 2006-06-13 08:51:02 -07:00
John Reiser 49c1da79c8 PackLinuxElf32arm ==> PackLinuxElf32armLe 2006-06-13 08:27:14 -07:00
John Reiser 0a72f00175 Elf_BE32_* 2006-06-13 08:25:30 -07:00
John Reiser 1af5820db0 hack printf() 2006-06-13 08:24:38 -07:00
John Reiser c117491549 arm-9tdmi-linux-gnu-gcc is gcc-3.4.5-glibc-2.3.6; old was gcc-3.4.1-glibc-2.3.3 2006-06-12 11:05:52 -07:00
Markus F.X.J. Oberhumer d8748f4270 Introduced MemBuffer::getSizeForCompression(). 2006-06-12 13:18:55 +02:00
Markus F.X.J. Oberhumer c0ba6e13e4 Check for .hg directory when generating ChangeLog. 2006-06-11 13:05:57 +02:00
Markus F.X.J. Oberhumer c34daf1a35 Make code -Wshadow warning free. 2006-06-11 12:25:19 +02:00
Markus F.X.J. Oberhumer d461b53235 Renamed variable clen to c_len and ulen to u_len. 2006-06-11 12:13:37 +02:00
Markus F.X.J. Oberhumer c3ee14eb67 Introduced upx_compress_result_t. 2006-06-11 12:09:25 +02:00
Markus F.X.J. Oberhumer 869fb8e327 Merge. 2006-06-11 00:01:56 +02:00
John Reiser fbbc3024d6 Linux ARM cacheflush 2006-06-10 14:41:50 -07:00
Markus F.X.J. Oberhumer f1ba0c0aa7 More lzma stuff. 2006-06-09 18:36:53 +02:00
Markus F.X.J. Oberhumer 54340ab4bf Renamed environment variable UCLDIR to UPX_UCLDIR. 2006-06-09 15:22:42 +02:00
Markus F.X.J. Oberhumer 39732eee5e Merge. 2006-06-09 09:30:42 +02:00
Markus F.X.J. Oberhumer a9e4526a6d Rearranged compression interface. 2006-06-09 09:28:32 +02:00
John Reiser 57a6d2abf9 Merge 2006-06-08 20:51:59 -07:00
John Reiser d6246941ac fix f_unfilter 0x50 2006-06-08 20:48:43 -07:00
László Molnár 2eb91f9b91 do not assume osection[0].rawdataptr > 0 during decompression 2006-06-08 16:52:54 +02:00
Markus F.X.J. Oberhumer 34ae413607 Initial lzma support. 2006-06-07 04:42:15 +02:00
Markus F.X.J. Oberhumer ee9f8c184b Small updates. 2006-06-06 19:07:38 +02:00
Markus F.X.J. Oberhumer 7a84afcbdb Sort .hgtags. 2006-06-06 17:42:43 +02:00
Markus F.X.J. Oberhumer b8a16ea99d Merge. 2006-06-06 17:38:39 +02:00
Markus F.X.J. Oberhumer 095466d5c7 Added tag RELEASE_201 for changeset a916a2fe22de45167d25abcb40008315f415221c 2006-06-06 17:36:52 +02:00
Markus F.X.J. Oberhumer 89cfa22c3f Final cleanups for 2.01. 2006-06-06 17:36:34 +02:00
John Reiser 1f18050930 elf32arm escape hatch: avoid Elf32_Ehdr if possible 2006-06-02 08:51:02 -07:00
John Reiser 537b78d564 fix elf32arm unmapping hatch 2006-06-01 22:48:52 -07:00
John Reiser 717fd57ce1 remember b_info for Elf headers; also: escape hatch 2006-06-01 12:00:05 -07:00
John Reiser 3fb7786868 [re-]comment-out debugging 'int3' 2006-06-01 11:12:30 -07:00
John Reiser 17ecfc9765 new class PackLinuxElf32arm : PackLinuxElf32Le;
Unify some functions in leaf classes by moving to parent class.
2006-06-01 06:37:44 -07:00
John Reiser 5326260a76 new elf32arm; small effects in elf86, linux.hh 2006-06-01 06:32:33 -07:00
John Reiser e7522f4bdf branch merge 2006-05-24 13:59:43 -07:00
John Reiser 504deeff42 ET_DYN cannot be old format for decompression 2006-05-24 13:15:39 -07:00
Markus F.X.J. Oberhumer b7785b64cf Small cleanups to keep p_armpe & p_w32pe in sync. 2006-05-24 19:21:26 +02:00
László Molnár f914cb6858 pe: added support for empty resource section 2006-05-24 17:14:09 +02:00
John Reiser 91051d2521 Try to merge with mainline. 2006-05-23 17:52:05 -07:00
John Reiser 51536a7acd decompression PackLinuxElf32x86.ET_DYN 2006-05-23 17:42:35 -07:00
Markus F.X.J. Oberhumer 263ccab6e3 Updated NEWS for --brute bugfix. 2006-05-23 13:25:19 +02:00
John Reiser 9f87755dcb Note fix to --force-execve for PaX, grSecurity, strict SELinux. 2006-05-22 15:15:21 -07:00
John Reiser 60b4cca5e5 use powerpc-750-linux-gnu/gcc-3.4.3.20050210-glibc-2.2.5 2006-05-22 13:14:54 -07:00
John Reiser d2718e99a4 Change class PackLinuxI386elf : public PackLinuxI386
into   class PackLinuxElf32x86 : public PackLinuxElf32Le : public PackLinuxElf32
which makes the code for compressing ELF (for direct-to-memory decompression)
cleaner because ELF has some of the class tree to itself.
This assumes PROT_EXEC|PROT_WRITE ought to work.
This is checked at runtime, and if it fails then
give a message on stderr and exit(127).

Modify --force-execve so that runtime avoids PROT_EXEC|PROT_WRITE.
Then executables compressed with --force-execve will run under
PaX, grSecurity, and strict SELinux.
2006-05-21 13:58:24 -07:00
John Reiser 69a00c0ab3 *BSD requires -1==fd for MAP_ANONYMOUS
stub/l_lx_exec.c stub/l_lx_sh.c stub/l_lx_sh86.asm
2006-05-21 13:45:57 -07:00
Markus F.X.J. Oberhumer 3272d23917 Renamed variable hdr_clen to hdr_c_len. 2006-05-20 13:44:36 +02:00
Markus F.X.J. Oberhumer 7f0545cae7 Check result of hdr compression. 2006-05-20 13:37:34 +02:00
Markus F.X.J. Oberhumer 68f35deb86 Fixed a rare boundary problem in Packer::compressWithFilters().
The comparision if an update might be possible later was using
"<" instead of "<=" which resulted in missing calls to
findOverlapOverhead() and buildLoader().

Also, the comparision had not been updated for the newly added
hdr_clen fields.

This fixes sf.net bug #1477825.
2006-05-20 13:29:01 +02:00
Markus F.X.J. Oberhumer c4f4035072 Updated NEWS. 2006-05-18 19:01:03 +02:00
László Molnár a7d8845952 mention --keep-resource in NEWS and help.cpp 2006-05-18 15:54:35 +02:00
Markus F.X.J. Oberhumer a3378393b0 Removed scripts/. 2006-05-18 15:35:35 +02:00
László Molnár 3dfe0ad478 pe: fined grain control over resource compression 2006-05-18 15:20:37 +02:00
László Molnár 9a3b7a4f3f arm/pe: really fix the memory leak 2006-05-18 15:20:11 +02:00
László Molnár 78579b1103 pe: do not crash on out of bounds bogus relocation records 2006-05-18 15:19:55 +02:00
László Molnár 7d50344512 pe: fixed a memory leak in the resource handling code 2006-05-18 15:19:13 +02:00
László Molnár 7a00c12065 arm/pe: minor cleanup in the thumb mode stub 2006-05-18 15:18:50 +02:00
László Molnár af71e67681 arm/pe: saved 4 bytes in the arm mode stub 2006-05-18 15:18:36 +02:00
László Molnár b3e20fc324 arm/pe: no need to try to precompute the size of relocations 2006-05-18 15:18:13 +02:00
László Molnár bd1014abb6 dos/exe: saved some bytes in device driver mode 2006-05-18 15:17:53 +02:00
László Molnár 7f76664a5d Merged with mainline 2006-05-18 13:10:15 +02:00
Markus F.X.J. Oberhumer 0a5a80b05d Updated .hgignore. 2006-05-18 10:48:06 +02:00
Markus F.X.J. Oberhumer 2d63da0660 Support automatic ChangeLog generation. 2006-05-18 10:16:59 +02:00
Markus F.X.J. Oberhumer 8387527d2e Updated .hgignore. 2006-05-18 09:37:18 +02:00
Markus F.X.J. Oberhumer 5d03ba7d63 Added .hgignore. 2006-05-18 09:08:38 +02:00
Markus F.X.J. Oberhumer 0ece50c122 Removed .cvsignore and .gitignore files. 2006-05-18 09:02:00 +02:00
Markus F.X.J. Oberhumer f2ac297252 Updated tags. 2006-05-18 08:27:19 +02:00
László Molnár 0ca8ae17d4 updated my email address 2006-05-17 21:05:46 +02:00
convert-repo 88ca87cf9e update tags 2006-05-11 10:41:33 +00:00
László Molnár 0d69d228e4 arm/pe: no need to allocate extra memory in the import table
committer: ml1050 <ml1050> 1147090379 +0000
2006-05-08 12:12:59 +00:00
Markus F.X.J. Oberhumer a3afe95306 Updated NEWS.
committer: mfx <mfx> 1147081195 +0000
2006-05-08 09:39:55 +00:00
Markus F.X.J. Oberhumer 9fb4af8658 Updated Makefile.
committer: mfx <mfx> 1147081156 +0000
2006-05-08 09:39:16 +00:00
László Molnár 9bb6ba9311 dos/exe: device driver support added (thanks Michael Devore)
committer: ml1050 <ml1050> 1147078121 +0000
2006-05-08 08:48:41 +00:00
Markus F.X.J. Oberhumer faa42ba341 Updated the master Makefile
to be more friendly to people without the special stub build tools.

committer: mfx <mfx> 1146764116 +0000
2006-05-04 17:35:16 +00:00
László Molnár 596827a912 remove obsolete files: l_armpe.asm l_armpe.h l_armpe_c.c l_armpe_s.S
committer: ml1050 <ml1050> 1146763209 +0000
2006-05-04 17:20:09 +00:00
László Molnár 89b4292445 saved 2 bytes
committer: ml1050 <ml1050> 1146763076 +0000
2006-05-04 17:17:56 +00:00
László Molnár dd88737414 it works on wince now (only with dlls)
committer: ml1050 <ml1050> 1146763013 +0000
2006-05-04 17:16:53 +00:00
László Molnár 5456cfc304 arm/pe: use the new linker friendly stubs
two linkers: one for arm mode, one for thumb mode
the import address table is moved to the stubs area of compressed files
changed the alignment of some header fields
the command line option "--8086" can be used to force thumb mode on

committer: ml1050 <ml1050> 1146647520 +0000
2006-05-03 09:12:00 +00:00
László Molnár 1e66096ea7 arm/pe stubs: the import address table is moved to the stub
committer: ml1050 <ml1050> 1146646915 +0000
2006-05-03 09:01:55 +00:00
John Reiser 2b6ae3908c /usr/bin/dyld can be a "fat binary" [how stupid!]
m_mac_mach32.c fold_machppc32.S fold_machppc32.h

committer: jreiser <jreiser> 1146434013 +0000
2006-04-30 21:53:33 +00:00
László Molnár 1924612479 a small fix for the thumb stub
committer: ml1050 <ml1050> 1146224685 +0000
2006-04-28 11:44:45 +00:00
László Molnár 2af5bdeaab added some debugging code
committer: ml1050 <ml1050> 1146154452 +0000
2006-04-27 16:14:12 +00:00
László Molnár b28565b38d new files: l_armpea.h l_armpet.h
committer: ml1050 <ml1050> 1146154411 +0000
2006-04-27 16:13:31 +00:00
László Molnár fec602362b added new virtual function createLinker()
committer: ml1050 <ml1050> 1146153290 +0000
2006-04-27 15:54:50 +00:00
László Molnár 6753c5f45a trying to implement the user space loader on native wince
committer: ml1050 <ml1050> 1146152386 +0000
2006-04-27 15:39:46 +00:00
Markus F.X.J. Oberhumer 2f3c108d42 Next version will be 2.01.
committer: mfx <mfx> 1146140843 +0000
2006-04-27 12:27:23 +00:00
Markus F.X.J. Oberhumer ce6d99bdb4 More README updates.
committer: mfx <mfx> 1146086335 +0000
2006-04-26 21:18:55 +00:00
Markus F.X.J. Oberhumer 86d4125893 Updates.
committer: mfx <mfx> 1146086189 +0000
2006-04-26 21:16:29 +00:00
Markus F.X.J. Oberhumer 3a18f00379 Prepared 2.00 release notes.
committer: mfx <mfx> 1146085621 +0000
2006-04-26 21:07:01 +00:00
Markus F.X.J. Oberhumer e6274904a7 Rebuilt using i386-linux-ld-2.16.1 and i386-linux-objcopy-2.16.1.
committer: mfx <mfx> 1146079399 +0000
2006-04-26 19:23:19 +00:00
Markus F.X.J. Oberhumer 3677395444 Add version suffix to the binutils we use. Prefix all linux/386 tools
with i386-linux-.

committer: mfx <mfx> 1146079325 +0000
2006-04-26 19:22:05 +00:00
László Molnár 22ba35b3b5 new arm/pe assembly with UPX linker support
committer: ml1050 <ml1050> 1145955479 +0000
2006-04-25 08:57:59 +00:00
Markus F.X.J. Oberhumer 9c1ab9979b Split "$Id" strings so that CVS does not interfere. Explicitlty
use ".p2align" and ".balign" instead of ".align".

committer: mfx <mfx> 1145864788 +0000
2006-04-24 07:46:28 +00:00
John Reiser eaa463e1c9 Insert copyright notice (equivalent to ident_s.ash) into stub by hand
because buildLoader is not fully working yet
	l_lx_elf64amd.S l_lx_elfppc32.S l_mac_ppc32.S

committer: jreiser <jreiser> 1145825498 +0000
2006-04-23 20:51:38 +00:00
John Reiser 6984be48c3 build sync: compile using crosstool gcc-3.4.3.20050507-glibc-2.3.5
committer: jreiser <jreiser> 1145820281 +0000
2006-04-23 19:24:41 +00:00
John Reiser b739bd3d79 Work better with SELinux. We still require allow_execmem.
p_lx_elf.cpp
	stub/fold_elfppc32.h
	stub/l_lx_elfppc32.h
	stub/l_lx_elfppc32.S
	stub/m_lx_elfppc32.c

committer: jreiser <jreiser> 1145666524 +0000
2006-04-22 00:42:04 +00:00
John Reiser 23f3e4396c For elf64and and elfppc32: -fno-exceptions -fno-asynchronous-unwind-tables
committer: jreiser <jreiser> 1145666377 +0000
2006-04-22 00:39:37 +00:00
John Reiser c264750924 Adapt better to SELinux. We still need allow_execmem.
p_lx_elf.cpp
	stub/a_lx_elf64.c
	stub/l_lx_elf64amd.h
	stub/l_lx_elf64amd.lds
	stub/l_lx_elf64amd.S
	stub/fold_elf64amd.h

committer: jreiser <jreiser> 1145657332 +0000
2006-04-21 22:08:52 +00:00
John Reiser c155f0a5d5 Better fit with SELinux. Now requires only execmem, which Fedora Core 5
enables as default for non-confined [ordinary] executables.
	l_lx_elf.c
	l_lx_elf86.asm
	l_lx_elf86.h
	l_lx_elf86.lds
	fold_elf86.asm
	fold_elf86.h

committer: jreiser <jreiser> 1145634453 +0000
2006-04-21 15:47:33 +00:00
László Molnár 76734f086d added an arm/linux based loader/tester for arm/pe files
committer: ml1050 <ml1050> 1145605029 +0000
2006-04-21 07:37:09 +00:00
Markus F.X.J. Oberhumer 4f2d1172dd Added a note about --force-execve. Converted quoting from using
backticks to single-quotes.

committer: mfx <mfx> 1145444708 +0000
2006-04-19 11:05:08 +00:00
Markus F.X.J. Oberhumer 75caf4e297 Fix spelling in NEWS.
committer: mfx <mfx> 1145436378 +0000
2006-04-19 08:46:18 +00:00
Markus F.X.J. Oberhumer 509ab8261f Avoid code bloat in the official builds.
committer: mfx <mfx> 1145436321 +0000
2006-04-19 08:45:21 +00:00
Markus F.X.J. Oberhumer 1e05b40d4f Whitespace changes.
committer: mfx <mfx> 1145436164 +0000
2006-04-19 08:42:44 +00:00
Markus F.X.J. Oberhumer 451390f835 Updated NEWS.
committer: mfx <mfx> 1145435924 +0000
2006-04-19 08:38:44 +00:00
John Reiser 58cce9d2f8 Give message on stderr when SELinux enforcing mode inhibits execution.
l_lx_elf.c fold_elf86.asm fold_elf86.h

committer: jreiser <jreiser> 1145393418 +0000
2006-04-18 20:50:18 +00:00
László Molnár 2eb6e3b0ea arm/pe & w32/pe: disable filters for files with broken headers
committer: ml1050 <ml1050> 1145356307 +0000
2006-04-18 10:31:47 +00:00
John Reiser fb1181ed26 Allow executables >=3MB on elf64amd; -r1.69 on 2005-11-12 forgot to remove check.
committer: jreiser <jreiser> 1145139994 +0000
2006-04-15 22:26:34 +00:00
Markus F.X.J. Oberhumer 6d5e1d529d Updated NEWS.
committer: mfx <mfx> 1144968512 +0000
2006-04-13 22:48:32 +00:00
John Reiser 0e0ca08924 Propagate changes from linux.hh.
fold_elf86.h fold_pti86.h fold_sh86.h

committer: jreiser <jreiser> 1144967510 +0000
2006-04-13 22:31:50 +00:00
John Reiser 5d948a67a8 Propagate changes from linux.hh.
Also adjust calling segquence of upx_main() to shave a few bytes.
	l_lx_exec.c fold_exec86.asm fold_exec86.h

committer: jreiser <jreiser> 1144967447 +0000
2006-04-13 22:30:47 +00:00
John Reiser 6a4db2ecab Linux syscalls can clobber any input register, thanks to gcc and
the lack of a Linux kernel ABI.
	linux.hh

committer: jreiser <jreiser> 1144967342 +0000
2006-04-13 22:29:02 +00:00
Markus F.X.J. Oberhumer f700273624 Really bump the release date.
committer: mfx <mfx> 1144944628 +0000
2006-04-13 16:10:28 +00:00
Markus F.X.J. Oberhumer 0c198e0ccc Set tentative release date.
committer: mfx <mfx> 1144944070 +0000
2006-04-13 16:01:10 +00:00
Markus F.X.J. Oberhumer 71ffbbc420 Prepared 1.96 release.
committer: mfx <mfx> 1144943500 +0000
2006-04-13 15:51:40 +00:00
Markus F.X.J. Oberhumer 4fd09b889d Updated .cvsignore.
committer: mfx <mfx> 1144943334 +0000
2006-04-13 15:48:54 +00:00
László Molnár 4cb2a3eebe show image size change in info mode
committer: ml1050 <ml1050> 1144941392 +0000
2006-04-13 15:16:32 +00:00
László Molnár c25186b1f6 minor documentation updates
committer: ml1050 <ml1050> 1144941274 +0000
2006-04-13 15:14:34 +00:00
László Molnár 779033d0bc added filter (id: 0x50) support to the stub
the data cache is written back before the stub jumps to the uncompressed code

committer: ml1050 <ml1050> 1144931349 +0000
2006-04-13 12:29:09 +00:00
László Molnár 3e31560e7d added a new filter for ARM 24-bit naive calltrick
committer: ml1050 <ml1050> 1144931022 +0000
2006-04-13 12:23:42 +00:00
László Molnár d23d7e8775 removed unneeded entry point address check
committer: ml1050 <ml1050> 1144745835 +0000
2006-04-11 08:57:15 +00:00
László Molnár f6fdf5cb7f show image size change in info mode
committer: ml1050 <ml1050> 1144671675 +0000
2006-04-10 12:21:15 +00:00
Markus F.X.J. Oberhumer 1879ccd27d Next version will be 2.00.
committer: mfx <mfx> 1144586292 +0000
2006-04-09 12:38:12 +00:00
Markus F.X.J. Oberhumer 08c0796719 Avoid warnings when building for m68k.
committer: mfx <mfx> 1144523702 +0000
2006-04-08 19:15:02 +00:00
Markus F.X.J. Oberhumer edc7994ce5 Prepared 1.95 release.
committer: mfx <mfx> 1144522884 +0000
2006-04-08 19:01:24 +00:00
Markus F.X.J. Oberhumer bcfcfbd064 Added some more operators.
committer: mfx <mfx> 1144522838 +0000
2006-04-08 19:00:38 +00:00
Markus F.X.J. Oberhumer 9e79b3258d Make const-correct to avoid warning.
committer: mfx <mfx> 1144522792 +0000
2006-04-08 18:59:52 +00:00
John Reiser 243873cd2d Workaround inconsistent SIZEOF_HEADERS in stub/*.lds.
Test with --force-execve and --no-filter.
	p_lx_exc.cpp p_lx_sh.cpp stub/l_lx_sh86.asm stub/l_lx_sh86.h

committer: jreiser <jreiser> 1144381286 +0000
2006-04-07 03:41:26 +00:00
Markus F.X.J. Oberhumer c7b8a4b0c1 Updated.
committer: mfx <mfx> 1144320028 +0000
2006-04-06 10:40:28 +00:00
Markus F.X.J. Oberhumer e39e0c7140 Added .gitignore files.
committer: mfx <mfx> 1144319429 +0000
2006-04-06 10:30:29 +00:00
Markus F.X.J. Oberhumer d4a3f11dbb Whitespace changes.
committer: mfx <mfx> 1144318755 +0000
2006-04-06 10:19:15 +00:00
Markus F.X.J. Oberhumer 0962f266b3 Whitespace changes.
committer: mfx <mfx> 1144314053 +0000
2006-04-06 09:00:53 +00:00
Markus F.X.J. Oberhumer 69e4d3fdad Bumped tentative release date.
committer: mfx <mfx> 1144313563 +0000
2006-04-06 08:52:43 +00:00
Markus F.X.J. Oberhumer c0908f463a Added files to "clean" target.
committer: mfx <mfx> 1144313493 +0000
2006-04-06 08:51:33 +00:00
Markus F.X.J. Oberhumer b00a61a17b Updated.
committer: mfx <mfx> 1144313468 +0000
2006-04-06 08:51:08 +00:00
László Molnár 553c2f886a arm/pe: thumb mode dll support added
committer: ml1050 <ml1050> 1144312217 +0000
2006-04-06 08:30:17 +00:00
László Molnár 4fd9c5772a arm/pe:
v4 ARM mode stub support with assembly decompressor by John
dll support for v4 ARM mode
unpacking support

committer: ml1050 <ml1050> 1144249762 +0000
2006-04-05 15:09:22 +00:00
Markus F.X.J. Oberhumer 04e0e06d85 Whitespace changes.
committer: mfx <mfx> 1144235344 +0000
2006-04-05 11:09:04 +00:00
Markus F.X.J. Oberhumer 4d7829d72b New ACC version.
committer: mfx <mfx> 1144235271 +0000
2006-04-05 11:07:51 +00:00
John Reiser 6b751aac57 Fix return from THUMB to ARM mode on ARMv4T. Document r6 unused.
committer: jreiser <jreiser> 1143650112 +0000
2006-03-29 16:35:12 +00:00
László Molnár 813349fd23 arm/pe: support for nrv2b, support for cpu = 0x1c2, certificate info now removed
committer: ml1050 <ml1050> 1143614738 +0000
2006-03-29 06:45:38 +00:00
John Reiser 16a2744782 find_SEGMENT_gap() like find_LOAD_gap(). Use it to avoid checksum trouble.
p_mach.cpp p_mach.h

committer: jreiser <jreiser> 1143576015 +0000
2006-03-28 20:00:15 +00:00
John Reiser 7b6870db22 Fix bug: bad test for reaching back too far in SAFE mode. (Thank you, Laszlo.)
committer: jreiser <jreiser> 1143564998 +0000
2006-03-28 16:56:38 +00:00
Markus F.X.J. Oberhumer 3e38e7d52c Small cleanups.
committer: mfx <mfx> 1143474969 +0000
2006-03-27 15:56:09 +00:00
László Molnár 8142d3474d get_le32 reimplemented in assembly
committer: ml1050 <ml1050> 1143473260 +0000
2006-03-27 15:27:40 +00:00
Markus F.X.J. Oberhumer 8773649de6 Make code warning-free.
committer: mfx <mfx> 1143464312 +0000
2006-03-27 12:58:32 +00:00
Markus F.X.J. Oberhumer c117920ff9 Add -Wall -Werror to cross-compiler flags.
committer: mfx <mfx> 1143463128 +0000
2006-03-27 12:38:48 +00:00
László Molnár c8dd2a3eb8 arm/pe: use -march=armv4t instead of v5
committer: ml1050 <ml1050> 1143462067 +0000
2006-03-27 12:21:07 +00:00
Markus F.X.J. Oberhumer 90b1817e92 Undef PAGE_{MASK,SIZE} in conf.h.
committer: mfx <mfx> 1143454717 +0000
2006-03-27 10:18:37 +00:00
Markus F.X.J. Oberhumer d6c3ff5997 Cleanups.
committer: mfx <mfx> 1143454663 +0000
2006-03-27 10:17:43 +00:00
László Molnár 984ec25132 arm/pe: the assembly thumb mode decompressor is used in the stub
arm/pe: the C part of the stub is compiled as thumb

committer: ml1050 <ml1050> 1143449862 +0000
2006-03-27 08:57:42 +00:00
John Reiser a7bff34784 Fix THUMB mode return to ARM mode on ARMv4T. Spend 18 bytes to inline
most of get1b via conditional subroutine call idiom.

committer: jreiser <jreiser> 1143302120 +0000
2006-03-25 15:55:20 +00:00
John Reiser a6e7afbc91 Fix bug: first 'add' instead of 'adc' at get1_n2b. (Thank you, Laszlo.)
committer: jreiser <jreiser> 1143228535 +0000
2006-03-24 19:28:55 +00:00
John Reiser 33f1d63b64 Fix bug: first 'add' at get1_n2e instead of 'adc'.
Also conditionally assemble SAFE mode for buffer checking (default off).

committer: jreiser <jreiser> 1143228361 +0000
2006-03-24 19:26:01 +00:00
John Reiser f95e171e11 Workaround linux-2.6.14 binfmt_elf.c: SIGKILL if (0==.p_memsz) on a page boundary.
p_lx_elf.cpp p_lx_exc.cpp

committer: jreiser <jreiser> 1143057770 +0000
2006-03-22 20:02:50 +00:00
Markus F.X.J. Oberhumer c82b50b212 Bumped tentative release date.
committer: mfx <mfx> 1142610024 +0000
2006-03-17 15:40:24 +00:00
Markus F.X.J. Oberhumer 2b402b77f1 Updated short-list of supported executable formats.
committer: mfx <mfx> 1142609852 +0000
2006-03-17 15:37:32 +00:00
Markus F.X.J. Oberhumer adcb551020 Increase alignment to 16.
committer: mfx <mfx> 1142608657 +0000
2006-03-17 15:17:37 +00:00
Markus F.X.J. Oberhumer 2680aabe06 Removed bogus __attribute_packed from struct udll.
committer: mfx <mfx> 1142607440 +0000
2006-03-17 14:57:20 +00:00
Markus F.X.J. Oberhumer d5c0533b74 Allow the PE sections to cross a page boundary.
committer: mfx <mfx> 1142603590 +0000
2006-03-17 13:53:10 +00:00
Markus F.X.J. Oberhumer 609307668b Use $(MAKEFILE_LIST) for dependencies.
committer: mfx <mfx> 1142527291 +0000
2006-03-16 16:41:31 +00:00
Markus F.X.J. Oberhumer cdaf36572a Use UPX_VERSION_DATE_ISO from src/version.h.
committer: mfx <mfx> 1142527194 +0000
2006-03-16 16:39:54 +00:00
Markus F.X.J. Oberhumer 033c8d5d51 Updated.
committer: mfx <mfx> 1142523608 +0000
2006-03-16 15:40:08 +00:00
Markus F.X.J. Oberhumer 6216ec1d6a Mention John as a main author.
committer: mfx <mfx> 1142522272 +0000
2006-03-16 15:17:52 +00:00
László Molnár 6c9c67f6c5 DEP hack: it seems we need to patch the flags of section "UPX1" too
committer: ml1050 <ml1050> 1142508181 +0000
2006-03-16 11:23:01 +00:00
Markus F.X.J. Oberhumer 5bd32b5521 Commented out "int3" debugging leftovers.
committer: mfx <mfx> 1142312678 +0000
2006-03-14 05:04:38 +00:00
Markus F.X.J. Oberhumer 549336f75b Use boolean instead of bitwise logic.
committer: mfx <mfx> 1142311485 +0000
2006-03-14 04:44:45 +00:00
Markus F.X.J. Oberhumer f0e75f30b3 Fixed typo in comment.
committer: mfx <mfx> 1142310885 +0000
2006-03-14 04:34:45 +00:00
Markus F.X.J. Oberhumer 144c09f175 Rebuilt i386-linux stubs by gcc-3.4.6.
committer: mfx <mfx> 1142310823 +0000
2006-03-14 04:33:43 +00:00
Markus F.X.J. Oberhumer ee50c0f97c Corrected app_*.pl dependency.
committer: mfx <mfx> 1142309988 +0000
2006-03-14 04:19:48 +00:00
John Reiser ade921bf02 %.asy and %.asx depend onf $(APP_I386)
committer: jreiser <jreiser> 1142306625 +0000
2006-03-14 03:23:45 +00:00
John Reiser 676cacff04 gcc-4.1.0 vs. mmap()
linux.hh
	fold_elf86.asm  l_lx_elf.c
	fold_exec86.asm l_lx_exec.c
	fold_pti86.asm  l_lx_pti.c
	fold_sh86.asm   l_lx_sh.c    l_lx_sh86.asm
	l_lx_sep.c

committer: jreiser <jreiser> 1142305438 +0000
2006-03-14 03:03:58 +00:00
Markus F.X.J. Oberhumer a3097d5e25 Added a dependency.
committer: mfx <mfx> 1142303569 +0000
2006-03-14 02:32:49 +00:00
Markus F.X.J. Oberhumer fd78148558 Fixed typo in disabled code.
committer: mfx <mfx> 1142302679 +0000
2006-03-14 02:17:59 +00:00
Markus F.X.J. Oberhumer a4d79d7375 Small cosmetic changes.
committer: mfx <mfx> 1142302586 +0000
2006-03-14 02:16:26 +00:00
Markus F.X.J. Oberhumer df04e8183d Filter parameters should be called "ft" instead of "fp".
committer: mfx <mfx> 1142301730 +0000
2006-03-14 02:02:10 +00:00
Markus F.X.J. Oberhumer c43c484a62 Re-synced both files a little bit.
committer: mfx <mfx> 1142301586 +0000
2006-03-14 01:59:46 +00:00
Markus F.X.J. Oberhumer 0608c35669 Added some more OBJSTRIP. Small cleanups.
committer: mfx <mfx> 1142298790 +0000
2006-03-14 01:13:10 +00:00
Markus F.X.J. Oberhumer 7dd4d06e26 Added some more calls to $(OBJSTRIP_LINUX_I386) after $(NASM) invocations.
committer: mfx <mfx> 1142288478 +0000
2006-03-13 22:21:18 +00:00
John Reiser 1ee0310b86 silence complaint from ld "cannot find entry symbol _start; defaulting to 10000000"
committer: jreiser <jreiser> 1142285749 +0000
2006-03-13 21:35:49 +00:00
Markus F.X.J. Oberhumer cc0a52038f Rebuilt i386-linux stubs with gcc-4.1.0 for small size decrease.
committer: mfx <mfx> 1142248018 +0000
2006-03-13 11:06:58 +00:00
Markus F.X.J. Oberhumer 6aed1fe231 Updated.
committer: mfx <mfx> 1142247976 +0000
2006-03-13 11:06:16 +00:00
Markus F.X.J. Oberhumer 680608fe18 Portability fix.
committer: mfx <mfx> 1142247872 +0000
2006-03-13 11:04:32 +00:00
Markus F.X.J. Oberhumer ec6acbc602 Small fix to make valid ANSI C again.
committer: mfx <mfx> 1142247837 +0000
2006-03-13 11:03:57 +00:00
John Reiser cb7ee4c5d2 _syscall1nr() for _exit; [still wastes 4 bytes]
committer: jreiser <jreiser> 1142210712 +0000
2006-03-13 00:45:12 +00:00
Markus F.X.J. Oberhumer 88d5798f45 Bumped versions for starting 1.95 development.
committer: mfx <mfx> 1142090576 +0000
2006-03-11 15:22:56 +00:00
Markus F.X.J. Oberhumer fcc22a0aa3 Added UPX_VERSION_DATE_ISO.
committer: mfx <mfx> 1142085195 +0000
2006-03-11 13:53:15 +00:00
Markus F.X.J. Oberhumer aabefff298 Prepared for release 1.94.
committer: mfx <mfx> 1142081862 +0000
2006-03-11 12:57:42 +00:00
Markus F.X.J. Oberhumer ed25c64e97 Updated.
committer: mfx <mfx> 1142081797 +0000
2006-03-11 12:56:37 +00:00
Markus F.X.J. Oberhumer b7dc870c2d Centered strings.
committer: mfx <mfx> 1142081776 +0000
2006-03-11 12:56:16 +00:00
Markus F.X.J. Oberhumer 9bea608843 Don't suppress errors with -qq.
committer: mfx <mfx> 1142081041 +0000
2006-03-11 12:44:01 +00:00
Markus F.X.J. Oberhumer 9db1732c36 Added a note that we should upgrade to gcc-4.1.0 on i386-linux.
committer: mfx <mfx> 1142074774 +0000
2006-03-11 10:59:34 +00:00
Markus F.X.J. Oberhumer 39f1a70174 Small update.
committer: mfx <mfx> 1142036155 +0000
2006-03-11 00:15:55 +00:00
Markus F.X.J. Oberhumer 1810440355 Added __attribute__((__sentinel__)) to Packer::addLoader(). This is
a new gcc-4.1 feature.

committer: mfx <mfx> 1142035833 +0000
2006-03-11 00:10:33 +00:00
Markus F.X.J. Oberhumer 37ac8f179e New ACC version.
committer: mfx <mfx> 1142035385 +0000
2006-03-11 00:03:05 +00:00
Markus F.X.J. Oberhumer 626a09328f Updated.
committer: mfx <mfx> 1141807336 +0000
2006-03-08 08:42:16 +00:00
Markus F.X.J. Oberhumer 8d489d0d77 New ACC version.
committer: mfx <mfx> 1141798968 +0000
2006-03-08 06:22:48 +00:00
Markus F.X.J. Oberhumer 776f3db0d7 Detabified.
committer: mfx <mfx> 1141795978 +0000
2006-03-08 05:32:58 +00:00
John Reiser 6046057b88 Commentary on SELinux and UPX.
committer: jreiser <jreiser> 1141686040 +0000
2006-03-06 23:00:40 +00:00
Markus F.X.J. Oberhumer 7e85d9e549 Updated.
committer: mfx <mfx> 1141679044 +0000
2006-03-06 21:04:04 +00:00
Markus F.X.J. Oberhumer 01c8a8b1c2 Disabled an expensive run-time assertion.
committer: mfx <mfx> 1141642878 +0000
2006-03-06 11:01:18 +00:00
Markus F.X.J. Oberhumer c9bf6ac9ae No need to preserve eax in clearstack.
committer: mfx <mfx> 1141642647 +0000
2006-03-06 10:57:27 +00:00
John Reiser 62e4d69be9 re-compile from changed m_lx_elfppc32.c
committer: jreiser <jreiser> 1141605710 +0000
2006-03-06 00:41:50 +00:00
John Reiser 62ac733b09 simplify and save a few bytes
committer: jreiser <jreiser> 1141488398 +0000
2006-03-04 16:06:38 +00:00
John Reiser c3b3e1b1b9 MAP_DENYWRITE
committer: jreiser <jreiser> 1141484579 +0000
2006-03-04 15:02:59 +00:00
John Reiser a791e96e00 Fix do_xmap() to work under SElinux. Also trim unneeded code.
committer: jreiser <jreiser> 1141413353 +0000
2006-03-03 19:15:53 +00:00
John Reiser e87f5521c1 conditionally compile debugging printf
committer: jreiser <jreiser> 1141365595 +0000
2006-03-03 05:59:55 +00:00
John Reiser 366a708f3a Generalize to more than 2 PT_LOAD using find_LOAD_gap; needed for linux/ElfAMD.
Also simplifies, and applies to both ::pack and ::unpack.
	p_lx_elf.cpp p_lx_elf.h

committer: jreiser <jreiser> 1141348876 +0000
2006-03-03 01:21:16 +00:00
John Reiser 70ba662574 Avoid overwrite of obuf when hdr_buf and non-first method.
committer: jreiser <jreiser> 1141327368 +0000
2006-03-02 19:22:48 +00:00
John Reiser b389abd99f PackLinuxElf64amd::getCompressionMethods allows both nrv2b and nrv2e
committer: jreiser <jreiser> 1141326792 +0000
2006-03-02 19:13:12 +00:00
John Reiser 4aa2d14fe3 acknowledge unused results to avoid compiler warnings treated as errors
committer: jreiser <jreiser> 1141326721 +0000
2006-03-02 19:12:01 +00:00
John Reiser af7de75ad4 Allow unfilter when verifyOverlappingDecompression, for convenience
in end-to-end checksum.
	packer.h packer.cpp p_unix.cpp

committer: jreiser <jreiser> 1141252960 +0000
2006-03-01 22:42:40 +00:00
John Reiser d461ebbda1 fix packExtent checksums and lengths (of uncompressed data) for 0!=hdr_ulen
committer: jreiser <jreiser> 1141241763 +0000
2006-03-01 19:36:03 +00:00
John Reiser 55ef94abcd 8-bit decompressors for ARM; minimize space aggressively
arm_nrv2b_d8.S arm_nrv2e_d8.S

committer: jreiser <jreiser> 1140993873 +0000
2006-02-26 22:44:33 +00:00
John Reiser afaf489d99 save space aggressively
committer: jreiser <jreiser> 1140713717 +0000
2006-02-23 16:55:17 +00:00
John Reiser 20e4cbfd13 passes first tests! Only untested feature: large offset which forces
minimum match length to be >=3.
	arm_nrv2b_d32.S arm_nrv2e_d32.S

committer: jreiser <jreiser> 1140677145 +0000
2006-02-23 06:45:45 +00:00
John Reiser f3b8c9f34e debugging
committer: jreiser <jreiser> 1140634679 +0000
2006-02-22 18:57:59 +00:00
John Reiser 45e8ff25a5 hand-tuned decompressors for 32-bit NRV on ARM
arm_nrv2b_d32.S arm_nrv2e_d32.S

committer: jreiser <jreiser> 1140535945 +0000
2006-02-21 15:32:25 +00:00
John Reiser 268e322e1c Extra parameter for compressWithFilters and packExtent,
to fix 2-pass problem with --brute on linux/elf386.
Only one decompression method is allowed, chosen by
smallest output for .text; but Elf headers come first.
	packer.cpp packer.h p_unix.cpp p_unix.h p_lx_elf.cpp

committer: jreiser <jreiser> 1140241030 +0000
2006-02-18 05:37:10 +00:00
Markus F.X.J. Oberhumer d3bcba6a05 Removed "volatile" from global var "opt" - this was only needed
a long time ago to work around problems with ancient C++ compilers.

committer: mfx <mfx> 1140002094 +0000
2006-02-15 11:14:54 +00:00
Markus F.X.J. Oberhumer cc4ef1944d Make sure we only touch exactly one page. Update comments.
committer: mfx <mfx> 1139928961 +0000
2006-02-14 14:56:01 +00:00
Markus F.X.J. Oberhumer 5aa8486265 Prefer restoring the original protection flags.
committer: mfx <mfx> 1139928517 +0000
2006-02-14 14:48:37 +00:00
László Molnár fd181673cd a little more comments on the DEP hack stuff
committer: ml1050 <ml1050> 1139927444 +0000
2006-02-14 14:30:44 +00:00
László Molnár 62c9547c4e added some comments on the DEP hack stuff
committer: ml1050 <ml1050> 1139918135 +0000
2006-02-14 11:55:35 +00:00
Markus F.X.J. Oberhumer cdd117bfb9 Rearranged debug options.
committer: mfx <mfx> 1139916141 +0000
2006-02-14 11:22:21 +00:00
Markus F.X.J. Oberhumer 304ba57dad Clear the dirty stack on win32/pe.
committer: mfx <mfx> 1139914965 +0000
2006-02-14 11:02:45 +00:00
Markus F.X.J. Oberhumer 69eaaa4177 Revert previous checkin.
committer: mfx <mfx> 1139914479 +0000
2006-02-14 10:54:39 +00:00
Markus F.X.J. Oberhumer 452ac52fcb Added an overloaded addLoader() method.
committer: mfx <mfx> 1139913550 +0000
2006-02-14 10:39:10 +00:00
Markus F.X.J. Oberhumer 40cf489290 Avoid possibly clobbering edx.
committer: mfx <mfx> 1139881592 +0000
2006-02-14 01:46:32 +00:00
Markus F.X.J. Oberhumer 891d6be4a6 Removed options_t::win32_pe::strip_loadconf.
For compatibility reasons the option is still accepted (but
ignored) during commandline parsing.

committer: mfx <mfx> 1139866279 +0000
2006-02-13 21:31:19 +00:00
Markus F.X.J. Oberhumer 5d45ce5cf7 Removed an already fixed item.
committer: mfx <mfx> 1139864523 +0000
2006-02-13 21:02:03 +00:00
Markus F.X.J. Oberhumer a0f2241f3a Added comment.
committer: mfx <mfx> 1139862668 +0000
2006-02-13 20:31:08 +00:00
Markus F.X.J. Oberhumer aa513bf7d3 Quick fix for the Win32 startup crash. Needs more testing.
committer: mfx <mfx> 1139861398 +0000
2006-02-13 20:09:58 +00:00
Markus F.X.J. Oberhumer b2d65febc8 Small update.
committer: mfx <mfx> 1139843847 +0000
2006-02-13 15:17:27 +00:00
Markus F.X.J. Oberhumer 23a6d326e8 Bump tentative release date. Update READMEs.
committer: mfx <mfx> 1139840129 +0000
2006-02-13 14:15:29 +00:00
Markus F.X.J. Oberhumer 5b2f1b6d8b Introduced UPX_VERSION_YEAR.
committer: mfx <mfx> 1139826163 +0000
2006-02-13 10:22:43 +00:00
Markus F.X.J. Oberhumer b4e9ad031b Break strings so that CVS does not try to expand keywords.
committer: mfx <mfx> 1139786765 +0000
2006-02-12 23:26:05 +00:00
Markus F.X.J. Oberhumer 8b7ebcf040 Enter 2006.
committer: mfx <mfx> 1139778883 +0000
2006-02-12 21:14:43 +00:00
Markus F.X.J. Oberhumer af05296631 Made ps1/exe work again.
committer: mfx <mfx> 1139776798 +0000
2006-02-12 20:39:58 +00:00
Markus F.X.J. Oberhumer 29d693de2d New ACC version.
committer: mfx <mfx> 1139772863 +0000
2006-02-12 19:34:23 +00:00
Markus F.X.J. Oberhumer 51ac5172f5 #undef PAGE_{MASK,SIZE} to fix build problems on some machines.
committer: mfx <mfx> 1139743226 +0000
2006-02-12 11:20:26 +00:00
Markus F.X.J. Oberhumer 24ce1ef5e7 Enter 2006.
committer: mfx <mfx> 1139742400 +0000
2006-02-12 11:06:40 +00:00
Markus F.X.J. Oberhumer f6d1e269d1 Prepare for new release.
committer: mfx <mfx> 1139742224 +0000
2006-02-12 11:03:44 +00:00
Markus F.X.J. Oberhumer 62c2f5228d Rebuilt stubs.
committer: mfx <mfx> 1139742130 +0000
2006-02-12 11:02:10 +00:00
Markus F.X.J. Oberhumer 9882d9683b Updated.
committer: mfx <mfx> 1139741935 +0000
2006-02-12 10:58:55 +00:00
Markus F.X.J. Oberhumer 45ce89ee1f Removed trailing whitespace.
committer: mfx <mfx> 1139741919 +0000
2006-02-12 10:58:39 +00:00
László Molnár bfb9df1553 win32/pe: R6002 runtime errors worked around
committer: ml1050 <ml1050> 1139505685 +0000
2006-02-09 17:21:25 +00:00
László Molnár a5f79204ce set use_dep_hack to true
committer: ml1050 <ml1050> 1139404812 +0000
2006-02-08 13:20:12 +00:00
László Molnár e322613d84 workaround added for a msvc runtime "protection"
committer: ml1050 <ml1050> 1139393823 +0000
2006-02-08 10:17:03 +00:00
Markus F.X.J. Oberhumer fbb60f5191 Refactored a new mem_replace() function.
committer: mfx <mfx> 1138984802 +0000
2006-02-03 16:40:02 +00:00
Markus F.X.J. Oberhumer 899e7d2f39 Added internal debugging options '--fake-stub-version=X.XX' and
'--fake-stub-year=XXXX'.

These might prove useful for building up a test suite which is able to
check binary identity of compressed executables between UPX releases
where the implementation of a specific format has not changed.

committer: mfx <mfx> 1138960010 +0000
2006-02-03 09:46:50 +00:00
László Molnár 8e2aa07747 load config support for win32/pe dlls
committer: ml1050 <ml1050> 1138878465 +0000
2006-02-02 11:07:45 +00:00
Markus F.X.J. Oberhumer a0d262cd76 New ACC version.
committer: mfx <mfx> 1138683583 +0000
2006-01-31 04:59:43 +00:00
Markus F.X.J. Oberhumer b43a7edee4 Preliminary bump some version information.
committer: mfx <mfx> 1138080865 +0000
2006-01-24 05:34:25 +00:00
Markus F.X.J. Oberhumer 7760bbd77c New ACC version.
committer: mfx <mfx> 1138080385 +0000
2006-01-24 05:26:25 +00:00
Markus F.X.J. Oberhumer 9c0f1b02a7 Small Makefile updates.
committer: mfx <mfx> 1138080320 +0000
2006-01-24 05:25:20 +00:00
Markus F.X.J. Oberhumer 4ecfff4d8d Print a #define for the _SIZE. Enter 2006. Add John's name.
committer: mfx <mfx> 1138080110 +0000
2006-01-24 05:21:50 +00:00
László Molnár ac03b89f38 docs updates for 1.94
committer: ml1050 <ml1050> 1137999714 +0000
2006-01-23 07:01:54 +00:00
László Molnár 620174aea9 copyright text added
committer: ml1050 <ml1050> 1137999649 +0000
2006-01-23 07:00:49 +00:00
Markus F.X.J. Oberhumer ab50d28bc4 New ACC version.
committer: mfx <mfx> 1134926345 +0000
2005-12-18 17:19:05 +00:00
Markus F.X.J. Oberhumer b5318602d1 Fixed compilation problem.
committer: mfx <mfx> 1134926052 +0000
2005-12-18 17:14:12 +00:00
John Reiser bff2a63ea2 prefetching does not help length of match
l_lx_elf64amd.S amd_d_nrv2b.S amd_d_nrv2e.S

committer: jreiser <jreiser> 1132290120 +0000
2005-11-18 05:02:00 +00:00
László Molnár aacfb8820e better load_conf directory support. still needs some work.
committer: ml1050 <ml1050> 1132077577 +0000
2005-11-15 17:59:37 +00:00
John Reiser 98e8c031d0 generated header files
fold_elf64amd.h l_lx_elf64amd.h

committer: jreiser <jreiser> 1131994505 +0000
2005-11-14 18:55:05 +00:00
John Reiser beb4319d1e tune for better branch prediction by avoiding more than 3 in a 16-byte block
amd_d_nrv2b.S amd_d_nrv2e.S l_lx_elf64amd.S

committer: jreiser <jreiser> 1131994471 +0000
2005-11-14 18:54:31 +00:00
John Reiser 2558243c83 de-tabify; also speculate 1-byte loads to save a cycle or two
amd_d_nrv2b.S amd_d_nrv2e.S l_lx_elf64amd.S

committer: jreiser <jreiser> 1131943590 +0000
2005-11-14 04:46:30 +00:00
John Reiser b670e8d1ac tuning
amd_bxx.S amd_d_nrv2b.S amd_d_nrv2e.S l_lx_elf64amd.S

committer: jreiser <jreiser> 1131939243 +0000
2005-11-14 03:34:03 +00:00
John Reiser 68f8358f06 tune: avoid MOVSB for literals; inline default case of NEXTB macros
committer: jreiser <jreiser> 1131923823 +0000
2005-11-13 23:17:03 +00:00
John Reiser db5a099097 CLD and documentation
amd_d_nrv2e.S l_lx_elf64amd.S fold_elf64amd.S

committer: jreiser <jreiser> 1131854052 +0000
2005-11-13 03:54:12 +00:00
John Reiser ce33ffb62a handle compressed executables larger than 3MB on Elf64amd
committer: jreiser <jreiser> 1131833508 +0000
2005-11-12 22:11:48 +00:00
John Reiser 59a2fb9cfd recompile generated .h after source changes
fold_elf64amd.h l_lx_elf64amd.h

committer: jreiser <jreiser> 1131824699 +0000
2005-11-12 19:44:59 +00:00
John Reiser 75bba319de tuning, and prepare for large executables (>3MB compressed)
p_lx_elf.cpp stub/a_lx_elf64.c stub/amd_d_nrv2e.S
	stub/fold_elf64amd.S stub/l_lx_elf64amd.S

committer: jreiser <jreiser> 1131824655 +0000
2005-11-12 19:44:15 +00:00
John Reiser f78e9261f3 Do initLoader() properly, instead of relying on the amount of stack space
that is in use when ::buildLinuxLoader is called.

committer: jreiser <jreiser> 1131597922 +0000
2005-11-10 04:45:22 +00:00
Markus F.X.J. Oberhumer 5f77562333 Cleanup.
committer: mfx <mfx> 1131596991 +0000
2005-11-10 04:29:51 +00:00
Markus F.X.J. Oberhumer 5c4f01a68d New ACC version.
committer: mfx <mfx> 1131596966 +0000
2005-11-10 04:29:26 +00:00
Markus F.X.J. Oberhumer 35f6f998e6 Avoid warnings. Detabified.
committer: mfx <mfx> 1131593815 +0000
2005-11-10 03:36:55 +00:00
John Reiser 6737a3ae09 PackLinuxElf64amd
p_lx_elf.h p_lx_elf.cpp packmast.cpp

committer: jreiser <jreiser> 1131570778 +0000
2005-11-09 21:12:58 +00:00
John Reiser 09559bee8c Elf64
p_unix.h p_elf.h

committer: jreiser <jreiser> 1131570530 +0000
2005-11-09 21:08:50 +00:00
John Reiser f487ea27a8 UPX_F_LINUX_ELF64_AMD
committer: jreiser <jreiser> 1131568333 +0000
2005-11-09 20:32:13 +00:00
John Reiser a3d95f239a Generated .h header files for AMD x86_64
fold_elf64amd.h l_lx_elf64amd.h

committer: jreiser <jreiser> 1131566912 +0000
2005-11-09 20:08:32 +00:00
John Reiser 023c06e178 Support for 64-bit AMD x86_64
Makefile
Added Files:
	a_lx_elf64.c amd_bxx.S amd_d_nrv2e.S amd_regs.h
	fold_elf64amd.S l_lx_elf64amd.S l_lx_elf64amd.lds

committer: jreiser <jreiser> 1131566835 +0000
2005-11-09 20:07:15 +00:00
John Reiser 414a6c1c9e Enhance to handle both Elf32 and Elf64, and little/big endian.
http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/sstrip/sstrip.c
Revision 11028 [Added Tue Aug 2 18:20:34 2005 PDT (3 months, 1 week ago) by mjn3]

committer: jreiser <jreiser> 1131566192 +0000
2005-11-09 19:56:32 +00:00
John Reiser 910e18fb22 b_method 5th argument to f_decompress
l_lx_exec.c l_lx_pti.c l_lx_sep.c l_lx_sh.c

committer: jreiser <jreiser> 1131565060 +0000
2005-11-09 19:37:40 +00:00
John Reiser ac441fd1cf definitions for Elf64_*
committer: jreiser <jreiser> 1131564732 +0000
2005-11-09 19:32:12 +00:00
John Reiser 0c328372b5 Allow __uClibc_main and __uClibc_start_main like __libc_start_main.
committer: jreiser <jreiser> 1127269046 +0000
2005-09-21 02:17:26 +00:00
Markus F.X.J. Oberhumer 55ef60a6d4 Rebuilt with gcc-3.4.4.
committer: mfx <mfx> 1127188101 +0000
2005-09-20 03:48:21 +00:00
Markus F.X.J. Oberhumer c33584e683 Detabified.
committer: mfx <mfx> 1126929315 +0000
2005-09-17 03:55:15 +00:00
Markus F.X.J. Oberhumer ee8c7453bd Small updates.
committer: mfx <mfx> 1126927283 +0000
2005-09-17 03:21:23 +00:00
John Reiser 0330369603 remove debugging strut
l_lx_elf86.asm l_lx_elf86.h

committer: jreiser <jreiser> 1126892616 +0000
2005-09-16 17:43:36 +00:00
John Reiser 3f7b642c7d Linux i386 allow compression of position-independent main executables (gcc -pie).
p_elf.h p_lx_elf.cpp p_lx_elf.h p_lx_exc.cpp
	stub/fold_elf86.asm stub/fold_elf86.h stub/l_lx_elf.c
	stub/l_lx_elf86.asm stub/l_lx_elf86.h stub/l_lx_elf86.lds
	stub/linux.hh

committer: jreiser <jreiser> 1126886896 +0000
2005-09-16 16:08:16 +00:00
László Molnár eb6c51426a fixed a nasty relocation handling error which could produce broken
compressed files

committer: ml1050 <ml1050> 1126865811 +0000
2005-09-16 10:16:51 +00:00
Markus F.X.J. Oberhumer 0337bdb9fd Added support for UCL_USE_ASM.
committer: mfx <mfx> 1126844111 +0000
2005-09-16 04:15:11 +00:00
Markus F.X.J. Oberhumer 7aedc62058 Removed some old and dead code.
committer: mfx <mfx> 1126744217 +0000
2005-09-15 00:30:17 +00:00
Markus F.X.J. Oberhumer bfc835cbbf Added some more tests to upx_sanity_check(). Disable these for production
builds - code bloat.

committer: mfx <mfx> 1126743964 +0000
2005-09-15 00:26:04 +00:00
Markus F.X.J. Oberhumer 5c6ba30c48 New ACC version.
committer: mfx <mfx> 1126741199 +0000
2005-09-14 23:39:59 +00:00
Markus F.X.J. Oberhumer 8fe4824ed2 Fix typo.
committer: mfx <mfx> 1126295791 +0000
2005-09-09 19:56:31 +00:00
Markus F.X.J. Oberhumer d40cb3bd55 Cosmetic cleanups.
committer: mfx <mfx> 1126295335 +0000
2005-09-09 19:48:55 +00:00
Markus F.X.J. Oberhumer 4bcd3ac5d7 Mention arm/pe.
committer: mfx <mfx> 1126294945 +0000
2005-09-09 19:42:25 +00:00
Markus F.X.J. Oberhumer e2b8e9dea9 Avoid some warnings about unused args.
committer: mfx <mfx> 1126294727 +0000
2005-09-09 19:38:47 +00:00
László Molnár 572314bf3f support for arm/WinCE ("arm/pe") exes
committer: ml1050 <ml1050> 1126255781 +0000
2005-09-09 08:49:41 +00:00
Markus F.X.J. Oberhumer 14d303d331 Small updates according to latest glibc headers.
committer: mfx <mfx> 1126184484 +0000
2005-09-08 13:01:24 +00:00
Markus F.X.J. Oberhumer 24ffaa0738 Added BE64 and LE64 types.
committer: mfx <mfx> 1126183138 +0000
2005-09-08 12:38:58 +00:00
Markus F.X.J. Oberhumer 5d9b6d056d Small updates.
committer: mfx <mfx> 1126029328 +0000
2005-09-06 17:55:28 +00:00
Markus F.X.J. Oberhumer 5c28ff15ba Changes for new ACC version.
committer: mfx <mfx> 1126029282 +0000
2005-09-06 17:54:42 +00:00
Markus F.X.J. Oberhumer 06ceb2f2a1 New ACC version.
committer: mfx <mfx> 1126029264 +0000
2005-09-06 17:54:24 +00:00
Markus F.X.J. Oberhumer 7373e1dd8b Updated.
committer: mfx <mfx> 1122416155 +0000
2005-07-26 22:15:55 +00:00
Markus F.X.J. Oberhumer 4b1a9e714d New ACC version.
committer: mfx <mfx> 1122416002 +0000
2005-07-26 22:13:22 +00:00
Markus F.X.J. Oberhumer 9d76136358 Use gcc-3.4.4 for Linux stubs.
committer: mfx <mfx> 1122415958 +0000
2005-07-26 22:12:38 +00:00
Markus F.X.J. Oberhumer b3502420ad Removed patches/patch-elfcode.h and the patches/ directory - these
fixes now are already in upstream binutils for quite some time.

committer: mfx <mfx> 1119797919 +0000
2005-06-26 14:58:39 +00:00
Markus F.X.J. Oberhumer dd7ac7cca9 Updated.
committer: mfx <mfx> 1119614331 +0000
2005-06-24 11:58:51 +00:00
Markus F.X.J. Oberhumer 31dfa18e9b Updated.
committer: mfx <mfx> 1119613913 +0000
2005-06-24 11:51:53 +00:00
Markus F.X.J. Oberhumer 3e785008d3 Avoid warnings.
committer: mfx <mfx> 1119613856 +0000
2005-06-24 11:50:56 +00:00
Markus F.X.J. Oberhumer 6b7c7f755c Avoid warnings about unused vars.
committer: mfx <mfx> 1119613814 +0000
2005-06-24 11:50:14 +00:00
Markus F.X.J. Oberhumer c55a8a8703 Added some more sanity checks.
committer: mfx <mfx> 1119613748 +0000
2005-06-24 11:49:08 +00:00
Markus F.X.J. Oberhumer 64c97308ac Portability fix for gcc -ftrapv option.
committer: mfx <mfx> 1119613504 +0000
2005-06-24 11:45:04 +00:00
Markus F.X.J. Oberhumer 3551b0b95a Updated.
committer: mfx <mfx> 1119613441 +0000
2005-06-24 11:44:01 +00:00
Markus F.X.J. Oberhumer 9f16b5c4af Recompiled stubs.
committer: mfx <mfx> 1119613249 +0000
2005-06-24 11:40:49 +00:00
Markus F.X.J. Oberhumer 9777e549cb New upstream version.
committer: mfx <mfx> 1119613222 +0000
2005-06-24 11:40:22 +00:00
Markus F.X.J. Oberhumer fbfced1b93 New ACC version.
committer: mfx <mfx> 1119613192 +0000
2005-06-24 11:39:52 +00:00
John Reiser 1a84b4681c fix sign-extend bug
committer: jreiser <jreiser> 1114311664 +0000
2005-04-24 03:01:04 +00:00
John Reiser 4bf81b8e1c propagate compiled changes due to ppc_bxx.S
stub/fold_elfppc32.h stub/fold_machppc32.h

committer: jreiser <jreiser> 1114229942 +0000
2005-04-23 04:19:02 +00:00
John Reiser c282e7fdb4 PPC branch+call trick: filter first 4MB only
filteri.cpp filter/ppcbxx.h stub/ppc_bxx.S

committer: jreiser <jreiser> 1114229877 +0000
2005-04-23 04:17:57 +00:00
John Reiser d339ee3135 PackLinuxElf32::unpack forgot several get_native32()
committer: jreiser <jreiser> 1114229735 +0000
2005-04-23 04:15:35 +00:00
Markus F.X.J. Oberhumer 1de95de299 Updated.
committer: mfx <mfx> 1111664629 +0000
2005-03-24 11:43:49 +00:00
Markus F.X.J. Oberhumer 96c998a1d7 Updated for current glibc.
committer: mfx <mfx> 1111664285 +0000
2005-03-24 11:38:05 +00:00
Markus F.X.J. Oberhumer b5413c0156 Added John to main banner.
committer: mfx <mfx> 1110936050 +0000
2005-03-16 01:20:50 +00:00
Markus F.X.J. Oberhumer 7371c195ff Allocate larger xtrasize based on ih.datasize.
committer: mfx <mfx> 1110936001 +0000
2005-03-16 01:20:01 +00:00
Markus F.X.J. Oberhumer 0866a1996b Added two checks for buffer overflows as suggested by Giovanni Bajo.
committer: mfx <mfx> 1110732210 +0000
2005-03-13 16:43:30 +00:00
Markus F.X.J. Oberhumer 41f44c4e78 Updated.
committer: mfx <mfx> 1110731666 +0000
2005-03-13 16:34:26 +00:00
Markus F.X.J. Oberhumer 131712c3bd New ACC version.
committer: mfx <mfx> 1110731645 +0000
2005-03-13 16:34:05 +00:00
Markus F.X.J. Oberhumer bae12aaab7 Added more global operators.
committer: mfx <mfx> 1110731448 +0000
2005-03-13 16:30:48 +00:00
Markus F.X.J. Oberhumer 74d5844d8c Tried to make 64-bit clean. John, please have a look!
committer: mfx <mfx> 1110731221 +0000
2005-03-13 16:27:01 +00:00
Markus F.X.J. Oberhumer c87908266a Fix a compilation problem with older compilers.
committer: mfx <mfx> 1110730245 +0000
2005-03-13 16:10:45 +00:00
Markus F.X.J. Oberhumer f788d76b8c Added several __attribute_packed.
committer: mfx <mfx> 1110730186 +0000
2005-03-13 16:09:46 +00:00
Markus F.X.J. Oberhumer 41031e572e Updated.
committer: mfx <mfx> 1110729509 +0000
2005-03-13 15:58:29 +00:00
Markus F.X.J. Oberhumer f8a0864c1b Final updates. Really.
committer: mfx <mfx> 1109817185 +0000
2005-03-03 02:33:05 +00:00
Markus F.X.J. Oberhumer 949587334c Updates.
committer: mfx <mfx> 1109816699 +0000
2005-03-03 02:24:59 +00:00
Markus F.X.J. Oberhumer 0bc6a1a7f1 Updated.
committer: mfx <mfx> 1109765803 +0000
2005-03-02 12:16:43 +00:00
Markus F.X.J. Oberhumer 0d9cbfe927 Updated.
committer: mfx <mfx> 1109756565 +0000
2005-03-02 09:42:45 +00:00
Markus F.X.J. Oberhumer 8742a524c3 Small updates.
committer: mfx <mfx> 1109750922 +0000
2005-03-02 08:08:42 +00:00
Markus F.X.J. Oberhumer 79bf2297b5 New simple and modern Makefile.
committer: mfx <mfx> 1109750619 +0000
2005-03-02 08:03:39 +00:00
Markus F.X.J. Oberhumer 32e9e23630 Removed old Makfiles (horrible cruft dating back from 1998).
committer: mfx <mfx> 1109750572 +0000
2005-03-02 08:02:52 +00:00
Markus F.X.J. Oberhumer 7f1cecba92 Got changed. We must sync our toolchains.
committer: mfx <mfx> 1109750498 +0000
2005-03-02 08:01:38 +00:00
Markus F.X.J. Oberhumer efd30c61c3 Use namespace.
committer: mfx <mfx> 1109750346 +0000
2005-03-02 07:59:06 +00:00
Markus F.X.J. Oberhumer 4c97b11207 Added OBJSTRIP_xxx variables.
committer: mfx <mfx> 1109734187 +0000
2005-03-02 03:29:47 +00:00
John Reiser 58ea0ab745 use "~0u" to force unsigned bitmasks
committer: jreiser <jreiser> 1109691309 +0000
2005-03-01 15:35:09 +00:00
Markus F.X.J. Oberhumer 3547c71ad5 New ACC version.
committer: mfx <mfx> 1109674986 +0000
2005-03-01 11:03:06 +00:00
Markus F.X.J. Oberhumer 044d6b2ce2 Updated some ELF constants.
committer: mfx <mfx> 1109674932 +0000
2005-03-01 11:02:12 +00:00
Markus F.X.J. Oberhumer a0b26b6c06 Added Elf32_Dyn.
committer: mfx <mfx> 1109671693 +0000
2005-03-01 10:08:13 +00:00
Markus F.X.J. Oberhumer 8e3bfde439 Use templates.
committer: mfx <mfx> 1109671197 +0000
2005-03-01 09:59:57 +00:00
Markus F.X.J. Oberhumer 6507de959b Remove "struct" keywords.
committer: mfx <mfx> 1109671153 +0000
2005-03-01 09:59:13 +00:00
Markus F.X.J. Oberhumer 56d09bf3b5 Avoid warning.
committer: mfx <mfx> 1109669763 +0000
2005-03-01 09:36:03 +00:00
Markus F.X.J. Oberhumer 232754b978 Removed trailing whitespace.
committer: mfx <mfx> 1109669261 +0000
2005-03-01 09:27:41 +00:00
Markus F.X.J. Oberhumer 75ef603308 Linker updates from Laszlo. Needs some testing.
committer: mfx <mfx> 1109669078 +0000
2005-03-01 09:24:38 +00:00
Markus F.X.J. Oberhumer a5a2fcee4d Avoid warning.
committer: mfx <mfx> 1109345414 +0000
2005-02-25 15:30:14 +00:00
John Reiser f86d57bfe3 mmap() needs in-range fd; b_method as arg5 to decompress
l_lx_elfppc32.S l_lx_elfppc32.h
	ppc_d_nrv2e.S
	ppc_d_nrv2b.S

committer: jreiser <jreiser> 1109217478 +0000
2005-02-24 03:57:58 +00:00
John Reiser 615615b1df Unmap the compressed program before running the uncompressed.
fold_elfppc32.S fold_elfppc32.h

committer: jreiser <jreiser> 1109129677 +0000
2005-02-23 03:34:37 +00:00
John Reiser aeba0ce170 add dependencies for ppc_bxx.S and ppc_d_nrv2e.S
Makefile fold_elfppc32.h l_mac_ppc32.h

committer: jreiser <jreiser> 1109093661 +0000
2005-02-22 17:34:21 +00:00
John Reiser 5ce60aad53 data cache prefetch
ppc_d_nrv2e.S l_lx_elfppc32.h

committer: jreiser <jreiser> 1109034808 +0000
2005-02-22 01:13:28 +00:00
John Reiser dbc01de9a0 remove debugg-only 'trap'
committer: jreiser <jreiser> 1109012788 +0000
2005-02-21 19:06:28 +00:00
John Reiser dfaf3f24fc fix bad merge
p_lx_elf.h p_lx_exc.cpp

committer: jreiser <jreiser> 1108944786 +0000
2005-02-21 00:13:06 +00:00
John Reiser 14b0527e79 fix compiler waring
committer: jreiser <jreiser> 1108941316 +0000
2005-02-20 23:15:16 +00:00
John Reiser f0148c3161 prepare for M_CL1B
committer: jreiser <jreiser> 1108940729 +0000
2005-02-20 23:05:29 +00:00
John Reiser 6a5e3d924d p_lx_interp, p_mach
committer: jreiser <jreiser> 1108940412 +0000
2005-02-20 23:00:12 +00:00
John Reiser 664a82e7c9 Start re-organizing the packing of Elf, by making Elf32 come first,
with Big endian and Little endian derived from it.
I386 still uses the old way, but PowerPC (both Linux and Darwin [Mac])
use the new way.
	p_elf.h p_lx_elf.cpp p_lx_elf.h p_lx_exc.cpp p_lx_exc.h
	p_unix.cpp p_unix.h p_vmlinx.cpp p_vmlinx.h p_vmlinz.cpp

committer: jreiser <jreiser> 1108940224 +0000
2005-02-20 22:57:04 +00:00
John Reiser e2763b4826 new packers PackMachPPC32 PackLinuxElf32ppc PackLinuxI386interp
packmast.cpp
	p_lx_interp.h

committer: jreiser <jreiser> 1108939957 +0000
2005-02-20 22:52:37 +00:00
John Reiser afb29b19c2 PowerPC branch [and call] trick
committer: jreiser <jreiser> 1108939726 +0000
2005-02-20 22:48:46 +00:00
John Reiser 8d60343940 allow better handling for no_filter option;
new options is_ptinterp, use_ptintep, make_ptinterp;
reserve codes for M_CL1B.
	compress.ch conf.h main.cpp options.h

committer: jreiser <jreiser> 1108939577 +0000
2005-02-20 22:46:17 +00:00
John Reiser 67a77f1880 Packer for Macintosh Darwin Mach-o PowerPC32
Added Files:
	p_mach.cpp p_mach.h

committer: jreiser <jreiser> 1108863998 +0000
2005-02-20 01:46:38 +00:00
John Reiser c933974174 branch trick for PowerPC32
committer: jreiser <jreiser> 1108863063 +0000
2005-02-20 01:31:03 +00:00
John Reiser 19715903fb New stubs pti86 (PT_INTERP for Linux x86), Linux Elf PowerPC-32,
Apple Macintosh Darwin PowerPC-32.

committer: jreiser <jreiser> 1108862148 +0000
2005-02-20 01:15:48 +00:00
John Reiser c88f72fd15 disinguish between __i386__ and generic
committer: jreiser <jreiser> 1108861387 +0000
2005-02-20 01:03:07 +00:00
John Reiser 7818596271 stub loader for Linux Elf PowerPC32
Added Files:
	m_lx_elfppc32.c l_lx_elfppc32.lds
	fold_elfppc32.S l_lx_elfppc32.S
	fold_elfppc32.h l_lx_elfppc32.h  [these two created by Makefile]

committer: jreiser <jreiser> 1108861182 +0000
2005-02-20 00:59:42 +00:00
John Reiser 9cb8d7bca6 stub loader for Macintosh (Darwin) Mach-o PowerPC32
Added Files:
	l_mac_ppc32.S fold_machppc32.S m_mac_mach32.c
	l_mac_ppc32.h fold_machppc32.h [these two created by Makefile]

committer: jreiser <jreiser> 1108860254 +0000
2005-02-20 00:44:14 +00:00
John Reiser 46f9256114 PowerPC unfilter, decompress, and register definitions
Added Files:
	ppc_bxx.S ppc_d_nrv2e.S ppc_regs.h

committer: jreiser <jreiser> 1108855959 +0000
2005-02-19 23:32:39 +00:00
John Reiser c26ef87202 Let the UPX loader be an Elf PT_INTERP /opt/upx/run
Added Files:
	p_lx_interp.cpp stub/l_lx_pti.c stub/fold_pti86.asm
	stub/fold_pti86.h stub/l_lx_pti86.asm stub/l_lx_pti86.h
	stub/l_lx_pti86.lds

committer: jreiser <jreiser> 1108855010 +0000
2005-02-19 23:16:50 +00:00
John Reiser 89fee5b835 allow more sections; print failing section on overflow
committer: jreiser <jreiser> 1108850756 +0000
2005-02-19 22:05:56 +00:00
John Reiser f5795eb01b make_hatch() is called from l_lx_sep86.asm, so cannot be 'static'
committer: jreiser <jreiser> 1108850437 +0000
2005-02-19 22:00:37 +00:00
László Molnár dbf0c9f016 msg.cpp: fixed possible sigsegv caused by a tricky filename
committer: ml1050 <ml1050> 1108382780 +0000
2005-02-14 12:06:20 +00:00
Markus F.X.J. Oberhumer 586b43048f Bump version.
committer: mfx <mfx> 1107807914 +0000
2005-02-07 20:25:14 +00:00
Markus F.X.J. Oberhumer 63b9ee61d2 Prepare UPX 1.93 release.
committer: mfx <mfx> 1107804731 +0000
2005-02-07 19:32:11 +00:00
Markus F.X.J. Oberhumer 3b9eff7f34 Enter 2005; added all needed stub files to CVS.
committer: mfx <mfx> 1107804447 +0000
2005-02-07 19:27:27 +00:00
John Reiser 59668c5fc1 ::pack3 to set .p_filesz; also set blocksize to allow giant scripts as input
p_lx_sh.cpp p_lx_sh.h

committer: jreiser <jreiser> 1105479043 +0000
2005-01-11 21:30:43 +00:00
Markus F.X.J. Oberhumer 3ed786fb5c Updated.
committer: mfx <mfx> 1103717402 +0000
2004-12-22 12:10:02 +00:00
Markus F.X.J. Oberhumer 0cd5eb5472 Use gcc-3.4.3 for Linux stubs.
committer: mfx <mfx> 1103717370 +0000
2004-12-22 12:09:30 +00:00
Markus F.X.J. Oberhumer ff571b96cb New ACC version.
committer: mfx <mfx> 1103717337 +0000
2004-12-22 12:08:57 +00:00
John Reiser 36b852e6bf %cs at entry to decompressor varies a _lot_ among Linux 2.4.x, 2.6.y kernels.
Decompressor must adapt; no universal constants exist for __BOOT_CS, _BOOT_DS.
	p_vmlinx.cpp stub/l_vmlinz.asm

committer: jreiser <jreiser> 1103605278 +0000
2004-12-21 05:01:18 +00:00
John Reiser f0c21c7203 Enhance documentation for process flow and testing.
Include some notes for compressing kernels from Linux 2.4.x.

committer: jreiser <jreiser> 1103513947 +0000
2004-12-20 03:39:07 +00:00
John Reiser 0516d8260c Fix stack synchronization bug at end of unfilter.
[The confusing fake "conditional compilation" strikes again!]

committer: jreiser <jreiser> 1103513713 +0000
2004-12-20 03:35:13 +00:00
John Reiser 1418f57b96 Fix bugs between Filter.addvalue and ckt32 macro call: [re-]compressed
Linux kernels were not booting.  Explain .addvalue better.
Set kernel stack pointer for boot-time decompression according to
Linux kernel documentation.
	     p_vmlinx.cpp      p_vmlinz.cpp
	stub/l_vmlinx.asm stub/l_vmlinz.asm
	filter/cto.h filter/ctoj.h filter/ctok.h

committer: jreiser <jreiser> 1103326936 +0000
2004-12-17 23:42:16 +00:00
Markus F.X.J. Oberhumer b24fb59c94 New upstream version.
committer: mfx <mfx> 1101602738 +0000
2004-11-28 00:45:38 +00:00
Markus F.X.J. Oberhumer 8fcf2bcd59 Fix bele.h to use strict PODs. This should fix build problems reported on ARM.
committer: mfx <mfx> 1098709362 +0000
2004-10-25 13:02:42 +00:00
Markus F.X.J. Oberhumer 079b808a56 Updated.
committer: mfx <mfx> 1098709263 +0000
2004-10-25 13:01:03 +00:00
Markus F.X.J. Oberhumer a4e01e28db New ACC version.
committer: mfx <mfx> 1098709116 +0000
2004-10-25 12:58:36 +00:00
Markus F.X.J. Oberhumer ec1ef9099f Updated.
committer: mfx <mfx> 1096637333 +0000
2004-10-01 13:28:53 +00:00
Markus F.X.J. Oberhumer ac724c7e6c New PS1 version from Jens.
committer: mfx <mfx> 1096637259 +0000
2004-10-01 13:27:39 +00:00
Markus F.X.J. Oberhumer ec25835525 New ACC version.
committer: mfx <mfx> 1096636709 +0000
2004-10-01 13:18:29 +00:00
Markus F.X.J. Oberhumer d4841a641c Updates.
committer: mfx <mfx> 1092135204 +0000
2004-08-10 10:53:24 +00:00
Markus F.X.J. Oberhumer 5612460720 New ACC version.
committer: mfx <mfx> 1092134926 +0000
2004-08-10 10:48:46 +00:00
John Reiser 465ea6429f "new []" requires matching "delete []"
committer: jreiser <jreiser> 1090882098 +0000
2004-07-26 22:48:18 +00:00
Markus F.X.J. Oberhumer ed9057ca83 Cleanups.
committer: mfx <mfx> 1090594763 +0000
2004-07-23 14:59:23 +00:00
Markus F.X.J. Oberhumer 14ced962db Cleanup.
committer: mfx <mfx> 1090583778 +0000
2004-07-23 11:56:18 +00:00
Markus F.X.J. Oberhumer 1aff6b862d Replaced ACC with miniACC.
committer: mfx <mfx> 1090583659 +0000
2004-07-23 11:54:19 +00:00
Markus F.X.J. Oberhumer ef490c4220 Updates.
committer: mfx <mfx> 1090577049 +0000
2004-07-23 10:04:09 +00:00
Markus F.X.J. Oberhumer 0dda83cbbc Updated.
committer: mfx <mfx> 1090577037 +0000
2004-07-23 10:03:57 +00:00
Markus F.X.J. Oberhumer fa4efec3b5 Bumped version numbers.
committer: mfx <mfx> 1090283329 +0000
2004-07-20 00:28:49 +00:00
867 changed files with 235741 additions and 37485 deletions
+27
View File
@@ -0,0 +1,27 @@
# vim:set ft=yaml ts=2 sw=2 et:
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# for clang-format-15.0.6 from https://github.com/upx/upx-stubtools/releases
#
# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike
---
BasedOnStyle: LLVM
ColumnLimit: 100
IndentWidth: 4
---
# settings for C and C++
Language: Cpp
AccessModifierOffset: -4
AlignConsecutiveMacros: AcrossComments
AlwaysBreakTemplateDeclarations: true
AttributeMacros:
- DELETED_FUNCTION
- XSPAN_DELETED_FUNCTION
- may_throw
EmptyLineBeforeAccessModifier: Leave
# IndentPPDirectives: AfterHash # TODO later
SortIncludes: false
SpaceAfterCStyleCast: true
Standard: Cpp03
StatementMacros:
- CLANG_FORMAT_DUMMY_STATEMENT
...
+37
View File
@@ -0,0 +1,37 @@
# vim:set ft=yaml ts=2 sw=2 et:
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# for clang-tidy from https://clang.llvm.org/extra/clang-tidy/
---
Checks: >
-*,
bugprone-*,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-casting-through-void,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-inc-dec-in-conditions,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-reserved-identifier,
-bugprone-sizeof-expression,
-bugprone-suspicious-include,
-bugprone-suspicious-memory-comparison,
-bugprone-suspicious-string-compare,
-bugprone-switch-missing-default-case,
-bugprone-unintended-char-ostream-output,
clang-analyzer-*,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-security.insecureAPI.strcpy,
clang-diagnostic-*,
performance-*,
-performance-avoid-endl,
-performance-enum-size,
-performance-no-int-to-ptr,
-performance-unnecessary-value-param,
FormatStyle: file
HeaderFilterRegex: '.*'
InheritParentConfig: false
...
+44
View File
@@ -0,0 +1,44 @@
# vim:set ft=yaml ts=2 sw=2 et:
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# for clangd from https://clangd.llvm.org/
---
# treat *.h files as C++ source code
If:
PathMatch: src/.*\.h
PathExclude: vendor/.*
CompileFlags:
Add:
- -xc++
---
# C++ flags
If:
PathMatch: [ src/.*\.h, src/.*\.cpp ]
PathExclude: vendor/.*
CompileFlags:
Add:
- -std=gnu++17
# -std=gnu++20 # requires clangd >= 11.0
# -std=gnu++23 # requires clangd >= 18.0
---
# common flags for all C/C++ files
If:
PathMatch: [ src/.*\.h, src/.*\.c, src/.*\.cpp ]
PathExclude: vendor/.*
CompileFlags:
Add:
# see https://github.com/clangd/clangd/issues/1038 : Support deterministic relative include path
- -Ivendor
- -I../vendor
- -I../../vendor
- -DDEBUG
- -fno-strict-aliasing
- -fno-strict-overflow
- -funsigned-char
Diagnostics:
Includes:
# IgnoreHeader: A list of regexes. Include Cleaner will not produce diagnostics
# for headers whose path is a suffix match for any of these.
IgnoreHeader:
- src/.*\.h
UnusedIncludes: None
...
-7
View File
@@ -1,7 +0,0 @@
_darcs
B
ChangeLog.cvs*
TODO.*
build
doxygen
maint
+22
View File
@@ -0,0 +1,22 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# see https://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[{GNUmakefile*,MMakefile*,Makefile*,Makevars*,*.mk}]
indent_size = 8
indent_style = tab
[{*.asm,*.S}]
indent_size = 8
[{*.yaml,*.yml}]
indent_size = 2
+36
View File
@@ -0,0 +1,36 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# see https://github.com/github-linguist/linguist
#
# HINT: check settings with
# git ls-files | git check-attr --stdin --all
# git ls-files --eol
# disable all line ending conversions
* -text
#
# tell diff tools that these files are generated automatically
#
/doc/upx.1 linguist-generated
/doc/upx-doc.* linguist-generated
/src/stub/*.h linguist-generated
/src/stub/src/arch/**/lzma_d_c[fns].S linguist-generated
/src/stub/tmp/** linguist-generated
/misc/podman/*/packages*.txt linguist-generated
/misc/testsuite/*expected_sha256sums* linguist-generated
#
# make GitHub language detection more accurate
#
/src/*.h linguist-language=C++
/src/*/*.h linguist-language=C++
/src/stub/**/*.ash linguist-language=Assembly
/src/stub/**/*.asm linguist-language=Assembly
/src/stub/**/*.S linguist-language=Assembly
/src/stub/tmp/** linguist-vendored
+10
View File
@@ -0,0 +1,10 @@
* @markus-oberhumer @jreiser
/src/p_lx_* @jreiser
/src/p_mach* @jreiser
/src/p_unix* @jreiser
/src/p_vmlin* @jreiser
/src/stub/src/*bsd.* @jreiser
/src/stub/src/*darwin.* @jreiser
/src/stub/src/*linux.* @jreiser
+45
View File
@@ -0,0 +1,45 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
This issue tracker is **ONLY** used for reporting bugs.
Please use [stackoverflow](https://stackoverflow.com) for supporting issues.
<!---
IF YOU REMOVE THIS TEMPLATE WE WILL CLOSE YOUR ISSUE WITHOUT RESPONSE.
Just read it and fill in the details we're asking, it saves so much of our time. Thanks!
-->
## What's the problem (or question)?
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
## What should have happened?
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
## Do you have an idea for a solution?
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## How can we reproduce the issue?
<!--- Provide unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Please tell us details about your environment.
<!--- Include as many relevant details about the environment you experienced the bug in -->
* UPX version used (`upx --version`):
* Host Operating System and version:
* Host CPU architecture:
* Target Operating System and version:
* Target CPU architecture:
+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: false
+45
View File
@@ -0,0 +1,45 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
This issue tracker is **ONLY** used for requesting sensible features.
Please use [stackoverflow](https://stackoverflow.com) for supporting issues.
<!---
IF YOU REMOVE THIS TEMPLATE WE WILL CLOSE YOUR ISSUE WITHOUT RESPONSE.
Just read it and fill in the details we're asking, it saves so much of our time. Thanks!
-->
## What's the problem (or question)?
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
## What should have happened?
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
## Do you have an idea for a solution?
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## How can we reproduce the issue?
<!--- Provide unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Please tell us details about your environment.
<!--- Include as many relevant details about the environment you experienced the bug in -->
* UPX version used (`upx --version`):
* Host Operating System and version:
* Host CPU architecture:
* Target Operating System and version:
* Target CPU architecture:
+14
View File
@@ -0,0 +1,14 @@
UPX PULL REQUEST NOTES
======================
Handling pull requests is actually quite time consuming, so please
- if you want to contribute **a real C++ code bug-fix** then open an issue
on the main UPX issue tracker first
- if you want to contribute **a new feature** then by all means open an issue
on the main UPX issue tracker first before starting any coding!
- please refuse the temptation to "improve" the docs, scripts, CI, makefiles,
cmake build system, spelling errors, etc - we will NOT merge this; only open
an issue if you're sure there is a **real bug**
+15
View File
@@ -0,0 +1,15 @@
# Security Context
IMPORTANT NOTE: UPX inherits the security context of any files it handles.
This means that packing, unpacking, or even testing or listing a file requires
the same security considerations as actually executing the file.
Use UPX on trusted files only!
## Supported Versions
| Version | Supported |
| --------- | ------------------ |
| git HEAD | :white_check_mark: |
| any other | :x: |
+805
View File
@@ -0,0 +1,805 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# note: GitHub Actions runner images are frequently updated, and
# unfortunately this sometimes breaks builds in mysterious ways...
# see https://github.com/actions/runner-images.git
name: CI
on: [push, workflow_dispatch]
defaults: { run: { shell: bash } }
env:
CMAKE_REQUIRED_QUIET: 'OFF'
CMAKE_VERBOSE_MAKEFILE: 'ON'
CTEST_OUTPUT_ON_FAILURE: 'ON'
DEBIAN_FRONTEND: noninteractive
NO_COLOR: 1
UPX_CMAKE_BUILD_FLAGS: --verbose
UPX_CMAKE_CONFIG_FLAGS: -Wdev --warn-uninitialized
UPX_CONFIG_HAVE_WORKING_BUILD_RPATH: 'ON'
UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO: 1
UPX_DEBUG_TEST_LIBC_QSORT: 1
ZSTD_CLEVEL: 17
# 2025-10-11
ZIG_DIST_VERSION: 0.15.2
jobs:
job-rebuild-and-verify-stubs:
name: Rebuild stubs
runs-on: ubuntu-latest
container: ubuntu:24.04 # provides glibc-2.39
#container: debian:12-slim # also works; provides glibc-2.36
#container: debian:testing-slim # also works; currently provides glibc-2.38
steps:
- run: uname -a; pwd; id; umask
- name: Install packages
run: |
dpkg --add-architecture i386
apt-get update && apt-get upgrade -y
# install system packages
apt-get install -y --no-install-recommends bash ca-certificates curl git libmpc3 make perl-base python3-minimal tar time xz-utils libc6:i386 zlib1g:i386
apt-get install -y gcc-riscv64-linux-gnu
mkdir ../deps; cd ../deps; mkdir packages
### install python2-minimal packages from Debian-11
## curl -sS -L -O https://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_amd64.deb
## curl -sS -L -O https://ftp.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_amd64.deb
## dpkg -i ./*python2*.deb && rm ./*python2*.deb && ldconfig
## ln -s -v python2.7 /usr/bin/python2
# manually unpack and install compat libs from Ubuntu-16.04
curl -sS -L -O https://archive.kernel.org/ubuntu-archive/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.6-1_amd64.deb
for f in ./*.deb; do dpkg -x $f ./packages; done
mv -v -n ./packages/usr/lib/x86_64-linux-gnu/lib* /usr/lib/x86_64-linux-gnu/
rm -rf ./*.deb ./packages && ldconfig
# install upx-stubtools
curl -sS -L https://github.com/upx/upx-stubtools/releases/download/v20221212/bin-upx-20221212.tar.xz | tar -xJ
- run: dpkg -l
- name: Check out code
run: |
git config --global --add safe.directory '*' # needed when running in a container
git clone --branch "$GITHUB_REF_NAME" --depth 1 "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" .
git submodule update --init -- vendor/lzma-sdk
git fsck --strict --no-progress
- name: Rebuild and verify stubs
run: |
export PATH="$(readlink -en ../deps/bin-upx-20221212):$PATH"
make -C src/stub maintainer-clean extra-clean
git status || true # make sure the stub files got deleted
make -C src/stub extra-all all
if ! git diff --quiet; then git diff; exit 1; fi
- run: bash ./misc/scripts/check_whitespace_git.sh
- name: Check source code formatting
run: |
export UPX_CLANG_FORMAT="$(readlink -en ../deps/bin-upx-20221212/clang-format-15.0.6)"
make -C src clang-format
if ! git diff --quiet; then git diff; exit 1; fi
- name: Rebuild docs
run: |
make -C doc clean all
if ! git diff --quiet; then git diff || true; fi # ignore diff error
- name: Clean up
run: |
git ls-files -z --others --ignored --exclude-standard ./src/stub | xargs -0r rm -v --
find ./src/stub/src -type d -name tmp -print0 | xargs -0r rmdir -v --
- run: git status --ignored || true
job-linux-cmake-0: # uses cmake + make
if: true
needs: [ job-rebuild-and-verify-stubs ]
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-22.04 }
- { os: ubuntu-24.04 }
- { os: ubuntu-22.04-arm }
- { os: ubuntu-24.04-arm }
name: ${{ format('{0}', matrix.os) }}-0
runs-on: ${{ matrix.os }}
steps:
- run: uname -a; pwd; id; umask
- run: sudo apt-get update
- run: sudo apt-get install -y dmidecode gdb parallel valgrind
- run: (sudo dmidecode | sed -n -e '/System Information/,/^$/p') || true
- run: sudo dmidecode -q || true
- run: sudo dmidecode || true
- uses: actions/checkout@v6
with: { submodules: true }
- run: make build/extra/gcc/all
- run: make build/extra/clang/all
- run: ls -l build/*/*/*/upx* || true
- run: file build/*/*/*/upx* || true
- name: Make artifact
run: |
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}-0" | sed 's/[^0-9a-zA-Z_.-]/-/g')
mkdir -p "tmp/artifact/$N"
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
if command -v hardlink >/dev/null; then (cd "tmp/artifact/$N" && hardlink .) fi
(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la && zstd -tq "$N.tar.zst")
echo "artifact_name=$N" >> $GITHUB_ENV
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
uses: actions/upload-artifact@v5
with: { name: '${{ env.artifact_name }}', path: tmp/artifact }
- name: Run install tests
run: |
jobs="gcc/debug gcc/release clang/debug clang/release"
echo "===== parallel jobs: $jobs"
DESTDIR="Install with make 2" parallel -kv --lb 'make build/extra/{}+install' ::: $jobs
- name: Mimic ctest tests SIGSEGV
run: |
jobs="gcc/debug gcc/release clang/debug clang/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/mimic_ctest_sigsegv.sh' ::: $jobs
ls -ld ./build/*/*/*/upx-* || true
rm -rf ./build/*/*/*/upx-*
- name: Run ctest tests
run: |
jobs="gcc/debug gcc/release clang/debug clang/release"
echo "===== parallel jobs: $jobs"
CTEST_JOBS=2 parallel -kv --lb 'make build/extra/{}+test' ::: $jobs
ls -ld ./build/*/*/*/XTesting/*/* || true
rm -rf ./build/*/*/*/XTesting/*/*
- name: Mimic ctest tests with Valgrind
run: |
export UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS=ON # valgrind is SLOW
export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet --gen-suppressions=all"
# clang/debug does not work before valgrind-3.20, see https://bugs.kde.org/show_bug.cgi?id=452758
jobs="gcc/debug gcc/release clang/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
ls -ld ./build/*/*/*/upx-* || true
rm -rf ./build/*/*/*/upx-*
job-linux-cmake: # uses cmake + make
if: true
needs: [ job-rebuild-and-verify-stubs ]
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-22.04, use_extra: true }
- { os: ubuntu-24.04, use_extra: true, use_wine: true }
name: ${{ format('{0}', matrix.os) }}
runs-on: ${{ matrix.os }}
steps:
- run: uname -a; pwd; id; umask
- name: Install extra 32-bit and MinGW packages
if: ${{ matrix.use_extra }}
run: |
sudo dpkg --add-architecture i386
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y dmidecode gdb libc6-dbg:i386 parallel valgrind
sudo apt-get install -y g++-multilib g++-mingw-w64-i686 g++-mingw-w64-x86-64
# make sure that we use posix-threads (pthread/winpthreads) and NOT win32-threads
for f in i686-w64-mingw32-g++ i686-w64-mingw32-gcc x86_64-w64-mingw32-g++ x86_64-w64-mingw32-gcc; do
if test -f /usr/bin/$f-posix; then sudo update-alternatives --set $f /usr/bin/$f-posix; fi
ls -l /usr/bin/${f}*
done
ls -l /etc/alternatives/*mingw* || true
- run: (sudo dmidecode | sed -n -e '/System Information/,/^$/p') || true
if: ${{ matrix.use_extra }}
- run: sudo dmidecode -q || true
if: ${{ matrix.use_extra }}
- run: sudo dmidecode || true
if: ${{ matrix.use_extra }}
- name: Install Wine
if: ${{ matrix.use_extra && matrix.use_wine }}
run: |
sudo apt-get install -y wine wine32:i386 wine64
ls -l /usr/bin/wine*
mkdir -p -v ~/.wine && wineboot --init
- uses: actions/checkout@v6
with: { submodules: true }
- name: Check out test suite
run: git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
- run: set -x; clang --version; clang++ --version
- run: set -x; gcc --version; g++ --version
- run: clang -E -x c -dM /dev/null # list predefined macros for C
- run: clang++ -E -x c++ -dM /dev/null # list predefined macros for C++
- run: gcc -E -x c -dM /dev/null # list predefined macros for C
- run: g++ -E -x c++ -dM /dev/null # list predefined macros for C++
- run: make build/extra/gcc/all
- run: make build/extra/clang/all
- run: make build/extra/gcc-m32/all
if: ${{ matrix.use_extra }}
- run: make build/extra/gcc-mx32/all
if: ${{ matrix.use_extra }}
- run: make build/extra/cross-windows-mingw32/all
if: ${{ matrix.use_extra }}
- run: make build/extra/cross-windows-mingw64/all
if: ${{ matrix.use_extra }}
- run: ls -l build/*/*/*/upx* || true
- run: file build/*/*/*/upx* || true
- name: Make artifact
run: |
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}" | sed 's/[^0-9a-zA-Z_.-]/-/g')
mkdir -p "tmp/artifact/$N"
dirs="gcc/debug gcc/release clang/debug clang/release"
if test "${{ matrix.use_extra }}" = "true"; then
dirs="$dirs gcc-m32/debug gcc-m32/release gcc-mx32/debug gcc-mx32/release"
dirs="$dirs cross-windows-mingw32/debug cross-windows-mingw32/release"
dirs="$dirs cross-windows-mingw64/debug cross-windows-mingw64/release"
fi
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/$d" cmake --install build/extra/$d; done
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/$d" cmake --install build/extra/$d --strip; done
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/$d"; done
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/$d" --strip; done
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
if command -v hardlink >/dev/null; then (cd "tmp/artifact/$N" && hardlink .) fi
(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la && zstd -tq "$N.tar.zst")
echo "artifact_name=$N" >> $GITHUB_ENV
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
uses: actions/upload-artifact@v5
with: { name: '${{ env.artifact_name }}', path: tmp/artifact }
- name: Run install tests
run: |
(cd build/extra/gcc/release && DESTDIR="$PWD/Install with cmake" cmake --install .)
(cd build/extra/gcc/release && DESTDIR="$PWD/Install with make" make install)
jobs="gcc/debug gcc/release clang/debug clang/release"
test "${{ matrix.use_extra }}" = "true" && jobs="$jobs gcc-m32/debug gcc-m32/release"
echo "===== parallel jobs: $jobs"
DESTDIR="Install with make 2" parallel -kv --lb 'make build/extra/{}+install' ::: $jobs
- name: Mimic ctest tests SIGSEGV
run: |
jobs="gcc/debug gcc/release clang/debug clang/release"
test "${{ matrix.use_extra }}" = "true" && jobs="$jobs gcc-m32/debug gcc-m32/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/mimic_ctest_sigsegv.sh' ::: $jobs
ls -ld ./build/*/*/*/upx-* || true
rm -rf ./build/*/*/*/upx-*
- name: Run ctest tests
run: |
jobs="gcc/debug gcc/release clang/debug clang/release"
test "${{ matrix.use_extra }}" = "true" && jobs="$jobs gcc-m32/debug gcc-m32/release"
command -v wine >/dev/null && jobs="$jobs cross-windows-mingw32/debug cross-windows-mingw32/release"
command -v wine >/dev/null && jobs="$jobs cross-windows-mingw64/debug cross-windows-mingw64/release"
echo "===== parallel jobs: $jobs"
CTEST_JOBS=2 parallel -kv --lb 'make build/extra/{}+test' ::: $jobs
ls -ld ./build/*/*/*/XTesting/*/* || true
rm -rf ./build/*/*/*/XTesting/*/*
- name: Mimic ctest tests with Valgrind
if: true # note: valgrind is SLOW
run: |
if command -v valgrind >/dev/null; then
export UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS=ON # valgrind is SLOW
export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet --gen-suppressions=all"
# clang/debug does not work before valgrind-3.20, see https://bugs.kde.org/show_bug.cgi?id=452758
jobs="gcc/debug gcc/release clang/release"
test "${{ matrix.use_extra }}" = "true" && jobs="$jobs gcc-m32/debug gcc-m32/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
ls -ld ./build/*/*/*/upx-* || true
rm -rf ./build/*/*/*/upx-*
fi
- name: Run file system tests
run: |
jobs="gcc/debug gcc/release clang/debug clang/release"
test "${{ matrix.use_extra }}" = "true" && jobs="$jobs gcc-m32/debug gcc-m32/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/test_symlinks.sh' ::: $jobs
- name: Run file system tests with Valgrind
if: false # note: valgrind is SLOW
run: |
if command -v valgrind >/dev/null; then
export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet --gen-suppressions=all"
# clang/debug does not work before valgrind-3.20, see https://bugs.kde.org/show_bug.cgi?id=452758
jobs="gcc/debug gcc/release clang/release"
test "${{ matrix.use_extra }}" = "true" && jobs="$jobs gcc-m32/debug gcc-m32/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/test_symlinks.sh' ::: $jobs
fi
- name: Run test suite
run: |
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
jobs="gcc/debug gcc/release clang/debug clang/release"
test "${{ matrix.use_extra }}" = "true" && jobs="$jobs gcc-m32/debug gcc-m32/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/upx_testsuite_1.sh' ::: $jobs
ls -ld ./build/*/*/*/tmp-upx-testsuite* || true
rm -rf ./build/*/*/*/tmp-upx-testsuite*
job-macos-cmake: # uses cmake + make
if: true
needs: [ job-rebuild-and-verify-stubs ]
strategy:
fail-fast: false
matrix:
include:
# NOTE: Xcode updates regularly tend to break Homebrew clang/gcc; often some ld64 issue; use "xcode_version" as needed; or try "-Wl,-ld_classic"
# NOTE: macos does not have "env -C"; only with brew coreutils
- { os: macos-14, gcc: gcc-13, gxx: g++-13, testsuite: true }
- { os: macos-15, gcc: gcc-14, gxx: g++-14, testsuite: true }
- { os: macos-26, gcc: gcc-15, gxx: g++-15, testsuite: true }
- { os: macos-15-intel, gcc: gcc-14, gxx: g++-14, testsuite: true }
name: ${{ format('{0} {1}{2}', matrix.os, matrix.xcode_version && 'xcode-' || '', matrix.xcode_version) }}
runs-on: ${{ matrix.os }}
steps:
- run: uname -a; pwd; id; umask
- uses: maxim-lobanov/setup-xcode@v1
if: ${{ matrix.xcode_version }}
with: { xcode-version: '${{ matrix.xcode_version }}' }
- name: Install brew packages
if: ${{ matrix.testsuite }}
run: |
test -z "$HOMEBREW_PREFIX" && HOMEBREW_PREFIX="$(brew --prefix)"
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >> $GITHUB_ENV
# testsuite needs working "readlink -en" and "sha256sum -b"
packages="parallel util-linux"
test -e "$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin/readlink" || packages="$packages coreutils"
if test -n "$packages"; then
echo "===== brew leaves:"; brew leaves; echo "===== brew list:"; brew list --versions
# only run "brew update" if needed
if ! brew install $packages; then echo "===== brew update" && brew update && brew install $packages; fi
fi
mkdir -p ~/.parallel && : > ~/.parallel/$(echo 6305-4721 | tr 0-7 leticlwi)
echo "UPX_DEBUG_FORCE_PACK_MACOS=1" >> $GITHUB_ENV
case "${{ matrix.os }}" in
# TODO FIXME: UPX on macos-13+ is broken => disable run-packed for now
macos-[12][3456]*) echo "UPX_CONFIG_DISABLE_RUN_PACKED_TEST=ON" >> $GITHUB_ENV ;;
esac
- uses: actions/checkout@v6
with: { submodules: true }
- name: Check out test suite
if: ${{ matrix.testsuite }}
run: git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
- run: set -x; xcode-select -p || true; xcodebuild -version || true
- run: set -x; clang --version; clang++ --version
- run: clang -E -x c -dM /dev/null # list predefined macros for C
- run: clang++ -E -x c++ -dM /dev/null # list predefined macros for C++
- run: set -x; ${{ matrix.gcc }} --version; ${{ matrix.gxx }} --version
if: ${{ matrix.gcc }}
- run: ${{ matrix.gcc }} -E -x c -dM /dev/null # list predefined macros for C
if: ${{ matrix.gcc }}
- run: ${{ matrix.gxx }} -E -x c++ -dM /dev/null # list predefined macros for C++
if: ${{ matrix.gcc }}
- run: make build/extra/clang/all
- name: Build extra/gcc/all
if: ${{ matrix.gcc }}
run: make build/extra/gcc/all CC="${{ matrix.gcc }} -static-libgcc" CXX="${{ matrix.gxx }} -static-libgcc -static-libstdc++"
- name: Build xtarget/cross-darwin-arm64/all
run: |
make UPX_XTARGET=xtarget/cross-darwin-arm64 xtarget/all \
CC="clang -target arm64-apple-darwin" CXX="clang++ -target arm64-apple-darwin"
- run: ls -l build/*/*/*/upx* || true
- run: file build/*/*/*/upx* || true
- name: Make artifact
run: |
X="${{ matrix.xcode_version }}"; test -n "$X" && X="-xcode-$X"
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.os }}$X" | sed 's/[^0-9a-zA-Z_.-]/-/g')
mkdir -p "tmp/artifact/$N"
dirs="clang/debug clang/release"
test -n "${{ matrix.gcc }}" && dirs="$dirs gcc/debug gcc/release"
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/$d" cmake --install build/extra/$d; done
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/$d" cmake --install build/extra/$d --strip; done
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/$d"; done
for d in $dirs; do cmake --install build/extra/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/$d" --strip; done
(cd build && rsync -R -a */*/*/upx "../tmp/artifact/$N/")
hardlink="$HOMEBREW_PREFIX/opt/util-linux/bin/hardlink"
if test -f "$hardlink"; then (cd "tmp/artifact/$N" && "$hardlink" .) fi
(cd tmp/artifact && gtar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la && zstd -tq "$N.tar.zst")
echo "artifact_name=$N" >> $GITHUB_ENV
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
uses: actions/upload-artifact@v5
with: { name: '${{ env.artifact_name }}', path: tmp/artifact }
- name: Run install tests
run: |
(cd build/extra/clang/release && DESTDIR="$PWD/Install with cmake" cmake --install .)
(cd build/extra/clang/release && DESTDIR="$PWD/Install with make" make install)
- name: Run ctest tests
if: ${{ matrix.testsuite }}
run: |
for f in ./build/extra/*/*/upx; do file $f; done
jobs="clang/debug clang/release"
test -n "${{ matrix.gcc }}" && jobs="$jobs gcc/debug gcc/release"
echo "===== parallel jobs: $jobs"
CTEST_JOBS=2 parallel -kv --lb 'make build/extra/{}+test' ::: $jobs
- name: Mimic ctest tests
if: ${{ matrix.testsuite }}
run: |
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
jobs="clang/debug clang/release"
test -n "${{ matrix.gcc }}" && jobs="$jobs gcc/debug gcc/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
- name: Run file system tests
if: ${{ matrix.testsuite }}
run: |
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
export upx_test_file="$PWD"/build/extra/clang/release/upx
jobs="clang/debug clang/release"
test -n "${{ matrix.gcc }}" && jobs="$jobs gcc/debug gcc/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/test_symlinks.sh' ::: $jobs
- name: Run test suite
if: ${{ matrix.testsuite }}
run: |
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
jobs="clang/debug clang/release"
test -n "${{ matrix.gcc }}" && jobs="$jobs gcc/debug gcc/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/extra/{} && bash ../../../../misc/testsuite/upx_testsuite_1.sh' ::: $jobs
job-windows-cmake: # uses cmake + msbuild
if: true
needs: [ job-rebuild-and-verify-stubs ]
strategy:
fail-fast: false
matrix:
include:
- { name: windows-11-arm64, os: windows-11-arm, vsversion: 2022, vsarch: arm64 }
- { name: windows-11-arm64ec, os: windows-11-arm, vsversion: 2022, vsarch: arm64, use_arm64ec: true }
# { name: windows-11-arm64x, os: windows-11-arm, vsversion: 2022, vsarch: arm64, use_arm64x: true }
- { name: windows-2022-amd64, os: windows-2022, vsversion: 2022, vsarch: amd64 }
- { name: windows-2022-i386, os: windows-2022, vsversion: 2022, vsarch: amd64_x86 }
- { name: windows-2025-amd64, os: windows-2025, vsversion: 2022, vsarch: amd64 }
- { name: windows-2025-i386, os: windows-2025, vsversion: 2022, vsarch: amd64_x86 }
name: ${{ format('{0}', matrix.name) }}
runs-on: ${{ matrix.os }}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v6
with: { submodules: true }
- name: Check out test suite
run: git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
- uses: ilammy/msvc-dev-cmd@v1
with: { vsversion: '${{ matrix.vsversion }}', arch: '${{ matrix.vsarch }}' }
- name: Set platform
run: |
if [[ "${{ matrix.use_arm64ec }}" == "true" ]]; then true;
echo "UPX_CMAKE_CONFIG_FLAGS_PLATFORM=-A ARM64EC" >> $GITHUB_ENV
echo "UPX_CONFIG_DISABLE_SELF_PACK_TEST=ON" >> $GITHUB_ENV
elif [[ "${{ matrix.use_arm64x }}" == "true" ]]; then true;
echo "UPX_CMAKE_CONFIG_FLAGS_PLATFORM=-A ARM64X" >> $GITHUB_ENV
echo "UPX_CONFIG_DISABLE_SELF_PACK_TEST=ON" >> $GITHUB_ENV
elif [[ "${{ matrix.vsarch }}" == *amd64 ]]; then true;
echo "UPX_CMAKE_CONFIG_FLAGS_PLATFORM=-A x64" >> $GITHUB_ENV
elif [[ "${{ matrix.vsarch }}" == *arm64 ]]; then true;
echo "UPX_CMAKE_CONFIG_FLAGS_PLATFORM=-A ARM64" >> $GITHUB_ENV
echo "UPX_CONFIG_DISABLE_SELF_PACK_TEST=ON" >> $GITHUB_ENV
elif [[ "${{ matrix.vsarch }}" == *x86 ]]; then true;
echo "UPX_CMAKE_CONFIG_FLAGS_PLATFORM=-A Win32" >> $GITHUB_ENV
else
exit 1
fi
- run: make build/debug
- run: make build/release
- run: shopt -s globstar; ls -ld build/**/upx* || true
- run: shopt -s globstar; file build/**/upx* || true
- name: Make artifact
run: |
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-${{ matrix.name }}" | sed 's/[^0-9a-zA-Z_.-]/-/g')
mkdir -p "tmp/artifact/$N"
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/debug" cmake --install build/debug --config Debug
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/release" cmake --install build/release --config Release
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/debug" cmake --install build/debug --config Debug --strip
DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/release" cmake --install build/release --config Release --strip
cmake --install build/debug --config Debug --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/debug"
cmake --install build/release --config Release --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/release"
cmake --install build/debug --config Debug --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/debug" --strip
cmake --install build/release --config Release --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/release" --strip
(cd build && cp -ai --parents */*/upx.exe "../tmp/artifact/$N")
#(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la && zstd -tq "$N.tar.zst")
(cd tmp/artifact && tar --sort=name --gzip -cf "$N.tar.gz" "$N" && rm -rf "./$N" && ls -la && gzip -tq "$N.tar.gz")
echo "artifact_name=$N" >> $GITHUB_ENV
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
uses: actions/upload-artifact@v5
with: { name: '${{ env.artifact_name }}', path: tmp/artifact }
- name: Run ctest tests
run: |
ctest --test-dir build/debug --parallel 8 -C Debug
ctest --test-dir build/release --parallel 8 -C Release
- name: Mimic ctest tests
run: |
env -C build/debug/Debug upx_exe=./upx.exe bash "$PWD"/misc/testsuite/mimic_ctest.sh
env -C build/release/Release upx_exe=./upx.exe bash "$PWD"/misc/testsuite/mimic_ctest.sh
- name: Run test suite build/release
run: |
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
env -C build/release/Release upx_exe=./upx.exe bash "$PWD"/misc/testsuite/upx_testsuite_1.sh
job-windows-bh-toolchains: # build "by hand" using cmd.exe
if: github.repository_owner == 'upx'
needs: [ job-rebuild-and-verify-stubs ]
strategy:
fail-fast: false
matrix:
include:
- { name: amd64-win64-vs2025, os: windows-2025, vsversion: 2022, vsarch: amd64 }
- { name: arm64-win64-vs2025, os: windows-2025, vsversion: 2022, vsarch: amd64_arm64 }
- { name: arm64ec-win64-vs2025, os: windows-2025, vsversion: 2022, vsarch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64ec' }
# { name: arm64x-win64-vs2025, os: windows-2025, vsversion: 2022, vsarch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64x' }
- { name: i386-win32-vs2025, os: windows-2025, vsversion: 2022, vsarch: amd64_x86 }
name: ${{ format('windows-bh {0}', matrix.name) }}
runs-on: ${{ matrix.os }}
env:
C: ${{ matrix.name }}
B: release
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v6
with: { submodules: true }
- name: Prepare sources and Check out test suite
run: |
git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
mkdir -p -v build/$C/$B/{bzip2,ucl,upx,zlib,zstd}
repository_name="${GITHUB_REPOSITORY##*/}" # basename
echo "H=d:\\a\\$repository_name\\$repository_name" >> $GITHUB_ENV
- uses: ilammy/msvc-dev-cmd@v1
with: { vsversion: '${{ matrix.vsversion }}', arch: '${{ matrix.vsarch }}' }
- name: Build by hand
shell: cmd
run: |
@REM ===== set vars =====
where cl & where link
set RUN_CL=cl ${{ matrix.cl_machine_flags }} -MT
set RUN_LIB=link -lib ${{ matrix.link_machine_flags }}
@rem UPX only uses the very basic Windows API
set DEFS=-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0501
set BDIR=%H%\build\%C%\%B%
git rev-parse --short=12 HEAD > %BDIR%\upx\.GITREV.txt
@REM ===== build bzip2 =====
cd %BDIR%\bzip2
@rem %RUN_CL% -J -O2 -W4 -wd4127 -wd4244 -wd4267 -WX %DEFS% -DBZ_NO_STDIO -c %H%\vendor\bzip2\*.c
@rem %RUN_LIB% -out:bzip2.lib *.obj
@REM ===== build UCL =====
cd %BDIR%\ucl
set s=%H%\vendor\ucl
%RUN_CL% -J -O2 -W4 -WX %DEFS% -I%s%\include -I%s% -c %s%\src\*.c
%RUN_LIB% -out:ucl.lib *.obj
@REM ===== build zlib =====
cd %BDIR%\zlib
set s=%H%\vendor\zlib
%RUN_CL% -J -O2 -W3 -WX %DEFS% -I%s% -DHAVE_VSNPRINTF -c %H%\vendor\zlib\*.c
%RUN_LIB% -out:zlib.lib *.obj
@REM ===== build zstd =====
cd %BDIR%\zstd
set s=%H%\vendor\zstd\lib
@rem %RUN_CL% -J -O2 -W4 -WX %DEFS% -DDYNAMIC_BMI2=0 -DZSTD_DISABLE_ASM -c %s%\common\*.c %s%\compress\*.c %s%\decompress\*.c
@rem %RUN_LIB% -out:zstd.lib *.obj
@REM ===== build UPX =====
cd %BDIR%\upx
set s=%H%\src
cat .GITREV.txt
set /p GITREV=<.GITREV.txt
set UPX_DEFS=-DUPX_CONFIG_DISABLE_WSTRICT=0 -DUPX_CONFIG_DISABLE_WERROR=0 -DWITH_THREADS=0 -DWITH_BZIP2=0 -DWITH_ZSTD=0
set UPX_LIBS=%BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib
@rem set UPX_LIBS=%BDIR%\bzip2\bzip2.lib %BDIR%\ucl\ucl.lib %BDIR%\zlib\zlib.lib %BDIR%\zstd\zstd.lib
set sources=%s%\*.cpp %s%\check\*.cpp %s%\compress\*.cpp %s%\console\*.cpp %s%\filter\*.cpp %s%\util\*.cpp
%RUN_CL% -J -O2 -W4 -WX -std:c++17 -Zc:__cplusplus -EHsc -DUPX_VERSION_GITREV="""%GITREV%""" %DEFS% %UPX_DEFS% -I%H%\vendor -Feupx.exe %sources% %UPX_LIBS% /link ${{ matrix.link_machine_flags }} setargv.obj
- run: shopt -s globstar; ls -ld build/**/upx* || true
- run: shopt -s globstar; file build/**/upx* || true
- name: Make artifact
run: |
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-windows-bh-${{ matrix.name }}" | sed 's/[^0-9a-zA-Z_.-]/-/g')
mkdir -p "tmp/artifact/$N/$B"
cp -ai build/$C/$B/upx/upx*.exe "tmp/artifact/$N/$B"
#(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la && zstd -tq "$N.tar.zst")
(cd tmp/artifact && tar --sort=name --gzip -cf "$N.tar.gz" "$N" && rm -rf "./$N" && ls -la && gzip -tq "$N.tar.gz")
echo "artifact_name=$N" >> $GITHUB_ENV
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
uses: actions/upload-artifact@v5
with: { name: '${{ env.artifact_name }}', path: tmp/artifact }
- name: Mimic ctest tests
if: ${{ matrix.vsarch != 'amd64_arm64' }}
run: |
env -C build/$C/$B/upx upx_exe=./upx.exe bash "$PWD"/misc/testsuite/mimic_ctest.sh
- name: Run test suite
if: ${{ matrix.vsarch != 'amd64_arm64' }}
run: |
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
env -C build/$C/$B/upx upx_exe=./upx.exe bash "$PWD"/misc/testsuite/upx_testsuite_1.sh
job-linux-zigcc: # uses cmake + make
if: github.repository_owner == 'upx'
needs: [ job-rebuild-and-verify-stubs ]
strategy:
fail-fast: false
matrix:
include:
# only build a few selected targets => more targets are tested in the Weekly CI
- { zig_target: aarch64-linux-musl, qemu: qemu-aarch64 }
- { zig_target: aarch64-linux-musl, qemu: qemu-aarch64, zig_pic: -fPIE, container: 'alpine:3.18' }
- { zig_target: aarch64-macos-none }
- { zig_target: aarch64-windows-gnu }
- { zig_target: arm-linux-musleabihf, qemu: qemu-arm }
- { zig_target: armeb-linux-musleabihf, qemu: qemu-armeb }
- { zig_target: i386-linux-gnu.2.3.4, zig_flags: -march=i586 }
- { zig_target: i386-linux-gnu.2.17, zig_flags: -march=i586 }
- { zig_target: i386-linux-musl, zig_flags: -march=i586, qemu: qemu-i386 }
- { zig_target: i386-linux-musl, zig_flags: -march=i586, qemu: qemu-i386, zig_pic: -fPIE }
- { zig_target: i386-windows-gnu }
- { zig_target: mips-linux-musleabi, qemu: qemu-mips }
- { zig_target: mips-linux-musleabihf, qemu: qemu-mips }
- { zig_target: mipsel-linux-musleabi, qemu: qemu-mipsel }
- { zig_target: mipsel-linux-musleabihf, qemu: qemu-mipsel }
# { zig_target: mips-linux-musleabi-mips32r2, zig_flags: -march=mips32r2, qemu: qemu-mips }
# { zig_target: mips-linux-musleabi-mips32r3, zig_flags: -march=mips32r3, qemu: qemu-mips }
# { zig_target: mips-linux-musleabi-mips32r5, zig_flags: -march=mips32r5, qemu: qemu-mips }
# { zig_target: mips-linux-musleabi-mips32r6, zig_flags: -march=mips32r6, qemu: qemu-mips }
- { zig_target: powerpc-linux-musleabihf, qemu: qemu-ppc }
- { zig_target: powerpc64-linux-musl, qemu: qemu-ppc64 }
- { zig_target: powerpc64-linux-musl, qemu: qemu-ppc64, zig_pic: -fPIE }
- { zig_target: powerpc64le-linux-musl, qemu: qemu-ppc64le }
- { zig_target: powerpc64le-linux-musl, qemu: qemu-ppc64le, zig_pic: -fPIE }
- { zig_target: riscv64-linux-musl, qemu: qemu-riscv64, tt: UPX-UNSUPPORTED }
- { zig_target: riscv64-linux-musl, qemu: qemu-riscv64, tt: UPX-UNSUPPORTED, zig_pic: -fPIE }
- { zig_target: x86_64-linux-gnu.2.3.4, qemu: qemu-x86_64 } # can use QEMU because of gcompat
- { zig_target: x86_64-linux-gnu.2.17, qemu: qemu-x86_64 } # can use QEMU because of gcompat
- { zig_target: x86_64-linux-musl, qemu: qemu-x86_64 }
- { zig_target: x86_64-linux-musl, qemu: qemu-x86_64, zig_pic: -fPIE, container: 'alpine:3.18' }
- { zig_target: x86_64-macos-none }
- { zig_target: x86_64-windows-gnu }
name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }}
runs-on: ubuntu-latest
container: ${{ matrix.container || 'alpine:3.22' }}
env:
container: ${{ matrix.container || 'alpine:3.22' }}
UPX_CONFIG_HAVE_WORKING_BUILD_RPATH: ''
# for zig-cc wrapper scripts (see below):
ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING
ZIG_FLAGS: ${{ matrix.zig_flags }}
ZIG_PIC: ${{ matrix.zig_pic }}
ZIG_TARGET: ${{ matrix.zig_target }}
steps:
- run: uname -a; pwd; id; umask
shell: sh
- name: ${{ format('Install packages {0}', env.container) }}
shell: sh
run: |
apk update && apk upgrade && apk add bash cmake curl dmidecode file gdb git make parallel patch strace sudo tar util-linux xz zstd
# set PATH like in Ubuntu
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
git config --global --add safe.directory '*' # needed when running in a container
mkdir -p ~/.parallel && : > ~/.parallel/$(echo 6305-4721 | tr 0-7 leticlwi)
- run: (sudo dmidecode | sed -n -e '/System Information/,/^$/p') || true
- uses: actions/checkout@v6
with: { submodules: true }
- name: ${{ format('Install Zig {0}', env.ZIG_DIST_VERSION) }}
run: |
rev=$(git rev-parse --short=7 HEAD)
echo "UPX_GITREV_SHORT=$rev" >> $GITHUB_ENV
if [[ "${{ matrix.zig_target }}" == i386-linux-gnu.2.3.* ]]; then true;
echo "UPX_CONFIG_DISABLE_SHARED_LIBS=ON" >> $GITHUB_ENV # zig problem when linking in Debug mode
fi
if [[ "${{ matrix.zig_target }}" == x86_64-linux-gnu.2* ]]; then true;
echo "NEED_GCOMPAT=1" >> $GITHUB_ENV
# TODO FIXME: problem with self-packed upx and musl+gcompat: "Not a valid dynamic program"
echo "UPX_CONFIG_DISABLE_RUN_PACKED_TEST=ON" >> $GITHUB_ENV
fi
test -z "${{ matrix.tt }}" || echo "UPX_CONFIG_DISABLE_SELF_PACK_TEST=ON" >> $GITHUB_ENV
# install zig; note that ~/.local/bin is included in the default $PATH on Ubuntu
mkdir -p -v ~/.local/bin
cd ~/.local/bin
ZIG_DIST_VERSION=${ZIG_DIST_VERSION/#zig-/}
ZIG_DIST_NAME=zig-linux-x86_64-${ZIG_DIST_VERSION}
ZIG_DIST_NAME=zig-x86_64-linux-${ZIG_DIST_VERSION}
#curl -sS -L -O https://ziglang.org/builds/${ZIG_DIST_NAME}.tar.xz
#curl -sS -L -O https://ziglang.org/download/0.14.1/${ZIG_DIST_NAME}.tar.xz
curl -sS -L -O https://ziglang.org/download/0.15.2/${ZIG_DIST_NAME}.tar.xz
ls -l ${ZIG_DIST_NAME}.tar.xz
file ${ZIG_DIST_NAME}.tar.xz || true
tar -xoJf ${ZIG_DIST_NAME}.tar.xz
rm ${ZIG_DIST_NAME}.tar.xz
ln -s -v ${ZIG_DIST_NAME}/zig zig
#echo "PATH=$PATH" && which zig
echo -n 'zig version: '; zig version
# patch zig
ls -la "$HOME" "$GITHUB_WORKSPACE" || true
(cd ${ZIG_DIST_NAME} && patch --verbose -p1 -i "$GITHUB_WORKSPACE"/misc/patches/zig/0001-x.patch)
# create wrapper scripts (needed for CMake)
log=
log='set -x\n'
echo -e '#!/bin/sh\n'$log'exec zig ar "$@"' > zig-ar
echo -e '#!/bin/sh\n'$log'exec zig cc -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CFLAGS "$@"' > zig-cc
echo -e '#!/bin/sh\n'$log'exec zig c++ -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CXXFLAGS "$@"' > zig-cxx
echo -e '#!/bin/sh\n'$log'exec zig ranlib "$@"' > zig-ranlib
chmod +x zig-ar zig-cc zig-cxx zig-ranlib
ls -la; head zig-ar zig-cc zig-cxx zig-ranlib
# update ZIG_TARGET
[[ $ZIG_TARGET == mips-linux-musleabi-* ]] && ZIG_TARGET=mips-linux-musleabi
[[ $ZIG_TARGET == mips-linux-musleabihf-* ]] && ZIG_TARGET=mips-linux-musleabihf
[[ $ZIG_TARGET == mipsel-linux-musleabi-* ]] && ZIG_TARGET=mipsel-linux-musleabi
[[ $ZIG_TARGET == mipsel-linux-musleabihf-* ]] && ZIG_TARGET=mipsel-linux-musleabihf
ZIG_TARGET=${ZIG_TARGET/#i386-/x86-} # i386 => x86
echo "ZIG_TARGET=$ZIG_TARGET" >> $GITHUB_ENV
# update ZIG_FLAGS
# -fPIE is for compilation only => also use the correct linker flag "-pie"
# INFO: it seems the zig driver does handle this automatically(??), so not really needed
if test "X$ZIG_PIC" = "X-fPIE"; then true;
ZIG_FLAGS="$ZIG_FLAGS --start-no-unused-arguments -pie --end-no-unused-arguments"
echo "UPX_CONFIG_DISABLE_SHARED_LIBS=ON" >> $GITHUB_ENV # conflicts with ZIG_PIC/ZIG_FLAGS
fi
if [[ $ZIG_TARGET == *-linux-gnu.2.3.* ]]; then true;
# glibc-2.3.3: undefined symbols in Debug build: __snprintf_chk __vsnprintf_chk
# glibc-2.3.4: ld.lld: error: undefined symbol: openat64
ZIG_FLAGS="$ZIG_FLAGS -fno-sanitize=all"
echo "UPX_CONFIG_DISABLE_SANITIZE=ON" >> $GITHUB_ENV
fi
if [[ $ZIG_TARGET == *-linux-gnu.2.[456789] ]]; then true;
# glibc-2.x: ld.lld: error: undefined symbol: pwritev64
ZIG_FLAGS="$ZIG_FLAGS -fno-sanitize=all"
echo "UPX_CONFIG_DISABLE_SANITIZE=ON" >> $GITHUB_ENV
fi
echo "ZIG_FLAGS=$ZIG_FLAGS" >> $GITHUB_ENV
- run: set -x; zig version; zig-cc --version || true; zig-cxx --version || true
- run: zig-cc -E -x c -dM /dev/null # list predefined macros for C
- run: zig-cxx -E -x c++ -dM /dev/null # list predefined macros for C++
- name: ${{ format('Build Release with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }}
run: |
make UPX_XTARGET=zig/${ZIG_TARGET}${ZIG_PIC} xtarget/release \
CC="zig-cc" CXX="zig-cxx" CMAKE_AR="$HOME/.local/bin/zig-ar" CMAKE_RANLIB="$HOME/.local/bin/zig-ranlib"
- name: ${{ format('Build Debug with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }}
run: |
make UPX_XTARGET=zig/${ZIG_TARGET}${ZIG_PIC} xtarget/debug \
CC="zig-cc" CXX="zig-cxx" CMAKE_AR="$HOME/.local/bin/zig-ar" CMAKE_RANLIB="$HOME/.local/bin/zig-ranlib"
- run: ls -l build/*/*/*/upx* || true
- run: file build/*/*/*/upx* || true
- name: ${{ format('Make artifact from upx-{0}-{1}', github.ref_name, env.UPX_GITREV_SHORT) }}
run: |
N=$(echo "upx-${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}-zigcc-${{ matrix.zig_target }}${ZIG_PIC}" | sed 's/[^0-9a-zA-Z_.-]/-/g')
mkdir -p "tmp/artifact/$N"
if [[ "${{ matrix.zig_target }}" == *-linux* ]]; then
dirs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdir/$d" cmake --install build/zig/$d; done
for d in $dirs; do DESTDIR="$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithDestdirAndStrip/$d" cmake --install build/zig/$d --strip; done
for d in $dirs; do cmake --install build/zig/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefix/$d"; done
for d in $dirs; do cmake --install build/zig/$d --prefix "$PWD/tmp/artifact/$N/InstallWithCMake/InstallWithPrefixAndStrip/$d" --strip; done
fi
(cd build && shopt -s nullglob && cp -ai --parents */upx{,.exe} */*/*/upx{,.exe} "../tmp/artifact/$N")
if command -v hardlink >/dev/null; then (cd "tmp/artifact/$N" && hardlink .) fi
(cd tmp/artifact && tar --sort=name --zstd -cf "$N.tar.zst" "$N" && rm -rf "./$N" && ls -la && zstd -tq "$N.tar.zst")
echo "artifact_name=$N" >> $GITHUB_ENV
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
uses: actions/upload-artifact@v5
with: { name: '${{ env.artifact_name }}', path: tmp/artifact }
- name: Run install tests
if: ${{ contains(matrix.zig_target, '-linux') }}
run: |
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR="$PWD/Install with cmake" cmake --install .)
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR="$PWD/Install with make" make install)
- name: Run ctest tests
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
run: |
test -n "$NEED_GCOMPAT" && apk add gcompat
jobs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'make build/zig/{}+test' ::: $jobs
- name: Mimic ctest tests
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
run: |
test -n "$NEED_GCOMPAT" && apk add gcompat
jobs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/zig/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
- name: ${{ format('Mimic ctest tests with QEMU {0}', matrix.qemu) }}
if: ${{ matrix.qemu }}
run: |
qemu="${{ matrix.qemu }}"
apk add coreutils "${qemu%% *}"
test -n "$NEED_GCOMPAT" && apk add gcompat
export upx_exe_runner="$qemu"
jobs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/zig/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
- name: Mimic ctest tests with Valgrind
#if: ${{ matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
if: false
run: |
export UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS=ON # valgrind is SLOW
apk add coreutils valgrind
test -n "$NEED_GCOMPAT" && apk add gcompat
export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet --gen-suppressions=all"
upx_exe_runner="$upx_exe_runner --suppressions=$PWD/misc/valgrind/musl.supp"
jobs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/zig/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
- name: Run file system tests
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
run: |
apk add coreutils sudo
test -n "$NEED_GCOMPAT" && apk add gcompat
jobs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
echo "===== parallel jobs: $jobs"
parallel -kv --lb 'cd build/zig/{} && chmod a+w . && sudo -u nobody bash ../../../../misc/testsuite/test_symlinks.sh' ::: $jobs
@@ -0,0 +1,39 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# see https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues
# see https://github.com/actions/stale
# Automatically closing issues is far from perfect, but then we only
# have limited resources and this approach favors issues that people
# actually care about.
#
# also see:
# "Should I Stale or Should I Close? An Analysis of a Bot that Closes
# Abandoned Issues and Pull Request".
# https://igorwiese.com/images/papers/Paper_BotSE_19.pdf
name: GitHub - Close stale issues
on:
schedule: [cron: "50 0 * * 1"] # run weekly Monday 00:50 UTC
workflow_dispatch:
jobs:
job-close-stale-issues:
if: github.repository_owner == 'upx' && github.repository == 'upx/upx'
name: Close stale issues
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v10
with:
operations-per-run: 300
exempt-all-milestones: true
exempt-issue-labels: 'blocker,bug,enhancement,help wanted,regression'
days-before-stale: 90
days-before-close: 30
stale-issue-message: 'This issue is stale because it has been open for 90 days with no activity. Please remove the stale label or add a comment or this issue will be closed in 30 days.'
stale-pr-message: 'This PR is stale because it has been open for 90 days with no activity. Please remove the stale label or add a comment or this PR will be closed in 30 days.'
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.'
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity. Please feel free to reopen.'
repo-token: ${{ secrets.GITHUB_TOKEN }}
+62
View File
@@ -0,0 +1,62 @@
/.cache*
/.idea/
/.hg*
/.vscode*
/.zed/
/CMakeCache*
/CMakeFiles*
/CTest*
/Makevars[.-]global*
/Testing*
/build*
/maint*
/vendor*
GNUmakefile*
MMakefile*
Makevars[.-]local*
compile_commands*.json
compile_flags*.txt
Tmp*
tmp*
*.a
*.bz2
*.d
*.diff
*.dll
*.dylib
*.exe
*.gz
*.lib
*.map
*.o
*.obj
*.out
*.patch
*.py[cdo]
*.rar
*.so
*.swp
*.tmp
*.ttp
*.xz
*.zip
*.zst
/doc/*.man
/doc/*.ps
/doc/*.tex
/src/stub/**/.*-stamp
/src/stub/src/**/tmp*/*
/src/stub/tmp*/*.bin
/src/stub/tmp*/*.bin.bindump
/src/stub/tmp*/*.bin.disasm
/src/stub/tmp*/*.o.disasm
/src/stub/tmp*/mips.r3000-*.[is]
/src/stub/tmp*/mipsel.r3000-*.[is]
/src/stub/tools/sstrip/amd64-linux-sstrip
/src/stub/tools/sstrip/i386-linux-sstrip
/src/stub/tools/sstrip/sstrip
+25
View File
@@ -0,0 +1,25 @@
[submodule "vendor/doctest"]
path = vendor/doctest
url = https://github.com/upx/upx-vendor-doctest.git
branch = upx-vendor
shallow = true
[submodule "vendor/lzma-sdk"]
path = vendor/lzma-sdk
url = https://github.com/upx/upx-vendor-lzma-sdk.git
branch = upx-vendor
shallow = true
[submodule "vendor/ucl"]
path = vendor/ucl
url = https://github.com/upx/upx-vendor-ucl.git
branch = upx-vendor
shallow = true
[submodule "vendor/valgrind"]
path = vendor/valgrind
url = https://github.com/upx/upx-vendor-valgrind.git
branch = upx-vendor
shallow = true
[submodule "vendor/zlib"]
path = vendor/zlib
url = https://github.com/upx/upx-vendor-zlib.git
branch = upx-vendor
shallow = true
+539
View File
@@ -0,0 +1,539 @@
#
# UPX "CMake" build file; see https://cmake.org/
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# Build requirements:
# A C++ compiler that fully implements C++17: clang-5, gcc-8 or msvc-2019-16.11
# (older or other compilers may work but are unsupported, use at your own risk)
# Sections of this CMakeLists.txt:
# - options
# - init
# - common compilation flags
# - targets
# - target compilation flags
# - test
# - install
# - print summary
# CMake version check; using a somewhat current CMake version is highly recommended
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/.upx_cmake_config_done.txt")
if(DEFINED UPX_CONFIG_CMAKE_MINIMUM_REQUIRED_VERSION)
cmake_minimum_required(VERSION "${UPX_CONFIG_CMAKE_MINIMUM_REQUIRED_VERSION}" FATAL_ERROR)
elseif(NOT ${CMAKE_VERSION} VERSION_LESS "3.10")
cmake_minimum_required(VERSION "3.10" FATAL_ERROR)
else()
cmake_minimum_required(VERSION "3.8" FATAL_ERROR) # CMake >= 3.8 is needed for CXX_STANDARD 17
endif()
# support functions and some utility
include("${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/functions.cmake")
upx_print_var(CMAKE_VERSION UPX_CONFIG_CMAKE_MINIMUM_REQUIRED_VERSION CMAKE_GENERATOR)
upx_print_var(CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_PLATFORM)
upx_print_env_var(CC CXX CPPFLAGS CFLAGS CXXFLAGS)
#***********************************************************************
# options
#***********************************************************************
upx_cmake_include_hook(1_options)
# compilation config options
if(NOT USE_STRICT_DEFAULTS)
# permissive config defaults when building from source code tarball
option(UPX_CONFIG_DISABLE_GITREV "Do not compile with Git version info." ON)
option(UPX_CONFIG_DISABLE_SANITIZE "Do not compile with sanitize options." ON)
option(UPX_CONFIG_DISABLE_WERROR "Do not compile with -Werror option." ON)
option(UPX_CONFIG_DISABLE_WSTRICT "Do not compile with strict compiler warnings." ON)
else()
# strict config defaults for Git developer builds
message(STATUS "===== UPX NOTE: strict developer config defaults enabled =====")
option(UPX_CONFIG_DISABLE_GITREV "Do not compile with Git version info." OFF)
option(UPX_CONFIG_DISABLE_SANITIZE "Do not compile with sanitize options." OFF)
option(UPX_CONFIG_DISABLE_WERROR "Do not compile with -Werror option." OFF)
option(UPX_CONFIG_DISABLE_WSTRICT "Do not compile with strict compiler warnings." OFF)
endif()
# test config options (see below)
# IMPORTANT NOTE: self-pack test can only work if the host executable format is supported by UPX!
option(UPX_CONFIG_DISABLE_SELF_PACK_TEST "Do not test packing UPX with itself." OFF)
option(UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS "Do not run exhaustive tests." OFF)
#***********************************************************************
# init
#***********************************************************************
set(UPX_VERSION_STRING "5.1.0") # this should match src/version.h
upx_cmake_include_hook(2_init)
# Disallow in-source build. Note that you will still have to manually
# clean up a few files if you accidentally try an in-source build.
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
upx_disallow_in_source_build()
endif()
# global settings
if(${CMAKE_VERSION} VERSION_GREATER "3.14.99" AND NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
cmake_policy(SET CMP0091 NEW)
endif()
# global CMake settings that default to ON
upx_cache_bool_vars(ON
CMAKE_C_STANDARD_REQUIRED CMAKE_CXX_STANDARD_REQUIRED
CMAKE_EXPORT_COMPILE_COMMANDS CMAKE_REQUIRED_QUIET
)
# internal UPX settings that default to OFF; useful for CI jobs
upx_cache_bool_vars(OFF
UPX_CONFIG_CMAKE_DISABLE_TEST UPX_CONFIG_CMAKE_DISABLE_INSTALL
UPX_CONFIG_CMAKE_DISABLE_PRINT_INFO UPX_CONFIG_CMAKE_DISABLE_PLATFORM_CHECK
UPX_CONFIG_DISABLE_C_STANDARD UPX_CONFIG_DISABLE_CXX_STANDARD
UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST UPX_CONFIG_DISABLE_RUN_PACKED_TEST
UPX_CONFIG_DISABLE_SAVE_TEMPS UPX_CONFIG_DISABLE_SHARED_LIBS UPX_CONFIG_REQUIRE_THREADS
)
upx_cache_bool_vars(ON UPX_CONFIG_EXPECT_THREADS)
# determine Git revision
set(GITREV_SHORT "")
set(GITREV_PLUS "")
set(GIT_DESCRIBE "")
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND NOT UPX_CONFIG_DISABLE_GITREV)
find_package(Git)
if(Git_FOUND)
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse --short=12 HEAD
RESULT_VARIABLE result ERROR_QUIET
OUTPUT_VARIABLE GITREV_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(LENGTH "${GITREV_SHORT}" l)
if(${result} EQUAL 0 AND ${l} EQUAL 12)
execute_process(RESULT_VARIABLE result COMMAND "${GIT_EXECUTABLE}" diff --quiet)
if(NOT ${result} EQUAL 0)
set(GITREV_PLUS "+")
endif()
else()
set(GITREV_SHORT "")
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --match "v*.*.*" --tags --dirty
RESULT_VARIABLE result ERROR_QUIET
OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(GIT_DESCRIBE MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-g(.+)$")
set(GIT_DESCRIBE "${CMAKE_MATCH_1}-devel.${CMAKE_MATCH_2}+git-${CMAKE_MATCH_3}")
endif()
endif()
endif()
if(GITREV_SHORT)
message(STATUS "UPX_VERSION_GITREV = \"${GITREV_SHORT}${GITREV_PLUS}\"")
if(GIT_DESCRIBE)
message(STATUS "UPX_VERSION_GIT_DESCRIBE = \"${GIT_DESCRIBE}\"")
endif()
elseif(UPX_CONFIG_DISABLE_GITREV)
message(STATUS "UPX_VERSION_GITREV: disabled")
else()
message(STATUS "UPX_VERSION_GITREV: not set")
endif()
# CMake init
upx_set_default_build_type(Release) # default is CMAKE_BUILD_TYPE=Release
project(upx VERSION "${UPX_VERSION_STRING}" LANGUAGES C CXX)
upx_apply_build_type()
upx_set_global_vars()
upx_check_working_build_rpath(UPX_CONFIG_HAVE_WORKING_BUILD_RPATH)
if(DEFINED UPX_CONFIG_CMAKE_EXECUTABLE_SUFFIX)
set(CMAKE_EXECUTABLE_SUFFIX "${UPX_CONFIG_CMAKE_EXECUTABLE_SUFFIX}")
endif()
if(NOT UPX_CONFIG_CMAKE_DISABLE_INSTALL AND CMAKE_INSTALL_PREFIX)
include(GNUInstallDirs)
endif()
#***********************************************************************
# common compilation flags
#***********************************************************************
include(CheckCCompilerFlag)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CheckTypeSize)
upx_cmake_include_hook(3_common_compilation_flags)
# assert sane type sizes
check_type_size("size_t" C_SIZEOF_SIZE_T LANGUAGE C)
check_type_size("size_t" CXX_SIZEOF_SIZE_T LANGUAGE CXX)
if(NOT "${C_SIZEOF_SIZE_T}" MATCHES "^(4|8|16)$")
message(FATAL_ERROR "ERROR: unexpected C_SIZEOF_SIZE_T '${C_SIZEOF_SIZE_T}'")
endif()
if(NOT ",${C_SIZEOF_SIZE_T}," STREQUAL ",${CXX_SIZEOF_SIZE_T},")
message(FATAL_ERROR "FATAL ERROR: '${C_SIZEOF_SIZE_T}' '${CXX_SIZEOF_SIZE_T}' mismatch")
endif()
if(NOT DEFINED HAVE_UNISTD_H)
check_include_file("unistd.h" HAVE_UNISTD_H)
endif()
if(NOT DEFINED HAVE_UTIMENSAT)
# proper checking for utimensat() is somewhat messy
check_function_exists(utimensat HAVE_UTIMENSAT_FUNCTION__)
if(HAVE_UTIMENSAT_FUNCTION__)
check_symbol_exists(utimensat "sys/types.h;fcntl.h;sys/stat.h" HAVE_UTIMENSAT_SYMBOL__)
if(HAVE_UTIMENSAT_SYMBOL__)
CHECK_STRUCT_HAS_MEMBER("struct stat" "st_mtim.tv_nsec" "sys/types.h;fcntl.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) # POSIX.1-2008
if(NOT HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
CHECK_STRUCT_HAS_MEMBER("struct stat" "st_mtimespec.tv_nsec" "sys/types.h;fcntl.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC) # macOS
endif()
if(HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC OR HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
set(HAVE_UTIMENSAT 1)
endif()
endif()
endif()
endif()
if(UPX_CONFIG_DISABLE_WSTRICT)
# enable all basic warnings
set(warn_Wall -Wall)
set(warn_WN -W3)
else()
# enable all basic warnings, and enable lots of strict warnings
set(warn_Wall -Wall -Wextra -Wcast-align -Wcast-qual -Wmissing-declarations -Wpointer-arith -Wshadow -Wvla -Wwrite-strings)
set(warn_WN -W4)
endif()
if(UPX_CONFIG_DISABLE_WERROR)
# warnings are just warnings
set(warn_Werror "")
set(warn_WX "")
else()
# warnings are fatal errors; annoy developers to keep the source code warning-free
set(warn_Werror -Werror)
set(warn_WX -WX)
endif()
if(MSVC_FRONTEND)
# disable warning C5105 which may get triggered by some older versions of <windows.h>
set(warn_WX -wd5105 ${warn_WX})
endif()
if(NOT CMAKE_C_COMPILER_ID MATCHES "^MSVC")
# use -O2 instead of -O3 to reduce code size
string(REGEX REPLACE "(^| )-O3( |$$)" "\\1-O2\\2" a "${CMAKE_C_FLAGS_RELEASE}")
string(REGEX REPLACE "(^| )-O3( |$$)" "\\1-O2\\2" b "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELEASE "${a}" CACHE STRING "Flags used by the C compiler during RELEASE builds." FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "${b}" CACHE STRING "Flags used by the CXX compiler during RELEASE builds." FORCE)
endif()
if(MSVC_FRONTEND OR WIN32 OR MINGW OR CYGWIN)
# disable silly warnings about using "deprecated" POSIX functions like fopen()
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_DEPRECATE)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D__USE_MINGW_ANSI_STDIO)
endif()
if(MSVC_FRONTEND)
# use -funsigned-char; set __cplusplus according to selected C++ standard
add_definitions(-J -Zc:__cplusplus)
if(CMAKE_C_COMPILER_ID MATCHES "^MSVC")
upx_add_definitions(-Zc:preprocessor) # use new preprocessor
endif()
endif()
if(NOT CMAKE_C_COMPILER_ID MATCHES "^MSVC")
# protect against security threats caused by misguided compiler "optimizations"
upx_add_definitions(-fno-delete-null-pointer-checks -fno-lifetime-dse)
upx_add_definitions(-fno-strict-aliasing -fno-strict-overflow -funsigned-char)
# disable overambitious auto-vectorization until this actually gains something
upx_add_definitions(-fno-tree-vectorize)
# disable annoying clang warnings which get added by the macOS Xcode cmake generator
if(CMAKE_GENERATOR MATCHES "Xcode")
upx_add_definitions(-Wno-shorten-64-to-32)
endif()
endif()
# examine compiler configuration
if(NOT UPX_CONFIG_CMAKE_DISABLE_PRINT_INFO)
upx_print_common_symbols()
upx_print_mingw_symbols()
endif()
#***********************************************************************
# targets
#***********************************************************************
# internal settings; these may change in a future versions
set(UPX_CONFIG_DISABLE_THREADS ON) # multithreading is currently not used; maybe in UPX version 6
set(UPX_CONFIG_DISABLE_BZIP2 ON) # bzip2 is currently not used; we might need it to decompress linux kernels
set(UPX_CONFIG_DISABLE_ZSTD ON) # zstd is currently not used; maybe in UPX version 6
upx_cmake_include_hook(4_targets)
if(NOT UPX_CONFIG_DISABLE_THREADS)
find_package(Threads)
endif()
# make sure that threads are indeed fully supported in C++
if(Threads_FOUND)
foreach(f std_lock_guard.cpp types_abi.cpp)
set(CMAKE_TRY_COMPILE_TARGET_TYPE "EXECUTABLE")
if(NOT UPX_CONFIG_DISABLE_CXX_STANDARD)
try_compile(result "${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/try_compile/${f}"
OUTPUT_VARIABLE output CXX_STANDARD 17)
else()
try_compile(result "${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/try_compile/${f}"
OUTPUT_VARIABLE output)
endif()
if(NOT result)
# failed; under MinGW be sure to use the posix-threads and NOT the win32-threads version
if(UPX_CONFIG_REQUIRE_THREADS OR (UPX_CONFIG_EXPECT_THREADS AND NOT UPX_CONFIG_DISABLE_THREADS))
message(WARNING "Threads FAILED ${f}: ${output}") # output from try_compile()
endif()
set(Threads_FOUND OFF)
break()
endif()
endforeach()
endif()
if(NOT UPX_CONFIG_DISABLE_BZIP2)
upx_add_glob_files(bzip2_SOURCES "vendor/bzip2/*.c")
add_library(upx_vendor_bzip2 STATIC ${bzip2_SOURCES})
if(NOT UPX_CONFIG_DISABLE_C_STANDARD)
set_property(TARGET upx_vendor_bzip2 PROPERTY C_STANDARD 11)
endif()
endif() # UPX_CONFIG_DISABLE_BZIP2
upx_add_glob_files(ucl_SOURCES "vendor/ucl/src/*.c")
add_library(upx_vendor_ucl STATIC ${ucl_SOURCES})
if(NOT UPX_CONFIG_DISABLE_C_STANDARD)
set_property(TARGET upx_vendor_ucl PROPERTY C_STANDARD 11)
endif()
upx_add_glob_files(zlib_SOURCES "vendor/zlib/*.c")
add_library(upx_vendor_zlib STATIC ${zlib_SOURCES})
if(NOT UPX_CONFIG_DISABLE_C_STANDARD)
set_property(TARGET upx_vendor_zlib PROPERTY C_STANDARD 11)
endif()
if(NOT UPX_CONFIG_DISABLE_ZSTD)
upx_add_glob_files(zstd_SOURCES "vendor/zstd/lib/*/*.c")
add_library(upx_vendor_zstd STATIC ${zstd_SOURCES})
if(NOT UPX_CONFIG_DISABLE_C_STANDARD)
set_property(TARGET upx_vendor_zstd PROPERTY C_STANDARD 11)
endif()
endif() # UPX_CONFIG_DISABLE_ZSTD
upx_add_glob_files(upx_SOURCES "src/*.cpp" "src/[cfu]*/*.cpp")
add_executable(upx ${upx_SOURCES})
if(NOT UPX_CONFIG_DISABLE_CXX_STANDARD)
set_property(TARGET upx PROPERTY CXX_STANDARD 17)
endif()
target_link_libraries(upx upx_vendor_ucl upx_vendor_zlib)
if(NOT UPX_CONFIG_DISABLE_BZIP2)
target_link_libraries(upx upx_vendor_bzip2)
endif()
if(NOT UPX_CONFIG_DISABLE_ZSTD)
target_link_libraries(upx upx_vendor_zstd)
endif()
if(Threads_FOUND)
target_link_libraries(upx Threads::Threads)
endif()
#***********************************************************************
# target compilation flags
#***********************************************************************
upx_cmake_include_hook(5_target_compilation_flags)
if(NOT UPX_CONFIG_DISABLE_BZIP2)
set(t upx_vendor_bzip2)
upx_compile_target_debug_with_O2(${t})
upx_sanitize_target(${t})
target_compile_definitions(${t} PRIVATE BZ_NO_STDIO=1)
if(MSVC_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_WN} -wd4127 -wd4244 -wd4267 ${warn_WX})
elseif(GNU_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_Wall} ${warn_Werror})
endif()
upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_BZIP2)
endif() # UPX_CONFIG_DISABLE_BZIP2
set(t upx_vendor_ucl)
target_include_directories(${t} PRIVATE vendor/ucl/include vendor/ucl)
upx_compile_target_debug_with_O2(${t})
upx_sanitize_target(${t})
if(MSVC_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_WN} ${warn_WX})
elseif(GNU_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_Wall} ${warn_Werror})
endif()
upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_UCL)
set(t upx_vendor_zlib)
target_include_directories(${t} PRIVATE vendor/zlib)
upx_compile_target_debug_with_O2(${t})
upx_sanitize_target(${t})
target_compile_definitions(${t} PRIVATE HAVE_VSNPRINTF=1)
if(HAVE_UNISTD_H)
target_compile_definitions(${t} PRIVATE HAVE_UNISTD_H=1)
endif()
if(MSVC_FRONTEND)
target_compile_options(${t} PRIVATE -W3 ${warn_WX})
elseif(GNU_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_Wall} -Wno-cast-align -Wno-cast-qual ${warn_Werror})
endif()
upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZLIB)
if(NOT UPX_CONFIG_DISABLE_ZSTD)
set(t upx_vendor_zstd)
upx_compile_target_debug_with_O2(${t})
upx_sanitize_target(${t})
target_compile_definitions(${t} PRIVATE DYNAMIC_BMI2=0 ZSTD_DISABLE_ASM=1)
if(MSVC_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_WN} ${warn_WX})
elseif(GNU_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_Wall} ${warn_Werror})
endif()
upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZSTD)
endif() # UPX_CONFIG_DISABLE_ZSTD
set(t upx)
target_include_directories(${t} PRIVATE vendor)
target_compile_definitions(${t} PRIVATE $<$<CONFIG:Debug>:DEBUG=1>)
if(GITREV_SHORT)
target_compile_definitions(${t} PRIVATE UPX_VERSION_GITREV="${GITREV_SHORT}${GITREV_PLUS}")
if(GIT_DESCRIBE)
target_compile_definitions(${t} PRIVATE UPX_VERSION_GIT_DESCRIBE="${GIT_DESCRIBE}")
endif()
endif()
if(Threads_FOUND)
target_compile_definitions(${t} PRIVATE WITH_THREADS=1)
endif()
if(NOT UPX_CONFIG_DISABLE_WSTRICT)
target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WSTRICT=0)
endif()
if(NOT UPX_CONFIG_DISABLE_WERROR)
target_compile_definitions(${t} PRIVATE UPX_CONFIG_DISABLE_WERROR=0)
endif()
if(NOT UPX_CONFIG_DISABLE_BZIP2)
target_compile_definitions(${t} PRIVATE WITH_BZIP2=1)
endif()
if(NOT UPX_CONFIG_DISABLE_ZSTD)
target_compile_definitions(${t} PRIVATE WITH_ZSTD=1)
endif()
if(HAVE_UTIMENSAT)
target_compile_definitions(${t} PRIVATE USE_UTIMENSAT=1)
if(HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
target_compile_definitions(${t} PRIVATE HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC=1)
endif()
endif()
# improve speed of the Debug versions
upx_compile_source_debug_with_O2(src/compress/compress_lzma.cpp)
upx_compile_source_debug_with_O2(src/filter/filter_impl.cpp)
#upx_compile_target_debug_with_O2(${t})
upx_sanitize_target(${t})
if(MSVC_FRONTEND)
target_compile_options(${t} PRIVATE -EHsc ${warn_WN} ${warn_WX})
elseif(GNU_FRONTEND)
target_compile_options(${t} PRIVATE ${warn_Wall} ${warn_Werror})
endif()
upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_UPX)
#***********************************************************************
# test
# ctest
# make test
# ninja test
#***********************************************************************
upx_cmake_include_hook(6_test)
if(NOT UPX_CONFIG_CMAKE_DISABLE_TEST)
add_custom_command(TARGET upx POST_BUILD COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/XTesting/$<CONFIG>")
include(CTest)
if(NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR)
upx_add_test(upx-version upx --version)
upx_add_test(upx-version-short upx --version-short)
upx_add_test(upx-license upx --license)
upx_add_test(upx-help-1 upx --help)
upx_add_test(upx-help-2 upx --help-short)
upx_add_test(upx-help-3 upx --help-verbose)
upx_add_test(upx-sysinfo-1 upx --sysinfo)
upx_add_test(upx-sysinfo-2 upx --sysinfo -v)
upx_add_test(upx-sysinfo-3 upx --sysinfo -vv)
if(NOT UPX_CONFIG_DISABLE_SELF_PACK_TEST)
# IMPORTANT NOTE: these tests can only work if the host executable format
# is supported by UPX!
include("${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/self_pack_test.cmake")
upx_self_pack_test()
endif()
endif()
endif() # UPX_CONFIG_CMAKE_DISABLE_TEST
#***********************************************************************
# install
# cmake --install .
# make install
# ninja install
#***********************************************************************
upx_cmake_include_hook(7_install)
if(NOT UPX_CONFIG_CMAKE_DISABLE_INSTALL)
# installation prefix and directories
if(NOT CMAKE_INSTALL_PREFIX)
#message(FATAL_ERROR "ERROR: CMAKE_INSTALL_PREFIX is not defined")
message(WARNING "WARNING: CMAKE_INSTALL_PREFIX is not defined")
endif()
# install files
if(CMAKE_INSTALL_PREFIX AND DEFINED CMAKE_INSTALL_BINDIR)
install(TARGETS upx DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES
COPYING LICENSE NEWS README doc/THANKS.txt doc/upx-doc.html doc/upx-doc.txt
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
)
install(FILES doc/upx.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
endif()
endif() # UPX_CONFIG_CMAKE_DISABLE_INSTALL
#***********************************************************************
# summary
# print some info about the build configuration
#***********************************************************************
upx_cmake_include_hook(8_summary)
upx_print_var(CMAKE_VERSION UPX_CONFIG_CMAKE_MINIMUM_REQUIRED_VERSION CMAKE_GENERATOR)
if(NOT UPX_CONFIG_CMAKE_DISABLE_PRINT_INFO)
# print detailed info
include("${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/print_info.cmake")
upx_print_info()
endif()
upx_print_var(CMAKE_INSTALL_PREFIX CMAKE_CONFIGURATION_TYPES CMAKE_TRY_COMPILE_CONFIGURATION CMAKE_BUILD_TYPE)
if(Threads_FOUND)
message(STATUS "WITH_THREADS = 1")
elseif(UPX_CONFIG_REQUIRE_THREADS)
message(FATAL_ERROR "ERROR: WITH_THREADS required")
elseif(UPX_CONFIG_EXPECT_THREADS AND NOT UPX_CONFIG_DISABLE_THREADS)
message(FATAL_ERROR "ERROR: WITH_THREADS expected; set UPX_CONFIG_EXPECT_THREADS=OFF")
endif()
if(CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|None|Release)$")
message(WARNING "WARNING: unsupported CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}; please use \"Debug\" or \"Release\"")
endif()
# extra sanity checks to detect incompatible C vs CXX settings
if(NOT UPX_CONFIG_CMAKE_DISABLE_PLATFORM_CHECK)
upx_platform_check_c_cxx_mismatch()
endif()
upx_cmake_include_hook(9_finish)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/.upx_cmake_config_done.txt" "")
# vim:set ft=cmake ts=4 sw=4 tw=0 et:
+14 -15
View File
@@ -1,8 +1,8 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+101 -29
View File
@@ -1,36 +1,108 @@
# Toplevel Makefile for UPX
#
# UPX top-level Makefile - needs GNU make and CMake >= 3.13
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
SHELL = /bin/sh
# INFO: this Makefile is just a convenience wrapper for calling CMake
srcdir = .
top_srcdir = .
# HINT: if you only have an older CMake 3.x then you can invoke cmake manually like this:
# mkdir -p build/release
# cd build/release
# cmake ../.. # run config
# make -j4 # and run build
CMAKE = cmake
UPX_CMAKE_BUILD_FLAGS += --parallel
ifneq ($(VERBOSE),)
#UPX_CMAKE_BUILD_FLAGS += --verbose # requires CMake >= 3.14
UPX_CMAKE_CONFIG_FLAGS += -DCMAKE_VERBOSE_MAKEFILE=ON
endif
# enable this if you prefer Ninja for the actual builds:
#UPX_CMAKE_CONFIG_FLAGS += -G Ninja
default:
@echo "UPX info: please choose a target for 'make'"
#***********************************************************************
# default
#***********************************************************************
all mostlyclean clean distclean maintainer-clean:
$(MAKE) -C src/stub/util/sstrip $@
$(MAKE) -C src/stub $@
.DEFAULT_GOAL = build/release
.NOTPARALLEL: # because the actual builds use "cmake --parallel"
.PHONY: PHONY
.SECONDEXPANSION:
.SUFFIXES:
run_cmake_config = $(CMAKE) -S . -B "$1" $(UPX_CMAKE_CONFIG_FLAGS) -DCMAKE_BUILD_TYPE="$2"
run_cmake_build = $(CMAKE) --build "$1" $(UPX_CMAKE_BUILD_FLAGS) --config "$2"
# avoid re-running run_cmake_config if .upx_cmake_config_done.txt already exists
run_config = $(if $(wildcard $1/CMakeFiles/.*_cmake_config_done.txt),,$(call run_cmake_config,$1,$2))
run_build = $(call run_cmake_build,$1,$2)
build/debug: PHONY
$(call run_config,$@,Debug)
$(call run_build,$@,Debug)
build/release: PHONY
$(call run_config,$@,Release)
$(call run_build,$@,Release)
# shortcuts (all => debug + release)
debug: build/debug PHONY
release: build/release PHONY
all build/all: build/debug build/release PHONY
build/%/all: $$(dir $$@)debug $$(dir $$@)release PHONY ;
#***********************************************************************
# test
#***********************************************************************
CTEST = ctest
CTEST_JOBS ?= 8
CTEST_FLAGS = --output-on-failure --parallel $(CTEST_JOBS)
build/debug+test: $$(dir $$@)debug PHONY; cd "$(dir $@)debug" && $(CTEST) $(CTEST_FLAGS) -C Debug
build/%/debug+test: $$(dir $$@)debug PHONY; cd "$(dir $@)debug" && $(CTEST) $(CTEST_FLAGS) -C Debug
build/release+test: $$(dir $$@)release PHONY; cd "$(dir $@)release" && $(CTEST) $(CTEST_FLAGS) -C Release
build/%/release+test: $$(dir $$@)release PHONY; cd "$(dir $@)release" && $(CTEST) $(CTEST_FLAGS) -C Release
build/%/all+test: $$(dir $$@)debug+test $$(dir $$@)release+test PHONY ;
# shortcuts
debug+test: build/debug+test PHONY
release+test: build/release+test PHONY
all+test build/all+test: build/debug+test build/release+test PHONY
test: $$(patsubst %+test,%,$$(.DEFAULT_GOAL))+test PHONY
#***********************************************************************
# install
#***********************************************************************
build/debug+install: $$(dir $$@)debug PHONY; cd "$(dir $@)debug" && $(CMAKE) --install . --config Debug
build/%/debug+install: $$(dir $$@)debug PHONY; cd "$(dir $@)debug" && $(CMAKE) --install . --config Debug
build/release+install: $$(dir $$@)release PHONY; cd "$(dir $@)release" && $(CMAKE) --install . --config Release
build/%/release+install: $$(dir $$@)release PHONY; cd "$(dir $@)release" && $(CMAKE) --install . --config Release
build/%/all+install: $$(dir $$@)debug+install $$(dir $$@)release+install PHONY ;
# shortcuts
debug+install: build/debug+install PHONY
release+install: build/release+install PHONY
all+install build/all+install: build/debug+install build/release+install PHONY
install: $$(patsubst %+install,%,$$(.DEFAULT_GOAL))+install PHONY
#***********************************************************************
# END of Makefile
#***********************************************************************
# extra pre-defined build configurations and some utility; optional
-include ./Makevars-local.mk
-include ./misc/make/Makefile-extra.mk
# developer convenience
ifneq ($(wildcard /usr/bin/env),) # need Unix utils like bash, perl, sed, xargs, etc.
ifneq ($(and $(wildcard ./misc/scripts/.),$(wildcard ./doc/upx.pod)),)
check-whitespace clang-format run-testsuite run-testsuite-all run-testsuite-debug run-testsuite-release: src/Makefile PHONY
$(MAKE) -C src $@
$(MAKE) -C doc $@
dist: distclean
false
zip:
cd .. && rm -f upx-current.zip && zip -r upx-current.zip upx
cvs-admin-ko:
cvs admin -ko .
cvs update -P -d
ChangeLog:
perl $(srcdir)/scripts/cvs2cl.pl --utc -f ChangeLog.cvs
.PHONY: all mostlyclean clean distclean maintainer-clean
.PHONY: dist cvs-admin-ko ChangeLog
.NOEXPORT:
endif
endif
# vim:set ts=8 sw=8 noet:
+292 -36
View File
@@ -2,11 +2,267 @@
User visible changes for UPX
==================================================================
[ UNSTABLE BETA VERSION - please see README.1ST for some more info ]
Changes in 5.1.0 (XX XXX XXXX):
* bug fixes - see https://github.com/upx/upx/milestone/21
Changes in 5.0.2 (20 Jul 2025):
* bug fixes - see https://github.com/upx/upx/milestone/20
Changes in 5.0.1 (06 May 2025):
* bug fixes - see https://github.com/upx/upx/milestone/19
Changes in 5.0.0 (20 Feb 2025):
* ELF: use of memfd_create supports Enforcing mode of SELinux
* ELF: two-step de-compression enables future per-PT_LOAD work
* ELF: --unmap-all-pages completely avoids /proc/self/exe
* ELF: PT_MIPS_ABIFLAGS is now forwarded into the compressed output;
qemu-mips can choose the right floating-point emulation
* ELF: many minor internal changes fix nits revealed by fuzzing
* bug fixes - see https://github.com/upx/upx/milestone/18
Changes in 4.2.4 (09 May 2024):
* bug fixes - see https://github.com/upx/upx/milestone/17
Changes in 4.2.3 (27 Mar 2024):
* bug fixes - see https://github.com/upx/upx/milestone/16
Changes in 4.2.2 (03 Jan 2024):
* bug fixes - see https://github.com/upx/upx/milestone/15
Changes in 4.2.1 (01 Nov 2023):
* linux: /proc/self/exe now is optional
* windows: use SetFileTime to preserve sub-second file timestamps
* official Windows builds: revert activeCodePage change introduced in 4.2.0
* bug fixes - see https://github.com/upx/upx/milestone/14
Changes in 4.2.0 (26 Oct 2023):
* win32/pe and win64/pe: stricter relocation checks; please report regressions
* unix: use utimensat to preserve sub-second file timestamps
* new option '--link' to preserve hard-links (Unix only; use with care)
* add support for NO_COLOR env var; see https://no-color.org/
* disable macOS support until we fix compatibility with macOS 13+
* official Windows builds: set activeCodePage to UTF-8
* bug fixes - see https://github.com/upx/upx/milestone/13
Changes in 4.1.0 (08 Aug 2023):
* ELF: handle shared libraries with more than 2 PT_LOAD segments
* bug fixes - see https://github.com/upx/upx/milestone/11
Changes in 4.0.2 (30 Jan 2023):
* bug fixes - see https://github.com/upx/upx/milestone/9
Changes in 4.0.1 (16 Nov 2022):
* bug fixes - see https://github.com/upx/upx/milestone/8
Changes in 4.0.0 (28 Oct 2022):
* Switch to semantic versioning
* SECURITY NOTES: emphasize the security context in the docs
* Support easy building from source code with CMake
* Support easy rebuilding the stubs from source with Podman/Docker
* Add integrated doctest C++ testing framework
* Add support for EFI files (PE x86; Kornel Pal)
* win32/pe and win64/pe: set correct SizeOfHeaders in the PE header
* bug fixes - see https://github.com/upx/upx/milestone/6
* bug fixes - see https://github.com/upx/upx/milestone/7
Changes in 3.96 (23 Jan 2020):
* bug fixes - see https://github.com/upx/upx/milestone/5
Changes in 3.95 (26 Aug 2018):
* Flag --android-shlib to work around bad design in Android
* Flag --force-pie when ET_DYN main program is not marked as DF_1_PIE
* Better compatibility with varying layout of address space on Linux
* Support for 4 PT_LOAD layout in ELF generated by binutils-2.31
* bug fixes, particularly better diagnosis of malformed input
* bug fixes - see https://github.com/upx/upx/milestone/4
Changes in 3.94 (12 May 2017):
* Add support for arm64-linux (aka "aarch64").
* Add support for --lzma compression on 64-bit PowerPC (Thierry Fauck).
* For Mach, "upx -d" will unpack a prefix of the file (and warn).
* Various improvements to the ELF formats.
* bug fixes - see https://github.com/upx/upx/milestone/3
Changes in 3.93 (29 Jan 2017):
* Fixed some win32/pe and win64/pe regressions introduced in 3.92
* bug fixes - see https://github.com/upx/upx/milestone/2
Changes in 3.92 (11 Dec 2016):
* INFO: UPX has moved to GitHub - the new home page is https://upx.github.io
* IMPORTANT: all PE formats: internal changes: reunited the diverged source
files - please report all regressions into the bug tracker and try UPX 3.91
in case of problems.
* Support Apple MacOS 10.12 "Sierra", including more-robust de-compression.
* Explicitly diagnose Go-language bad PT_LOAD; recommend hemfix.c.
https://sourceforge.net/p/upx/bugs/195/ https://github.com/pwaller/goupx
* Fix CERT-FI Case 829767 UPX command line tools segfaults.
Received by UPX Team on 2015-May-08; originally reported
by Codenomicon to NCSC-FI on 2015-01-08.
The vulnerabilities were discovered by Joonas Kuorilehto and
Antti Häyrynen from Codenomicon.
* bug fixes - see https://github.com/upx/upx/milestone/1
Changes in 3.91 (30 Sep 2013):
* Added experimental support for Windows 64-bit PE files, based on
work by Stefan Widmann. Please use for testing only!
* bug fixes
==================================================================
Changes in 3.09 (18 Feb 2013):
* New option --preserve-build-id for GNU ELF.
* Allow for code signing and LC_UUID on Mac OS X executables.
* Allow non-contiguous LC_SEGMENTs and 0==.vmsize for Mach-O.
* Allow zero-filled final page in PackUnix::canUnpack().
* bug fixes
Changes in 3.08 (12 Dec 2011):
* Fix allocation in runtime stub for darwin.macho-entry (i386 and amd64).
* Compress shared library on ELF i386 only [ld.so threatens even this case].
* Attempt to support ELF on QNX 6.3.0 for armel (experimental).
* Better diagnostic when ELF -fPIC is needed.
* PT_NOTE improvements for BSD.
* Preserve more ELF .e_flags on ARM.
* Minor code improvements for ELF stubs.
* Defend against another flavor of corrupt PE header.
* bug fixes
Changes in 3.07 (08 Sep 2010):
* win32/pe: fixed relocation handling for files with *no* TLS callbacks
[severe bug introduced in 3.06]
Changes in 3.06 (04 Sep 2010):
* win32/pe: TLS callback support contributed by Stefan Widmann. Thanks!
* bug fixes
Changes in 3.05 (27 Apr 2010):
* i386-linux and amd64-linux support shared libraries (DT_INIT must
exist, all info needed by runtime loader must be first in .text, etc.)
* Linux /proc/self/exe now is preserved by default, by leaving behind
one page. New compress-time option --unmap-all-pages is available.
* Withdraw support for shared libraries on Darwin (Apple Mac OS X)
because upx does not understand enough about .dylib.
* bug fixes
Changes in 3.04 (27 Sep 2009):
* new format Mach/AMD64 supports 64-bit programs on Apple Macintosh.
* new formats Dylib/i386 and Dylib/ppc32 support shared libraries
[such as browser plugins] on Darwin (Apple Macintosh). An existing
-init function (LC_ROUTINES command) is required.
* new format vmlinuz/armel for Debian NSLU2 (etc.) linux kernel
* bvmlinuz boot protocol 2.08 for 386 Linux kernel
* Extended ABI version 4 for armel-eabi ARM Linux ELF
* bug fixes
Changes in 3.03 (27 Apr 2008):
* implement cache flushing for PowerPC (esp. model 440)
* fix cache flushing on MIPS (>3 MiB compressed, or with holes)
* fix MIPS big-endian
* bug fixes
Changes in 3.02 (16 Dec 2007):
* fix unmapping on arm-linux.elf
* fix error checking in mmap for i386-linux.elf [triggered by -fPIE]
* bug fixes
Changes in 3.01 (31 Jul 2007):
* new options --no-mode, --no-owner and --no-time to disable preservation
of mode (file permissions), file ownership and timestamps.
* dos/exe: fixed an incorrect error message caused by a bug in
relocation handling
* new format linux/mipsel supports ELF on [32-bit] R3000
* fix argv[0] on PowerPC with --lzma
* bug fixes
Changes in 3.00 (27 Apr 2007):
* watcom/le & tmt/adam: fixed a problem when using certain filters
Changes in 2.93 beta (08 Mar 2007):
* new formats Mach/i386 and Mach/fat support Mac OS X i686 and
Universal binaries [i686 and PowerPC only]
* dos/exe: LZMA is now also supported for 16-bit dos/exe. Please note that
you have to explicitly use '--lzma' even for '--ultra-brute' here
because runtime decompression is about 30 times slower than NRV -
which is really noticeable on old machines.
* dos/exe: fixed a rarely occurring bug in relocation handling
* win32/pe & arm/pe: better icon compression handling
Changes in 2.92 beta (23 Jan 2007):
* new option '--ultra-brute' which tries even more variants
* slightly improved compression ratio for some files when
using '--brute' or '--ultra-brute'
* bug fixes
Changes in 2.91 beta (29 Nov 2006):
* assorted bug fixes
* wince/arm: fix "missing" icon & version info resource problem for WinCE 5
* win32/pe & arm/pe: added option --compress-icons=3 to compress all icons
Changes in 2.90 beta (08 Oct 2006):
* LZMA algorithm support for most of the 32-bit and 64-bit file formats;
use new option '--lzma' to enable
* new format: BSD/elf386 supporting FreeBSD, NetBSD and OpenBSD
via auto-detection of PT_NOTE or EI_OSABI
* arm/pe: all the NRV compression methods are now supported
(only NRV2D is missing in thumb mode)
* linux/elf386, linux/ElfAMD: remember /proc/self/exe in environment
* major source code changes: the runtime decompression stubs are now
built from internal ELF objects
==================================================================
Changes in 2.03 (07 Nov 2006):
* bvmlinuz/386: fix for kernels not at 0x100000; also allow x86_64
* linux/elf386: work around Linux kernel bug (0-length .bss needs PF_W)
Changes in 2.02 (13 Aug 2006):
* linux/386: work around Linux kernel bug (".bss" requires PF_W)
* linux/ppc32, mach/ppc32: compressed programs now work on a 405 CPU
* vmlinuz/386: fixed zlib uncompression problem on DOS
Changes in 2.01 (06 Jun 2006):
* arm/pe: better DLL support
* dos/exe: device driver support added
* linux/386: Fix --force-execve for PaX, grSecurity, and strict SELinux.
/tmp must support execve(); therefore /tmp cannot be mounted 'noexec'.
* win32/pe & arm/pe: added new option '--keep-resource=' for
excluding selected resources from compression
Changes in 2.00 (27 Apr 2006):
* linux/386: the stub now prints an error message if some strict
SELinux mode does prevent runtime decompression and execution
(for a fully SELinux-compatible but otherwise inferior compression
format you can use the '--force-execve' option)
* linux/386: worked around a problem where certain Linux kernels
clobber the %ebx register during a syscall
* win32/pe: disable filters for files with broken PE headers
Changes in 1.96 beta (13 Apr 2006):
* arm/pe: added filter support
* win32/pe: removed an unnecessary check so that Delphi 2006 and
Digital Mars C++ programs finally are supported
Changes in 1.95 beta (09 Apr 2006):
* arm/pe: added DLL support
* arm/pe: added thumb mode stub support
* arm/pe: added unpacking support
* win32/pe: really worked around R6002 runtime errors
Changes in 1.94 beta (11 Mar 2006):
* new format: added support for wince/arm (ARM executables running on WinCE)
* new format: added support for linux elf/amd64
* new format: added support for linux elf/ppc32
* new format: added support for mach/ppc32 (Apple Mac OS X)
* win32/pe: hopefully working "load config" support
* win32/pe: R6002 runtime errors worked around
* win32/pe: the stub now clears the dirty stack
Changes in 1.93 beta (07 Feb 2005):
* vmlinuz/386: fixes to support more kernels
Changes in 1.92 beta (20 Jul 2004):
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
* win32/pe: added option `--strip-loadconf' to strip the SEH load config section
* win32/pe: added option '--strip-loadconf' to strip the SEH load
config section [NOTE: this option is obsolete since UPX 1.94]
* win32/pe: try to detect .NET (win32/net) files [not yet supported by UPX]
* vmlinux/386: new format that directly supports building Linux kernels
* source code: now compiles cleanly under Win64
@@ -17,7 +273,7 @@ Changes in 1.91 beta (30 Jun 2004):
* vmlinuz/386: added support for recent kernels
* watcom/le: don't crash on files without relocations
* win32/pe: stricter checks of some PE values
* option `--brute' now implies `--crp-ms=999999'.
* option '--brute' now implies '--crp-ms=999999'.
* source code: much improved portability using ACC, the
Automatic Compiler Configuration
* source code: compile fixes for strict ISO C++ compilers
@@ -25,17 +281,15 @@ Changes in 1.91 beta (30 Jun 2004):
* re-synced with upx 1.25 branch
Changes in 1.90 beta (11 Nov 2002):
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
* implemented several new options for finer compression control:
`--all-methods', `--all-filters' and `--brute'
'--all-methods', '--all-filters' and '--brute'
* ps1/exe: new format - UPX now supports PlayStation One programs
* linux/386: added the option `--force-execve'
* linux/386: added the option '--force-execve'
* vmlinuz/386: better kernel detection and sanity checks
* re-synced with upx 1.24 branch
* documentation updates
Changes in 1.11 beta (20 Dec 2000):
* UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING
* vmlinuz/386: new format - UPX now supports bootable linux kernels
* linux/elf386: added the new ELF direct-to-memory executable format - no
more temp files are needed for decompression!
@@ -47,7 +301,7 @@ Changes in 1.11 beta (20 Dec 2000):
==================================================================
Changes in 1.25 (29 Jun 2004)
* INFO: http://upx.sourceforge.net is the permanent UPX home page
* INFO: http://upx.sourceforge.net is the new UPX home page
* watcom/le: don't crash on files without relocations
* win32/pe: stricter checks of some PE values
* source code: much improved portability using ACC, the
@@ -75,9 +329,9 @@ Changes in 1.22 (27 Jun 2002)
Digital Mars C++ and Watcom C++
Changes in 1.21 (01 Jun 2002)
* New option `--crp-ms=' for slightly better compression at the cost
* New option '--crp-ms=' for slightly better compression at the cost
of higher memory requirements during compression.
Try `upx --best --crp-ms=100000'. See the docs for more info.
Try 'upx --best --crp-ms=100000'. See the docs for more info.
* source code: portability fixes
* source code: compile fixes for g++ 3.0 and g++ 3.1
@@ -91,7 +345,6 @@ Changes in 1.20 (23 May 2001)
our unstable development releases 1.1x and 1.9x]
Changes in 1.08 (30 Apr 2001)
* INFO: http://upx.sourceforge.net now is the new permanent UPX home page
* new native port to atari/tos
* win32/pe: shortened the identstring
* source code: portability fixes - UPX now builds cleanly under m68k CPUs
@@ -116,7 +369,7 @@ Changes in 1.05 (24 Jan 2001)
at the unstable UPX 1.1x beta versions for that)
Changes in 1.04 (19 Dec 2000)
* dos/exe: fixed an internal error when using `--no-reloc'
* dos/exe: fixed an internal error when using '--no-reloc'
* win32/pe: fixed a rare bug in the relocation handling code
* some tunings for the default compression level
@@ -124,7 +377,7 @@ Changes in 1.03 (30 Nov 2000)
* linked with a new version of the NRV compression library:
- improved compression ratio a little bit
- overall significantly faster compression
- much faster when using high compression levels like `-9' or `--best'
- much faster when using high compression levels like '-9' or '--best'
- much faster with large files
* atari/tos: added support for FreeMiNT
* the 32-bit DOS version now uses the new CWSDSTUB extender
@@ -132,7 +385,7 @@ Changes in 1.03 (30 Nov 2000)
Changes in 1.02 (13 Sep 2000)
* watcom/le: fixed a problem with the Causeway extender
* win32/pe: don't automatically strip relocs if they seem needed
* support multiple backup generations when using `-k'
* support multiple backup generations when using '-k'
* updated the console screen driver
Changes in 1.01 (09 Apr 2000)
@@ -160,10 +413,12 @@ Changes in 0.99.1 (29 Feb 2000)
Changes in 0.99 (25 Feb 2000)
* FULL SOURCE CODE RELEASED UNDER THE TERMS OF THE GNU GPL
* win32/pe: changed default to `--strip-relocs=1'
* win32/pe: changed default to '--strip-relocs=1'
* dos/com and dos/sys: fixed a bad decompressor problem
* linux/386: the counter for the progress indicator was off by one
==================================================================
Changes in 0.94 (06 Dec 1999)
* win32/pe: the stub now calls ExitProcess in case of import errors
* under DOS and Windows, the environment variable UPX now accepts
@@ -183,7 +438,7 @@ Changes in 0.91 (13 Nov 1999)
* dos/exe: correctly restore cs when uncompressing
Changes in 0.90 (10 Nov 1999)
* all formats: `--overlay=copy' now is the default overlay mode
* all formats: '--overlay=copy' now is the default overlay mode
* improved compression ratio for most files
* win32/pe: uncompression is finally supported
* win32/pe: never compress REGISTRY resources
@@ -193,7 +448,7 @@ Changes in 0.90 (10 Nov 1999)
* win32/pe: somewhat less memory is required during compression
* linux/386: fixed compression of scripts which was broken since 0.71
* linux/386: more FreeBSD compatibility issues
* changed option: `-i' now prints some more details during compression
* changed option: '-i' now prints some more details during compression
(not finished yet)
Changes in 0.84 (04 Oct 1999)
@@ -209,7 +464,7 @@ Changes in 0.83 (17 Sep 1999)
Changes in 0.82 (16 Aug 1999)
* dos/exe: fixed a decompressor bug which could cause crash on some files
* linux/386: section headers are now stripped from the stub so that
`strip' won't ruin a compressed file any longer
'strip' won't ruin a compressed file any longer
* wc/le: support for stack not in the last object disabled again
* win32/pe: removed some unneeded data
@@ -218,32 +473,32 @@ Changes in 0.81 (04 Aug 1999)
* dos/com: fixed an internal error that could happen with very small files
Changes in 0.80 (03 Aug 1999)
* you can set some default options in the environment var `UPX'
* you can set some default options in the environment var 'UPX'
* dos/com: the decompressor stub now checks for enough free memory
* dos/exe: decompressor rewritten, some bugs are fixed
* dos/exe: new option `--no-reloc': no relocation data is put into
* dos/exe: new option '--no-reloc': no relocation data is put into
the DOS header
* tmt/adam: added support for more stubs, detect already packed files
* tmt/adam: new option `--copy-overlay'
* tmt/adam: new option '--copy-overlay'
* wc/le: reduced memory requirement during uncompression
* wc/le: support files which do not contain their stack in the last object
* wc/le: fixed a bug which could cause a crash, improved relocation
handling
* wc/le: new option `--copy-overlay'
* win32/pe: `--compress-icons=2' is now the default
* wc/le: new option '--copy-overlay'
* win32/pe: '--compress-icons=2' is now the default
* win32/pe: even better TLS support
* win32/pe: versioninfo works on NT
* win32/pe: import by ordinal from kernel32.dll works
* win32/pe: other import improvements: importing a nonexistant DLL
results in a usual Windows message, importing a nonexistant function
* win32/pe: other import improvements: importing a nonexistent DLL
results in a usual Windows message, importing a nonexistent function
results in program exit (instead of crash ;-)
* win32/pe: new option: `--compress-resources=0'
* win32/pe: new option: '--compress-resources=0'
* win32/pe: reduced memory requirement during uncompression, some
files might even require LESS memory when they're compressed
* win32/pe: TYPELIBs should work now
* win32/pe: improved relocation handling, 16-bit relocations should work
* win32/pe: new option `--strip-relocs' (only if you know what you are doing)
* win32/pe: new option `--copy-overlay'
* win32/pe: new option '--strip-relocs' (only if you know what you are doing)
* win32/pe: new option '--copy-overlay'
* important internal changes: now the stubs are built at runtime
Changes in 0.72 (12 May 1999)
@@ -257,20 +512,20 @@ Changes in 0.72 (12 May 1999)
* linux/386: minor decompressor stub updates, nicer progress bar
Changes in 0.71 (19 Apr 1999)
* dos/exe: added option `--no-overlay'
* dos/exe: added option '--no-overlay'
* linux/386: various improvements in the stub, most notably the
overhead for an extra cleanup process has been removed
* win32/pe: added support for export forwarders
* win32/pe: added support for DLLs without entry point or imports
* win32/pe: yet another .bss fix
* win32/pe: new option `--compress-icons=2': compress all icons
* win32/pe: new option '--compress-icons=2': compress all icons
which are not in the first icon directory
* win32/pe: rearranged stub to avoid false alerts from some virus scanners
Changes in 0.70 (30 Mar 1999)
* added support for linux/386 executables
* improved compression ratio quite a bit
* added new compression level `--best' to squeeze out even some more bytes
* added new compression level '--best' to squeeze out even some more bytes
* win32/pe: TLS support is much better now
* win32/pe: --compress-icons=0 should now work as well
* the usual minor fixes for win32/pe
@@ -287,7 +542,7 @@ Changes in 0.60 (06 Mar 1999)
* win32/pe: fixed file corruption when the size of the export data is invalid
* win32/pe: fixed a problem with empty resource data
* win32/pe: compressed file alignment set to minimum value
* win32/pe: made all compressed sections writeable
* win32/pe: made all compressed sections writable
* fixed some other win32/pe bugs
* fixed an address optimization problem for some not Watcom LE files
* fixed a bug which could make UPX hang when an exe header contained
@@ -311,12 +566,12 @@ Changes in 0.40 (05 Oct 1998)
* fixed a small but fatal bug in dos/sys introduced in 0.30
* fixed a rare bug in dos/exe
* worked around a bug in djgpp's strip 2.8
* Allegro packfile support should work now
* djgpp2/coff: Allegro packfile support should work now
* added dos/exeh compression method (works on 386+)
Changes in 0.30 (27 Jul 1998)
* fixed a serious bug in the 32-bit compressors - please don't use
djgpp/coff and watcom/le compressed files from previous versions,
djgpp2/coff and watcom/le compressed files from previous versions,
some of them are possibly damaged !
* the 16-bit uncompressors are a little bit shorter & faster
* fixed progress indicator for VESA and SVGA text modes
@@ -327,4 +582,5 @@ Changes in 0.20 (05 Jul 1998)
Changes in 0.05 (26 May 1998)
* first public beta release
* based on experience gained from our previous packers DJP (djgpp2/coff, 1996),
lzop (1996) and mfxpak (atari/tos, 1990)
-93
View File
@@ -1,93 +0,0 @@
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
The Ultimate Packer for eXecutables
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
http://upx.sourceforge.net
Here are some possible projects from which you can choose if you'd like to
contribute to UPX. Be sure to get in touch with us first to avoid
duplicate efforts.
User interface:
---------------
- Write a nifty Win32 GUI (in C++), but try to keep the size of the
final executable small. Compression should be in a separate
thread that calls do_one_file() [see src/work.cpp].
- Draw a nice UPX icon.
More formats:
-------------
- Amiga
- BeOS
- C64
- elks/8086 (this is a 16-bit linux-8086 kernel)
See http://www.elks.ecs.soton.ac.uk/
- freebsd/386 (generic), freebsd/elf386 (specialized).
Probably could share most of the linux code.
- Windows CE
- add support for self-extracting HTML pages using a Javascript stub
(like the AlgART HTML Packer "AHP")
Existing formats:
-----------------
- djgpp2/coff: add support for DLX dynamic loading
(see SEAL http://www.home.sk/public/seal/ )
- dos/com: add support for very long files - convert to exe if necessary
- dos/exe: implement filter support
- dos/sys: add support for sys/exe combos
- linux/i386:
- use the new assembly preprocessor stuff (ie. process the file
headers internally)
- UPX uncompressor daemon
- rewrite the stub in assembly (not sure if this is a good idea...)
- watcom/le: add support for per section compression, LX support, VXD
- win32/pe: display a nice dialog box in the stub in case
of problems (like importing a DLL or function fails)
- win32/pe: finer control over resource compression, per section
compression
Compression ratio:
------------------
- invent more effective filters
- I (Markus) will continue to work on better compression algorithms,
so be sure to do better than me if you plan working on this ;-)
Other:
------
- anything else you think that could improve UPX...
Thanks for your contribution.
+51 -92
View File
@@ -1,48 +1,25 @@
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
The Ultimate Packer for eXecutables
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
http://upx.sourceforge.net
Copyright (c) 1996-2025 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io
WARNING - UNSTABLE BETA VERSION
===============================
All versions 1.9x are unstable beta releases - use them only for testing,
and never distribute a program that is packed with them !
There will be hidden bugs. Really.
The current stable release is 1.25, and the next stable release
will be called version 2.00.
The main news since 1.25 are:
- slightly better compression using the new NRV2E algorithm
- new options for compression tuining (e.g. `--brute')
- support for bootable Linux kernels ("vmlinuz/386")
- support for Linux kernel building ("vmlinux/386")
- direct Linux ELF-to-memory decompression ("linux/elf386") and
shell-to-memory decompression ("linux/sh386")
- support for playstation exes ("ps1/exe")
- lots of new bugs ;-) take care
WELCOME
=======
Welcome to UPX !
Please don't forget to read the file LICENSE - UPX is distributed
under the GNU General Public License (GPL) with special exceptions
allowing the distribution of all compressed executables, including
commercial programs.
UPX is a free, secure, portable, extendable, high-performance
executable packer for several executable formats.
INTRODUCTION
@@ -58,105 +35,87 @@ and run exactly as before, with no runtime or memory penalty for most
of the supported formats.
UPX supports a number of different executable formats, including
Windows 95/98/ME/NT/2000/XP programs and DLLs, DOS programs,
and Linux executables and kernels.
Windows programs and DLLs, and Linux executables.
UPX is free software distributed under the term of the GNU General
Public License. Full source code is available.
UPX may be distributed and used freely, even with commercial applications.
See the UPX License Agreement for details.
See the UPX License Agreements for details.
UPX is rated number one in the well known Archive Comparison Test. Visit
http://compression.ca/ .
UPX aims to be Commercial Quality Freeware.
SECURITY CONTEXT
================
IMPORTANT NOTE: UPX inherits the security context of any files it handles.
This means that packing, unpacking, or even testing or listing a file requires
the same security considerations as actually executing the file.
Use UPX on trusted files only!
SHORT DOCUMENTATION
===================
`upx program.exe' will compress a program or DLL. For best compression
results try `upx --best program.exe'.
'upx program.exe' will compress a program or DLL. For best compression
results try 'upx --best program.exe' or 'upx --brute program.exe'.
Please see the file UPX.DOC for the full documentation. The files
NEWS and BUGS also contain various tidbits of information.
DISCLAIMER
==========
UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.
Having said that, we think that UPX is quite stable now. Indeed we
have compressed lots of files without any problems. Also, the
current version has undergone several months of beta testing -
actually it's more than 4 years since our first public beta.
This is the first production quality release, and we plan that future
releases will be backward compatible with this version.
Please report all problems or suggestions to the authors. Thanks.
Please see the file doc/upx-doc.txt for the full documentation. The files
NEWS and doc/BUGS.txt also contain various tidbits of information, as
does the output of 'upx --help'.
THE FUTURE
==========
- We'd really love to support handheld systems like the PalmPilot because
compression makes a lot of sense here. And - because of the atari/tos
format - we already have a working decompressor in 68000 assembly.
Unfortunately we know next to nothing about the operating system
architecture of such handhelds, so we need some information from
an expert. Please contact us if you think you can help.
- Stay up-to-date with ongoing OS and executable format changes
- The Linux approach could probably get ported to a lot of other Unix
variants, at least for other i386 architectures it shouldn't be too
much work. If someone sends me a fresh hard disk and an official
FreeBSD/OpenBSD/NetBSD/Solaris/BeOS... CD I might take a look at it ;-)
- RISC-V 64 for Linux
- ARM64 for Windows (help wanted)
- We will *NOT* add any sort of protection and/or encryption.
This only gives people a false feeling of security because
by definition all protectors/compressors can be broken.
And don't trust any advertisment of authors of other executable
compressors about this topic - just do a websearch on "unpackers"...
all "protectors" can be broken by definition.
- Fix all remaining bugs - keep your reports coming ;-)
- See the file PROJECTS in the source code distribution if you want
to contribute.
- Fix all remaining bugs - please report any issues
https://github.com/upx/upx/issues
COPYRIGHT
=========
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2004 Laszlo Molnar
Copyright (C) 1996-2025 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2025 Laszlo Molnar
Copyright (C) 2000-2025 John F. Reiser
This program may be used freely, and you are welcome to
redistribute it under certain conditions.
UPX is distributed with full source code under the terms of the
GNU General Public License v2+; either under the pure GPLv2+ (see
the file COPYING), or (at your option) under the GPLv2+ with special
exceptions and restrictions granting the free usage for all binaries
including commercial programs (see the file LICENSE).
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
UPX License Agreement for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the UPX License Agreement along
with this program; see the file LICENSE. If not, visit the UPX home page.
You should have received a copy of the UPX License Agreements along
with this program; see the files COPYING and LICENSE. If not,
visit the UPX home page.
Share and enjoy,
Markus & Laszlo
Markus & Laszlo & John
Markus F.X.J. Oberhumer Laszlo Molnar
markus@oberhumer.com ml1050@cdata.tvnet.hu
Markus F.X.J. Oberhumer Laszlo Molnar
<markus@oberhumer.com> <ezerotven+github@gmail.com>
John F. Reiser
<jreiser@BitWagon.com>
[ The term UPX is a shorthand for the Ultimate Packer for eXecutables
and holds no connection with potential owners of registered trademarks
or other rights. ]
[ Feel free to contact us if you have commercial compression requirements
or interesting job offers. ]
-33
View File
@@ -1,33 +0,0 @@
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
The Ultimate Packer for eXecutables
WARNING - UNSTABLE BETA VERSION
===============================
All versions 1.9x are unstable beta releases - use them only for testing,
and never distribute a program that is packed with them !
There will be hidden bugs. Really.
The current stable release is 1.25, and the next stable release
will be called version 2.00.
The main news since 1.25 are:
- slightly better compression using the new NRV2E algorithm
- new options for compression tuining (e.g. `--brute')
- support for bootable Linux kernels ("vmlinuz/386")
- support for Linux kernel building ("vmlinux/386")
- direct Linux ELF-to-memory decompression ("linux/elf386") and
shell-to-memory decompression ("linux/sh386")
- support for playstation exes ("ps1/exe")
- lots of new bugs ;-) take care
+65 -65
View File
@@ -27,21 +27,6 @@ Foreword
Markus & Laszlo
Introduction
------------
Welcome to the UPX source code release!
UPX is not a toy for kids. Apart from basic knowledge about executables
and data compression you will need to be firm in C++, assembler,
Perl and Makefiles. Probably some other things as well.
If you can't manage to compile it then the sources are
probably not for you. Don't email us for help.
The authors use Linux for development. You might want to as well.
Short overview
--------------
@@ -56,59 +41,88 @@ Short overview
are #included by the individual executable format handlers.
Prerequisites
-------------
- first of all you need to build the UCL compression library
http://www.oberhumer.com/opensource/ucl/
Tools needed to build/modify the UPX sources
--------------------------------------------
- A C++ compiler supporting inner classes, templates, exceptions
and RTTI.
- A C++ compiler that fully implements C++17: clang-5, gcc-8 or msvc-2019-16.11
(older or other compilers may work but are unsupported, use at your own risk)
- GNU make 3.80 for Win32
http://www.cygwin.com/
- GNU make
- GNU make 3.80 for DOS
http://www.delorie.com/djgpp/
- CMake 3.13 or better; see https://cmake.org/
To compile the packer sources
-----------------------------
set the environment variable UCLDIR to point to your UCL installation, e.g.
set UCLDIR=c:\src\ucl-1.02 (DOS / Windows)
export UCLDIR=$HOME/local/src/ucl-1.02 (Unix)
then type
make target=linux # linux
make target=djgpp2 # dos32 - djgpp2
make target=cygwin # win32 - cygwin 1.3.x
make target=mingw32 # win32 - mingw32
make target=no-cygwin # win32 - mingw32 as included in cygwin
- just run "make" in the top-level source directory
If you want to modify the stub sources you'll also need
-------------------------------------------------------
- Nasm 0.98.38 - the Netwide Assembler
http://upx.sourceforge.net/download/tools/
http://sourceforge.net/projects/nasm/
- Podman/Docker: see misc/podman/rebuild-stubs - this
is the preferred way of rebuilding the stubs
- A68K - a 68000 macro assembler
http://upx.sourceforge.net/download/tools/
- otherwise you will need:
- a Linux host system with Perl, Python2 and some older compat-libs
- upx-stubtools - a number of cross-assemblers and cross-compilers.
Precompiled binaries for amd64-linux hosts are available from
https://github.com/upx/upx-stubtools/releases
- djasm - an assembler for the djgpp stub
http://upx.sourceforge.net/download/tools/
- Perl 5.6 or better
Developer quick start
---------------------
1) $ mkdir my-upx; cd my-upx # new directory for safety and convenience
2) $ git clone https://github.com/upx/upx.git
3) $ git clone https://github.com/upx/upx-testsuite.git
4) # Optional for re-building stubs:
4a) $ pushd upx/src/stub # my-upx/upx/src/stub
4b) $ wget https://github.com/upx/upx-stubtools/releases/download/v20221212/bin-upx-20221212.tar.xz
# Extract to $HOME/bin/bin-upx or $HOME/local/bin/bin-upx.
# See directions in: https://github.com/upx/upx-stubtools
# Some of the pre-built tools need i386 libz. On Ubuntu:
# # dpkg --add-architecture i386
# # apt-get update
# # apt-get install zlib1g-dev
# aarch64-linux-gnu/4.9.2/cc1 needs libmpfr.so.4. Make a symlink:
# # ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
4c) $ make clean; make # verify that you can re-build stubs
4d) $ popd # my-upx
5) $ cd upx # my-upx/upx
6) $ git submodule update --init # compression algorithms, etc.
# DO NOT TOUCH vendor/...
# After a git merge/pull/etc, then use "git status"
# to check whether the vendor directory is clean;
# if not, then update via "git submodule update".
# If stuck, then reset via "rm -rf vendor; git submodule update --init".
7) $ mkdir -p build/debug build/release
8) $ pushd build/debug # my-upx/upx/build/debug
9a) Install GNU g++ so that it is used when invoking "c++" compiler.
On Ubuntu 24.04 with
cmake: cmake version 3.28.3
g++: Ubuntu clang version 18.1.3 (1ubuntu1)
/lib/llvm-18/lib/cmake/llvm/HandleLLVMOptions.cmake:
add_flag_if_supported("-fno-lifetime-dse" CMAKE_CXX_FLAGS)
then cmake invoking c++ uses -fno-lifetime-dse but gets
c++: error: unknown argument: '-fno-lifetime-dse'
Commenting out the "add_flag_if_supported' line still uses that unknown argument.
Installing g++ avoids the problem.
9b) $ cmake ../.. # configure cmake
10) $ cmake --build . --verbose # optional "--verbose"
# This relies on stub/*.h, which YOU must re-build if necessary.
# When in doubt, then use "cd src/stub; make clean; make".
11) $ popd # my-upx/upx
12) $ cd src # my-upx/upx/src
12a) On MacOS: install homebrew (https:://brew.sh), then "brew install coreutils"
and put <some_prefix>/opt/coreutils/libexec/gnubin into PATH so that
"readlink -en" and "sha256sum -b" work.
13) $ make run-testsuite 2>&1 | tee testsuite.log
- Linux (for the linux/386 stubs)
Misc. notes
@@ -123,13 +137,10 @@ Misc. notes
stream.
- Use gcc extensions and other compiler specific stuff only through
macros.
- Keep in mind that it should be possible to build UPX on braindead
file systems (FAT). Don't use long file names or other things
that break building under plain DOS.
***
Some conventions:
-----------------
- follow our coding style
- indent level = 4
@@ -138,15 +149,4 @@ Some conventions:
- Use throwSomeException() functions instead of throw SomeException():
this makes the code shorter if used often.
***
Patches/Contributions
- Please send us bug fixes/contributions only using
diff -u oldfile newfile
or
diff -uNr olddirectory newdirectory
# vim:set ts=4 sw=4 et:
-123
View File
@@ -1,123 +0,0 @@
UPX TODO list. Last updated 2004-07-19.
IMPORTANT PROBLEMS THAT SHOULD BE FIXED SOON:
- stub ctojr32 needs CPU 486 because of bswap
OTHER:
- check all <const_cast> to make sure they are not invalid
- throwNotCompressible() is not a real error, so make the output nicer
(info: bla bla). Also ui.cpp (total_*).
-----------------------------------------------------------------------
IMPROVED COMPRESSION RATIO
==========================
- experiment with new filters
- implement filters for dos/exe
- filters: could we exploit a f->firstcall info field ?
- for small programs (e.g. < 64k), try an additional algorithm
to see if it gives better compression
ALL FORMATS
===========
- more thoroughly test the exe-header in canPack()
and throw exceptions when encountering bad values.
- implement `--cpu=486' option to use bswap on the 32-bit formats
(if cpu >= 486)
- consider removing "or ebp,-1" when not needed
FORMAT DJGPP2/COFF
==================
- handle overlays
- fix default file extension handling when the --coff option is set
FORMAT DOS/EXE
==============
- implement filters
- add a check so that we don't pack djgpp1 binaries
FORMAT LINUX/386
================
- don't mmap() the temporary output file - this seems to improve
file io speed
FORMAT TMT/ADAM
===============
- the decompressors are already aligned, no need for an
extra alignment
FORMAT WATCOM/LE
================
- handle files without relocations
- the decompressors are already aligned, no need for an
extra alignment
- fix default file extension handling when the --le option is set
- handle holes in the file
- implement compressWithFilters()
- add a call to verifyOverlappingDecompression()
FORMAT WIN16/NE
===============
- implement readFileHeader() to correctly identify a win16/ne
executable, so that the call for contribution will get thrown
FORMAT WIN32/PE
===============
- fix the section alignment with the Intel compiler
- decrease runtime memory overhead
2 - easy - mfx + ml) new switch(es) : do not compress resource types x,y,z
or resource names a,b,c
3 - medium - ml) rebuild exports
3 - difficult) don't compress the BSS section and other holes.
4 - medium - ml) fix when objectalign < 0x1000
4 - easy - ml) put the original offset of moved resources somewhere into
the res.dir. (if it's safe to do)
4 - ??? - ml) fix FIXMEs
5 - medium - ml) try to put the preprocessed imports & relocs back to their
original section if possible. this could save some virtual memory
address space.
-6
View File
@@ -1,6 +0,0 @@
upx.1
upx.doc
upx.html
upx.man
upx.ps
upx.tex
+11 -12
View File
@@ -1,15 +1,15 @@
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
The Ultimate Packer for eXecutables
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
http://upx.sourceforge.net
Copyright (c) 1996-2025 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io
Limitations and other things which are not (yet) supported:
@@ -28,7 +28,7 @@ dos/exe
watcom/le
---------
* 16-bit selector alias fixups
* 16-bit offset relocation for objects larger than 4 kB
* 16-bit offset relocation for objects larger than 4 KiB
* 16:16 fixups
If you need any of the above (they're very rare), send us an URL of a
@@ -44,8 +44,7 @@ test file.
win32/pe
--------
* writeable shared sections (`--force' *may* work)
* writable shared sections (`--force' *may* work)
* certificates in the image
* compressing files which contain a big BSS requires lots of memory
during compression
+55 -47
View File
@@ -1,68 +1,76 @@
SHELL = /bin/sh
#
# UPX doc Makefile - needs GNU make, sed, pod2html, pod2man and pod2text
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
top_srcdir = ..
BUILT_SOURCES := upx.1 upx-doc.html upx-doc.txt
PACKAGE = upx
VERSION_DATE = 20 Jul 2004
VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
top_srcdir ?= ..
TRIMSPACE = cat
TRIMSPACE = sed -e 's/ *$$//'
PACKAGE = upx
VERSION_DATE := $(shell sed -n 's/^.*UPX_VERSION_DATE_ISO .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
VERSION := $(shell sed -n 's/^.*UPX_VERSION_STRING .*"\(.*\)".*/\1/p' $(top_srcdir)/src/version.h)
BUILT_SOURCES = upx.1 upx.doc upx.html upx.man upx.ps upx.tex
BUILT_SOURCES = upx.1 upx.doc upx.html
# internal make variables
comma := ,
empty :=
space := $(empty) $(empty)
tab := $(empty) $(empty)
RTRIM := sed -e 's/[ $(tab)]*$$//'
DETAB2 := sed -e 's/$(tab)/ /g'
###
###
###
#***********************************************************************
# targets
#***********************************************************************
all: $(BUILT_SOURCES)
.DEFAULT_GOAL = all
mostlyclean:
-rm -f $(BUILT_SOURCES) pod2htm*
.PHONY: PHONY
.SECONDEXPANSION:
.SUFFIXES:
clean: mostlyclean
all: $(BUILT_SOURCES) PHONY
distclean: clean
mostlyclean clean distclean maintainer-clean: PHONY
rm -f $(BUILT_SOURCES) ./pod2htm*
maintainer-clean: distclean
#***********************************************************************
# rules
#***********************************************************************
.SUFFIXES: .1 .doc .html .man .pod .ps .tex .texi
.SUFFIXES: .1 .html .man .pod .ps .tex .txt
.PHONY: all mostlyclean clean distclean maintainer-clean
%.1 : %.pod
pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(RTRIM) > $@
test -s $@
# # strip version number from "Pod::Man" comment
sed -i -e 's/^\(\.\\" Automatically generated by Pod::Man\).*/\1/' $@
%-doc.html : %.pod
pod2html --noindex $< | $(RTRIM) | $(DETAB2) > $@
@rm -f ./pod2htm*
test -s $@
###
### rules
###
%.man : %.1
nroff -man $< | $(RTRIM) > $@
test -s $@
.pod.1:
pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(TRIMSPACE) > $@
%.ps : %.1
groff -man $< | $(RTRIM) > $@
test -s $@
.pod.html:
### pod2html $< | $(TRIMSPACE) > $@
pod2html --noindex $< | $(TRIMSPACE) > $@
@-rm -f pod2htm*
.pod.tex:
%.tex : %.pod
pod2latex $<
test -s $@
.pod.doc:
pod2text < $< | $(TRIMSPACE) > $@
%-doc.txt : %.pod
pod2text < $< | $(RTRIM) > $@
test -s $@
.1.man:
nroff -man $< | $(TRIMSPACE) > $@
.1.ps:
groff -man $< | $(TRIMSPACE) > $@
###
### dependencies
###
$(BUILT_SOURCES): $(top_srcdir)/src/version.h Makefile
.NOEXPORT:
#***********************************************************************
# dependencies
#***********************************************************************
$(BUILT_SOURCES): $(top_srcdir)/src/version.h $(MAKEFILE_LIST)
.DELETE_ON_ERROR: $(BUILT_SOURCES)
+19 -14
View File
@@ -1,15 +1,15 @@
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
ooooo ooo ooooooooo. ooooooo ooooo
`888' `8' `888 `Y88. `8888 d8'
888 8 888 .d88' Y888..8P
888 8 888ooo88P' `8888'
888 8 888 .8PY888.
`88. .8' 888 d8' `888b
`YbodP' o888o o888o o88888o
The Ultimate Packer for eXecutables
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
http://upx.sourceforge.net
Copyright (c) 1996-2025 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io
.___.. .
@@ -37,23 +37,28 @@ Charles W. Sandmann <sandmann@clio.rice.edu>
for the idea with the stubless decompressor in djgpp2/coff
Ice
for debugging the PE headersize problem down
Jens Medoch <jssg@users.sourceforge.net>
for the ps1/exe format
Joergen Ibsen <jibz@hotmail.com> and d'b
for the relocation & address optimization ideas
John F. Reiser <jreiser@BitWagon.com>
for the new Linux executable formats
John S. Fine <johnfine@erols.com>
for the new version of the dos/exe decompressor
Kornel Pal
for the EFI support
Lukundoo <Lukundoo@softhome.net>
for beta testing
Michael Devore
for initial dos/exe device driver support
Oleg V. Volkov <rover@lglobus.ru>
for various FreeBSD specific informations
for various FreeBSD specific information
The Owl & G-RoM
for the --compress-icons fix
Ralph Roth <RalphRoth@gmx.net>
for reporting several bugs
Salvador Eduardo Tropea
for beta testing
The WINE project (http://www.winehq.com/)
Stefan Widmann
for the win32/pe TLS callback support
The WINE project (https://www.winehq.com/)
for lots of useful information found in their PE loader sources
Natascha
+70 -26
View File
@@ -1,5 +1,5 @@
Decompressing ELF Directly to Memory on Linux/x86
Copyright 2000 John F. Reiser jreiser@BitWagon.com
Copyright (C) 2000-2025 John F. Reiser jreiser@BitWagon.com
References:
<elf.h> definitions for the ELF file format
@@ -15,9 +15,9 @@ the value that is manipulated by system call 45 (__NR_brk in
there will be no execve() except for the execve() of the decompressor
program itself. So, the decompressor program (which contains the
compressed version of the original executable) must have the same
brk() as the original executable. So, the second PT_LOAD
brk() as the original executable. So, the first PT_LOAD
ELF "segment" of the compressed program is used only to set the brk(0).
See src/p_lx_elf.cpp, function PackLinuxI386elf::patchLoader().
See src/p_lx_elf.cpp, function PackLinuxElf32::generateElfHdr.
All of the decompressor's code, and all of the compressed image
of the original executable, reside in the first PT_LOAD of the
decompressor program.
@@ -25,41 +25,85 @@ decompressor program.
The decompressor program stub is just under 2K bytes when linked.
After linking, the decompressor code is converted to an initialized
array, and #included into the compilation of the compressor;
see src/stub/l_le_n2b.h. To make self-contained compressed
see stub/i386-linux.elf-entry.h. To make self-contained compressed
executables even smaller, the compressor also compresses all but the
startup and decompression subroutine of the decompressor itself,
saving a few hundred bytes. The startup code first decompresses the
rest of the decompressor, then jumps to it. A nonstandard linker
script src/stub/l_lx_elf86.lds places both the .text and .data
of the decompressor into the same PT_LOAD at 0x00401000. The
compressor includes the compressed bytes of the original executable
at the end of this first PT_LOAD.
script src/stub/src/i386-linux.elf-entry.lds arranges the SECTIONS
so that PackLinuxElf32x86::buildLoader() and buildLinuxLoader()
generate the desired stub code, which goes into PT_LOAD[1].
At runtime, the decompressed stub lives at 0x00400000. In order for the
decompressed stub to work properly at an address that is different
from its link-time address, the compiled code must contain no absolute
addresses. So, the data items in l_lx_elf.c must be only parameters
and automatic (on-stack) local variables; no global data, no static data,
and no string constants. Use "size l_le_n2b.o l_6e_n2b.o" to check
that both data and bss have length zero. Also, the '&' operator
may not be used to take the address of a function.
The address 0x00400000 was chosen to be out of the way of the usual
load address 0x08048000, and to minimize fragmentation in kernel
page tables; one page of page tables covers 4MB. The address
0x00401000 was chosen as 1 page up from a 64KB boundary, to
make the startup code and its constants smaller.
At runtime, the decompressed stub lives close beyond the brk().
In order for the decompressed stub to work properly at an address
that is different from its link-time address, the compiled code must
contain no absolute addresses. So, the data items in stub code
must be only parameters and automatic (on-stack) local variables;
no global data, no static data, and no string constants. Also,
the '&' operator may not be used to take the address of a function.
Decompression of the executable begins by decompressing the Elf32_Ehdr
and Elf32_Phdr, and then uses the Ehdr and Phdrs to control decompression
of the PT_LOAD segments.
Subroutine do_xmap() of src/stub/l_lx_elf.c performs the
and Elf32_Phdr, and then uses those Ehdr and Phdrs to control decompression
of the PT_LOAD segments. Subroutine do_xmap() of src/stub/src/
i386-linux.elf-main.c performs the
"virtual execve()" using the compressed data as source, and stores
the decompressed bytes directly into the appropriate virtual addresses.
Before transfering control to the PT_INTERP "program interpreter",
Before transferring control to the PT_INTERP "program interpreter",
minor tricks are required to setup the Elf32_auxv_t entries,
clear the free portion of the stack (to compensate for ld-linux.so.2
assuming that its automatic stack variables are initialized to zero),
and remove (all but 4 bytes of) the decompression program (and
compressed executable) from the address space.
As of upx-3.05, by default on Linux, upon decompression then one page
of the compressed executable remains mapped into the address space
of the process. If all of the pages of the compressed executable are
unmapped, then the Linux kernel erases the symlink /proc/self/exe,
and this can cause trouble for the runtime shared library loader
expanding $ORIGIN in -rpath, or for application code that relies on
/proc/self/exe. Use the compress-time command-line option
--unmap-all-pages to achieve that effect at run time. Upx-3.04
and previous versions did this by default with no option. However,
too much other software erroneously assumes that /proc/self/exe
always exists. upx-4.3.0 made /proc/self/exe optional so that
chroot() and related environments can work.
For Elf formats, UPX adds an environment variable named " " [three
spaces] which saves the results of readlink("/proc/self/exe",,)
If /proc/self/exe is ENOENT, then the variable has the same value
as its name "/proc/self/exe".
All of the above documentation refers to ET_EXEC main programs,
which always use the same virtual addresses. An ET_DYN executable
(main program or shared library) follows much the same scheme,
re-using the address space that the kernel chose originally.
Linux stores the pathname argument that was specified to execve()
immediately after the '\0' which terminates the character string of the
last environment variable [as of execve()]. This is true for at least
all Linux 2.6, 2.4, and 2.2 kernels. Linux kernel 2.6.29 and later
records a pointer to that character string in Elf32_auxv[AT_EXECFN].
The pathname is not "bound" to the file as strongly as /proc/self/exe
(the file may be changed without affecting the pathname), but the
pathname does provide some information. The pathname may be relative
to the working directory, so look before performing any chdir().
On any page, then SELinux in strictest enforcing mode prohibits
simultaneous PROT_EXEC and PROT_WRITE, and also prohibits adding
PROT_EXEC if the kernel VMA struct (Virtual Memory Area struct)
that manages that page ever has had PROT_WRITE. This implies that
the only way to get PROT_EXEC is to map the page directly from a file.
Therefore, in late 2023 the various decompression stubs are being
rewritten to "bounce" the decompressed data through pages in a
memory-resident file created by the memfd_create() system call,
and subsequently mapped PROT_EXEC. Actual copying of the pages
can be avoided by careful sequence mmap() modes, but the overhead
of an additional system call is required.
The not-as-strict "targeted enforcing" mode of
SELinux seems not to demand this extra work, except for executables
that run with elevated privileges, such as various system daemons.
So "ordinary" user-mode apps can run in current "targeted enforcing"
mode. But because the actual runtime mode of SELinux is unknown
at compression time, then the memfd_create method should be used
all the time.
+2 -2
View File
@@ -108,14 +108,14 @@ then skip another one - the unfiltering process needs some information
to be able to reverse the filtering.
UPX uses the following idea, which works nicely. First we assume that
the size of the area that should be filtered is less than 16MB. Then
the size of the area that should be filtered is less than 16 MiB. Then
UPX scans over this area and keeps a record of the bytes that are
following the 0xE8 bytes. If we are lucky, there will be bytes that
were not found following 0xE8. These bytes are our candidates to be
used as markers.
Do you still remember that we assumed that the size of scanned area is
less than 16MB? Well, this means that when we process a real call, the
less than 16 MiB? Well, this means that when we process a real call, the
resulting offset will be less than 0x00FFFFFF too. So the MSB is always
0x00. Which is a nice place to store our marker. Of course we should
reverse the byte order in the resulting offset - so this marker will
+50
View File
@@ -0,0 +1,50 @@
This documentation is written for those brave souls who want to
understand and/or modify the UPX assembly stubs - the small snippets
that do the runtime decompression when a compressed program is started.
If you look at the C++ source files, you can find code fragments like
this:
addLoader("PEMAIN20",
ih.entry ? "PEDOJUMP" : "PERETURN",
"IDENTSTR""UPX1HEAD",
NULL
);
linker->defineSymbol("original_entry", ih.entry);
and in the assembly files fragments like this:
section PEISDLL1
cmpb [esp + 8], 1
jnz reloc_end_jmp
section PEMAIN21
reloc_end_jmp:
section PERETURN
xor eax, eax
inc eax
ret 0x0C
section PEDOJUMP
jmp original_entry
Everything works as you would expect. If you want to add the code
fragment which is in `section PERETURN' to the runtime stub, then
simply use `addLoader("PERETURN")' in the C++ source.
That's nice, you could say, but how cross section jumps and calls are
handled? Well, that is the nicest part of this stuff - they are handled
automatically. All you have to do is to add the required sections to the
loader using `addLoader()' and the rest is done by upx. It will resolve
every conditional or unconditional jumps or subroutine calls for you.
You can also use (undefined) symbols in the assembly for values that
can only be computed during compression time (like `original_entry').
These symbols can be defined later in C++ using
linker->defineSymbol("xx", yy)
This functionality (we could say it's a simple linker) is achieved by
compiling the assembly into an ELF object file which a little C++
module (src/linker.cpp) can interpret and work with.
-89
View File
@@ -1,89 +0,0 @@
This documentation is written for those brave souls who want to
understand and/or modify the UPX assembly stubs - the small snippets
that do the runtime decompression when a compressed program is started.
So, how the runtime stub/loader generation works?
You might have already noticed that for some file formats the loaders
are quite simple (linux/i386 & tos) while in the other cases the
loaders look very suspicious: they're full of `%ifdef's and contain
loads of cryptic comments like `__PERELOC2__'.
If you look at the C++ source files, however you can notice that these
comment strings (without the leading and trailing underscores) are used
in the following way (they are all 8 character length strings):
addLoader("PEMAIN20",
ih.entry ? "PEDOJUMP" : "PERETURN",
"IDENTSTR""UPX1HEAD",
NULL
);
Basically that's all you have to know: when you want to add a section
of assembly code to the runtime loader, you just write
l_foo.asm
---------
;__FOOBAR00__
xor eax, eax
label1:
jmps label1
;__FOOBARZZ__
p_foo.cpp
---------
addLoader("FOOBAR00", NULL);
This will add the assembly section starting from __FOOBAR00__ and ending
before __FOOBARZZ__ to the loader. You can add an %ifdef - %endif pair
before these comments if you wish - but these conditionals will NOT be
seen by the assembler, they are just syntactic sugar to make the code a
little bit more readable and understandable. (Note however, that only
%ifdefs which are started on the 1st column are removed by the upx
assembly preprocessor program, so you can still use preprocessor
conditionals if you wish - just write them starting from the 2nd
column.)
That's nice, you could say, but how cross section jumps and calls are
handled? Well, that is the nicest part of this stuff - they are handled
automatically. All you have to do is to add the required sections to the
loader using `addLoader()' and the rest is done by upx. It will resolve
every conditional or unconditional jumps or subrutine calls for you.
This functionality (we could say it's a simple linker) is achived by the
assembly preprocessor (src/stub/scripts/app.pl) and a little C++ module
(src/linker.cpp). And of course NASM - the Netwide Assembler. You can
see what's going on behind the scenes - just do:
cd src/stubs
make maintainer-clean
make all
This will rebuild all the loaders - and keep the temporary files (*.as[xy])
which are seen by the assembler.
Currently this loader/stub building method only works with ix86
assembly - both app.pl and linker.cpp heavily rely on this when dealing
with cross section references.
And finally some important features/requirements you should be aware of:
- as previously stated - preprocessor conditionals starting on the 1st
column are removed by app.pl
- sections are separated by comments in the form `;__X1234567__'
- jumps are recognized by searching for a word which starts with `j'
and followed by a label - this also means that `jmp short label1'
will NOT be recognized (but you can use a macro called `jmps' for it
by adding `%define jmps jmp short' to the beginning of the file)
- at the end of the file you need something like this
eof:
; __XTHEENDX__
section .data
dd -1
dw eof
That's all for now.
+43
View File
@@ -0,0 +1,43 @@
UPX and SELinux
March 6, 2006
When a program that has been compressed by UPX is run, the decompressor
must create and write new memory pages of executable instructions.
SELinux (Security Enhanced Linux) directly controls the conditions
under which generating and/or executing new instructions is allowed,
so the configuration settings of SELinux affect the running of programs
that have been compressed by UPX.
In SELinux "strict enforcing" mode (the most restrictive), generating
new instructions at runtime is not allowed at all: any page with
PROT_EXEC permission must be mapped from a file in a mounted filesystem
that has 'x' [eXecute] permission, and the generation of such files is
also tightly controlled. A program that was compressed by UPX will not
run in SELinux strict enforcing mode. Attempts will fail with exit
code 127, and a record will be added to the history file
/var/log/audit/audit.log.
In "targeted enforcing" mode, SELinux pays close attention mostly to
designated processes that run with elevated privileges: web server,
print server, login server, etc. Ordinary user executables receive
much less scrutiny. However, one of the eventual goals of SELinux is to
eradicate runtime generation of instructions because of the possibility
for exploitation by malware (virus, trojan, key logger, privilege
elevation exploit, etc.) Thus targeted enforcing mode notices and
logs the use of "execmem" capability that is used by a program which
was compressed by UPX. In keeping with the goal of eventual prohibition,
SELinux ordinarily would deny execmem. However, most current SELinux
systems, including Fedora Core 5 [set for release March 15, 2006],
override this with "allow_exemem=1" in /etc/selinux/targeted/booleans.
Thus a program compressed by UPX will run in the default installed
configuration (targeted enforcing, allow_execmem=1) of SELinux under
Fedora Core 5. Each invocation will add a few lines to the log file
/var/log/audit/audit.log, one line for each use of execmem. If the
SELinux policy becomes more restrictive in the future, then a special
SELinux class or other mechanism must be created for compressed programs,
or else UPX-compressed executables will not run then.
In its "permissive" modes, SELinux just logs the potential problems,
but otherwise does not interfere. A program compressed by UPX will run
in any permissive mode.
+803
View File
@@ -0,0 +1,803 @@
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>upx - compress or expand executable files</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body>
<h1 id="NAME">NAME</h1>
<p>upx - compress or expand executable files</p>
<h1 id="SYNOPSIS">SYNOPSIS</h1>
<p><b>upx</b> <span style="white-space: nowrap;">[ <i>command</i> ]</span> <span style="white-space: nowrap;">[ <i>options</i> ]</span> <i>filename</i>...</p>
<h1 id="ABSTRACT">ABSTRACT</h1>
<pre><code> The Ultimate Packer for eXecutables
Copyright (c) 1996-2025 Markus Oberhumer, Laszlo Molnar &amp; John Reiser
https://upx.github.io</code></pre>
<p><b>UPX</b> is a portable, extendable, high-performance executable packer for several different executable formats. It achieves an excellent compression ratio and offers <i>*very*</i> fast decompression. Your executables suffer no memory overhead or other drawbacks for most of the formats supported, because of in-place decompression.</p>
<h1 id="DISCLAIMER">DISCLAIMER</h1>
<p><b>UPX</b> comes with ABSOLUTELY NO WARRANTY; for details see the file COPYING.</p>
<p>Please report all problems or suggestions to the authors. Thanks.</p>
<h1 id="SECURITY-CONTEXT">SECURITY CONTEXT</h1>
<p>IMPORTANT NOTE: <b>UPX</b> inherits the security context of any files it handles.</p>
<p>This means that packing, unpacking, or even testing or listing a file requires the same security considerations as actually executing the file.</p>
<p>Use <b>UPX</b> on trusted files only!</p>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p><b>UPX</b> is a versatile executable packer with the following features:</p>
<pre><code>- secure: as UPX is documented Open Source since many years any relevant
Security/Antivirus software is able to peek inside UPX compressed
apps to verify them
- excellent compression ratio: typically compresses better than Zip,
use UPX to decrease the size of your distribution !
- very fast decompression: more than 500 MB/sec on any reasonably modern
machine
- no memory overhead for your compressed executables for most of the
supported formats because of in-place decompression
- safe: you can list, test and unpack your executables.
Also, a checksum of both the compressed and uncompressed file is
maintained internally.
- universal: UPX can pack a number of executable formats, including
Windows programs and DLLs, macOS apps and Linux executables
- portable: UPX is written in portable endian-neutral C++
- extendable: because of the class layout it&#39;s very easy to support
new executable formats or add new compression algorithms
- free: UPX is distributed with full source code under the GNU General
Public License v2+, with special exceptions granting the free usage
for commercial programs</code></pre>
<p>You probably understand now why we call <b>UPX</b> the &quot;<i>ultimate</i>&quot; executable packer.</p>
<h1 id="COMMANDS">COMMANDS</h1>
<h2 id="Compress">Compress</h2>
<p>This is the default operation, eg. <b>upx yourfile.exe</b> will compress the file specified on the command line.</p>
<h2 id="Decompress">Decompress</h2>
<p>All <b>UPX</b> supported file formats can be unpacked using the <b>-d</b> switch, eg. <b>upx -d yourfile.exe</b> will uncompress the file you&#39;ve just compressed.</p>
<h2 id="Test">Test</h2>
<p>The <b>-t</b> command tests the integrity of the compressed and uncompressed data, eg. <b>upx -t yourfile.exe</b> check whether your file can be safely decompressed. Note, that this command doesn&#39;t check the whole file, only the part that will be uncompressed during program execution. This means that you should not use this command instead of a virus checker.</p>
<h2 id="List">List</h2>
<p>The <b>-l</b> command prints out some information about the compressed files specified on the command line as parameters, eg <b>upx -l yourfile.exe</b> shows the compressed / uncompressed size and the compression ratio of <i>yourfile.exe</i>.</p>
<h1 id="OPTIONS">OPTIONS</h1>
<p><b>-q</b>: be quiet, suppress warnings</p>
<p><b>-q -q</b> (or <b>-qq</b>): be very quiet, suppress errors</p>
<p><b>-q -q -q</b> (or <b>-qqq</b>): produce no output at all</p>
<p><b>--help</b>: prints the help</p>
<p><b>--version</b>: print the version of <b>UPX</b></p>
<p><b>--exact</b>: when compressing, require to be able to get a byte-identical file after decompression with option <b>-d</b>. [NOTE: this is work in progress and is not supported for all formats yet. If you do care, as a workaround you can compress and then decompress your program a first time - any further compress-decompress steps should then yield byte-identical results as compared to the first decompressed version.]</p>
<p><b>-k</b>: keep backup files</p>
<p><b>-o file</b>: write output to file</p>
<p>[ ...more docs need to be written... - type `<b>upx --help</b>&#39; for now ]</p>
<h1 id="COMPRESSION-LEVELS-TUNING">COMPRESSION LEVELS &amp; TUNING</h1>
<p><b>UPX</b> offers ten different compression levels from <b>-1</b> to <b>-9</b>, and <b>--best</b>. The default compression level is <b>-8</b> for files smaller than 512 KiB, and <b>-7</b> otherwise.</p>
<ul>
<li><p>Compression levels 1, 2 and 3 are pretty fast.</p>
</li>
<li><p>Compression levels 4, 5 and 6 achieve a good time/ratio performance.</p>
</li>
<li><p>Compression levels 7, 8 and 9 favor compression ratio over speed.</p>
</li>
<li><p>Compression level <b>--best</b> may take a long time.</p>
</li>
</ul>
<p>Note that compression level <b>--best</b> can be somewhat slow for large files, but you definitely should use it when releasing a final version of your program.</p>
<p>Quick info for achieving the best compression ratio:</p>
<ul>
<li><p>Try <b>upx --brute --no-lzma myfile.exe</b> or even <b>upx --ultra-brute --no-lzma myfile.exe</b>.</p>
</li>
<li><p>The option <b>--lzma</b> enables LZMA compression, which compresses better but is *significantly slower* at decompression. You probably do not want to use it for large files.</p>
<p>(Note that <b>--lzma</b> is automatically enabled by <b>--all-methods</b> and <b>--brute</b>, use <b>--no-lzma</b> to override.)</p>
</li>
<li><p>Try if <b>--overlay=strip</b> works.</p>
</li>
<li><p>For win32/pe programs there&#39;s <b>--strip-relocs=0</b>. See notes below.</p>
</li>
</ul>
<h1 id="OVERLAY-HANDLING-OPTIONS">OVERLAY HANDLING OPTIONS</h1>
<p>Info: An &quot;overlay&quot; means auxiliary data attached after the logical end of an executable, and it often contains application specific data (this is a common practice to avoid an extra data file, though it would be better to use resource sections).</p>
<p><b>UPX</b> handles overlays like many other executable packers do: it simply copies the overlay after the compressed image. This works with some files, but doesn&#39;t work with others, depending on how an application actually accesses this overlaid data.</p>
<pre><code>--overlay=copy Copy any extra data attached to the file. [DEFAULT]
--overlay=strip Strip any overlay from the program instead of
copying it. Be warned, this may make the compressed
program crash or otherwise unusable.
--overlay=skip Refuse to compress any program which has an overlay.</code></pre>
<h1 id="ENVIRONMENT-VARIABLE">ENVIRONMENT VARIABLE</h1>
<p>The environment variable <b>UPX</b> can hold a set of default options for <b>UPX</b>. These options are interpreted first and can be overwritten by explicit command line parameters. For example:</p>
<pre><code>for DOS/Windows: set UPX=-9 --compress-icons#0
for sh/ksh/zsh: UPX=&quot;-9 --compress-icons=0&quot;; export UPX
for csh/tcsh: setenv UPX &quot;-9 --compress-icons=0&quot;</code></pre>
<p>Under DOS/Windows you must use &#39;#&#39; instead of &#39;=&#39; when setting the environment variable because of a COMMAND.COM limitation.</p>
<p>Not all of the options are valid in the environment variable - <b>UPX</b> will tell you.</p>
<p>You can explicitly use the <b>--no-env</b> option to ignore the environment variable.</p>
<h1 id="NOTES-FOR-THE-SUPPORTED-EXECUTABLE-FORMATS">NOTES FOR THE SUPPORTED EXECUTABLE FORMATS</h1>
<h2 id="NOTES-FOR-ATARI-TOS">NOTES FOR ATARI/TOS</h2>
<p>This is the executable format used by the Atari ST/TT, a Motorola 68000 based personal computer which was popular in the late &#39;80s. Support of this format is only because of nostalgic feelings of one of the authors and serves no practical purpose :-). See https://freemint.github.io for more info.</p>
<p>Packed programs will be byte-identical to the original after uncompression. All debug information will be stripped, though.</p>
<p>Extra options available for this executable format:</p>
<pre><code>--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.</code></pre>
<h2 id="NOTES-FOR-BVMLINUZ-I386">NOTES FOR BVMLINUZ/I386</h2>
<p>Same as vmlinuz/i386.</p>
<h2 id="NOTES-FOR-DOS-COM">NOTES FOR DOS/COM</h2>
<p>Obviously <b>UPX</b> won&#39;t work with executables that want to read data from themselves (like some commandline utilities that ship with Win95/98/ME).</p>
<p>Compressed programs only work on a 286+.</p>
<p>Packed programs will be byte-identical to the original after uncompression.</p>
<p>Maximum uncompressed size: ~65100 bytes.</p>
<p>Extra options available for this executable format:</p>
<pre><code>--8086 Create an executable that works on any 8086 CPU.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.</code></pre>
<h2 id="NOTES-FOR-DOS-EXE">NOTES FOR DOS/EXE</h2>
<p>dos/exe stands for all &quot;normal&quot; 16-bit DOS executables.</p>
<p>Obviously <b>UPX</b> won&#39;t work with executables that want to read data from themselves (like some command line utilities that ship with Win95/98/ME).</p>
<p>Compressed programs only work on a 286+.</p>
<p>Extra options available for this executable format:</p>
<pre><code>--8086 Create an executable that works on any 8086 CPU.
--no-reloc Use no relocation records in the exe header.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.</code></pre>
<h2 id="NOTES-FOR-DOS-SYS">NOTES FOR DOS/SYS</h2>
<p>Compressed programs only work on a 286+.</p>
<p>Packed programs will be byte-identical to the original after uncompression.</p>
<p>Maximum uncompressed size: ~65350 bytes.</p>
<p>Extra options available for this executable format:</p>
<pre><code>--8086 Create an executable that works on any 8086 CPU.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.</code></pre>
<h2 id="NOTES-FOR-DJGPP2-COFF">NOTES FOR DJGPP2/COFF</h2>
<p>First of all, it is recommended to use <b>UPX</b> *instead* of <b>strip</b>. strip has the very bad habit of replacing your stub with its own (outdated) version. Additionally <b>UPX</b> corrects a bug/feature in strip v2.8.x: it will fix the 4 KiB alignment of the stub.</p>
<p><b>UPX</b> includes the full functionality of stubify. This means it will automatically stubify your COFF files. Use the option <b>--coff</b> to disable this functionality (see below).</p>
<p><b>UPX</b> automatically handles Allegro packfiles.</p>
<p>The DLM format (a rather exotic shared library extension) is not supported.</p>
<p>Packed programs will be byte-identical to the original after uncompression. All debug information and trailing garbage will be stripped, though.</p>
<p>Extra options available for this executable format:</p>
<pre><code>--coff Produce COFF output instead of EXE. By default
UPX keeps your current stub.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.</code></pre>
<h2 id="NOTES-FOR-LINUX-general">NOTES FOR LINUX [general]</h2>
<p>Introduction</p>
<pre><code>Linux/386 support in UPX consists of 3 different executable formats,
one optimized for ELF executables (&quot;linux/elf386&quot;), one optimized
for shell scripts (&quot;linux/sh386&quot;), and one generic format
(&quot;linux/386&quot;).
We will start with a general discussion first, but please
also read the relevant docs for each of the individual formats.
Also, there is special support for bootable kernels - see the
description of the vmlinuz/386 format.</code></pre>
<p>General user&#39;s overview</p>
<pre><code>Running a compressed executable program trades less space on a
``permanent&#39;&#39; storage medium (such as a hard disk, floppy disk,
CD-ROM, flash memory, EPROM, etc.) for more space in one or more
``temporary&#39;&#39; storage media (such as RAM, swap space, /tmp, etc.).
Running a compressed executable also requires some additional CPU
cycles to generate the compressed executable in the first place,
and to decompress it at each invocation.
How much space is traded? It depends on the executable, but many
programs save 30% to 50% of permanent disk space. How much CPU
overhead is there? Again, it depends on the executable, but
decompression speed generally is at least many megabytes per second,
and frequently is limited by the speed of the underlying disk
or network I/O.
Depending on the statistics of usage and access, and the relative
speeds of CPU, RAM, swap space, /tmp, and file system storage, then
invoking and running a compressed executable can be faster than
directly running the corresponding uncompressed program.
The operating system might perform fewer expensive I/O operations
to invoke the compressed program. Paging to or from swap space
or /tmp might be faster than paging from the general file system.
``Medium-sized&#39;&#39; programs which access about 1/3 to 1/2 of their
stored program bytes can do particularly well with compression.
Small programs tend not to benefit as much because the absolute
savings is less. Big programs tend not to benefit proportionally
because each invocation may use only a small fraction of the program,
yet UPX decompresses the entire program before invoking it.
But in environments where disk or flash memory storage is limited,
then compression may win anyway.
Currently, executables compressed by UPX do not share RAM at runtime
in the way that executables mapped from a file system do. As a
result, if the same program is run simultaneously by more than one
process, then using the compressed version will require more RAM and/or
swap space. So, shell programs (bash, csh, etc.) and ``make&#39;&#39;
might not be good candidates for compression.
UPX recognizes three executable formats for Linux: Linux/elf386,
Linux/sh386, and Linux/386. Linux/386 is the most generic format;
it accommodates any file that can be executed. At runtime, the UPX
decompression stub re-creates in /tmp a copy of the original file,
and then the copy is (re-)executed with the same arguments.
ELF binary executables prefer the Linux/elf386 format by default,
because UPX decompresses them directly into RAM, uses only one
exec, does not use space in /tmp, and does not use /proc.
Shell scripts where the underlying shell accepts a ``-c&#39;&#39; argument
can use the Linux/sh386 format. UPX decompresses the shell script
into low memory, then maps the shell and passes the entire text of the
script as an argument with a leading ``-c&#39;&#39;.</code></pre>
<p>General benefits:</p>
<pre><code>- UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
libc6, Shell/Perl/Python/... scripts, standalone Java .class
binaries, or whatever...
All scripts and programs will work just as before.
- Compressed programs are completely self-contained. No need for
any external program.
- UPX keeps your original program untouched. This means that
after decompression you will have a byte-identical version,
and you can use UPX as a file compressor just like gzip.
[ Note that UPX maintains a checksum of the file internally,
so it is indeed a reliable alternative. ]
- As the stub only uses syscalls and isn&#39;t linked against libc it
should run under any Linux configuration that can run ELF
binaries.
- For the same reason compressed executables should run under
FreeBSD and other systems which can run Linux binaries.
[ Please send feedback on this topic ]</code></pre>
<p>General drawbacks:</p>
<pre><code>- It is not advisable to compress programs which usually have many
instances running (like `sh&#39; or `make&#39;) because the common segments of
compressed programs won&#39;t be shared any longer between different
processes.
- `ldd&#39; and `size&#39; won&#39;t show anything useful because all they
see is the statically linked stub. Since version 0.82 the section
headers are stripped from the UPX stub and `size&#39; doesn&#39;t even
recognize the file format. The file patches/patch-elfcode.h has a
patch to fix this bug in `size&#39; and other programs which use GNU BFD.</code></pre>
<p>General notes:</p>
<pre><code>- As UPX leaves your original program untouched it is advantageous
to strip it before compression.
- If you compress a script you will lose platform independence -
this could be a problem if you are using NFS mounted disks.
- Compression of suid, guid and sticky-bit programs is rejected
because of possible security implications.
- For the same reason there is no sense in making any compressed
program suid.
- Obviously UPX won&#39;t work with executables that want to read data
from themselves. E.g., this might be a problem for Perl scripts
which access their __DATA__ lines.
- In case of internal errors the stub will abort with exitcode 127.
Typical reasons for this to happen are that the program has somehow
been modified after compression.
Running `strace -o strace.log compressed_file&#39; will tell you more.</code></pre>
<h2 id="NOTES-FOR-LINUX-ELF386">NOTES FOR LINUX/ELF386</h2>
<p>Please read the general Linux description first.</p>
<p>The linux/elf386 format decompresses directly into RAM, uses only one exec, does not use space in /tmp, and does not use /proc.</p>
<p>Linux/elf386 is automatically selected for Linux ELF executables.</p>
<p>Packed programs will be byte-identical to the original after uncompression.</p>
<p>How it works:</p>
<pre><code>For ELF executables, UPX decompresses directly to memory, simulating
the mapping that the operating system kernel uses during exec(),
including the PT_INTERP program interpreter (if any).
The brk() is set by a special PT_LOAD segment in the compressed
executable itself. UPX then wipes the stack clean except for
arguments, environment variables, and Elf_auxv entries (this is
required by bugs in the startup code of /lib/ld-linux.so as of
May 2000), and transfers control to the program interpreter or
the e_entry address of the original executable.
The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.</code></pre>
<p>Specific drawbacks:</p>
<pre><code>- For linux/elf386 and linux/sh386 formats, you will be relying on
RAM and swap space to hold all of the decompressed program during
the lifetime of the process. If you already use most of your swap
space, then you may run out. A system that is &quot;out of memory&quot;
can become fragile. Many programs do not react gracefully when
malloc() returns 0. With newer Linux kernels, the kernel
may decide to kill some processes to regain memory, and you
may not like the kernel&#39;s choice of which to kill. Running
/usr/bin/top is one way to check on the usage of swap space.</code></pre>
<p>Extra options available for this executable format:</p>
<pre><code>(none)</code></pre>
<h2 id="NOTES-FOR-LINUX-SH386">NOTES FOR LINUX/SH386</h2>
<p>Please read the general Linux description first.</p>
<p>Shell scripts where the underling shell accepts a ``-c&#39;&#39; argument can use the Linux/sh386 format. <b>UPX</b> decompresses the shell script into low memory, then maps the shell and passes the entire text of the script as an argument with a leading ``-c&#39;&#39;. It does not use space in /tmp, and does not use /proc.</p>
<p>Linux/sh386 is automatically selected for shell scripts that use a known shell.</p>
<p>Packed programs will be byte-identical to the original after uncompression.</p>
<p>How it works:</p>
<pre><code>For shell script executables (files beginning with &quot;#!/&quot; or &quot;#! /&quot;)
where the shell is known to accept &quot;-c &lt;command&gt;&quot;, UPX decompresses
the file into low memory, then maps the shell (and its PT_INTERP),
and passes control to the shell with the entire decompressed file
as the argument after &quot;-c&quot;. Known shells are sh, ash, bash, bsh, csh,
ksh, tcsh, pdksh. Restriction: UPX cannot use this method
for shell scripts which use the one optional string argument after
the shell name in the script (example: &quot;#! /bin/sh option3\n&quot;.)
The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.</code></pre>
<p>Specific drawbacks:</p>
<pre><code>- For linux/elf386 and linux/sh386 formats, you will be relying on
RAM and swap space to hold all of the decompressed program during
the lifetime of the process. If you already use most of your swap
space, then you may run out. A system that is &quot;out of memory&quot;
can become fragile. Many programs do not react gracefully when
malloc() returns 0. With newer Linux kernels, the kernel
may decide to kill some processes to regain memory, and you
may not like the kernel&#39;s choice of which to kill. Running
/usr/bin/top is one way to check on the usage of swap space.</code></pre>
<p>Extra options available for this executable format:</p>
<pre><code>(none)</code></pre>
<h2 id="NOTES-FOR-LINUX-386">NOTES FOR LINUX/386</h2>
<p>Please read the general Linux description first.</p>
<p>The generic linux/386 format decompresses to /tmp and needs /proc file system support. It starts the decompressed program via the execve() syscall.</p>
<p>Linux/386 is only selected if the specialized linux/elf386 and linux/sh386 won&#39;t recognize a file.</p>
<p>Packed programs will be byte-identical to the original after uncompression.</p>
<p>How it works:</p>
<pre><code>For files which are not ELF and not a script for a known &quot;-c&quot; shell,
UPX uses kernel execve(), which first requires decompressing to a
temporary file in the file system. Interestingly -
because of the good memory management of the Linux kernel - this
often does not introduce a noticeable delay, and in fact there
will be no disk access at all if you have enough free memory as
the entire process takes places within the file system buffers.
A compressed executable consists of the UPX stub and an overlay
which contains the original program in a compressed form.
The UPX stub is a statically linked ELF executable and does
the following at program startup:
1) decompress the overlay to a temporary location in /tmp
2) open the temporary file for reading
3) try to delete the temporary file and start (execve)
the uncompressed program in /tmp using /proc/&lt;pid&gt;/fd/X as
attained by step 2)
4) if that fails, fork off a subprocess to clean up and
start the program in /tmp in the meantime
The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.</code></pre>
<p>Specific drawbacks:</p>
<pre><code>- You need additional free disk space for the uncompressed program
in your /tmp directory. This program is deleted immediately after
decompression, but you still need it for the full execution time
of the program.
- You must have /proc file system support as the stub wants to open
/proc/&lt;pid&gt;/exe and needs /proc/&lt;pid&gt;/fd/X. This also means that you
cannot compress programs that are used during the boot sequence
before /proc is mounted.
- Utilities like `top&#39; will display numerical values in the process
name field. This is because Linux computes the process name from
the first argument of the last execve syscall (which is typically
something like /proc/&lt;pid&gt;/fd/3).
- Because of temporary decompression to disk the decompression speed
is not as fast as with the other executable formats. Still, I can see
no noticeable delay when starting programs like my ~3 MiB emacs (which
is less than 1 MiB when compressed :-).</code></pre>
<p>Extra options available for this executable format:</p>
<pre><code>--force-execve Force the use of the generic linux/386 &quot;execve&quot;
format, i.e. do not try the linux/elf386 and
linux/sh386 formats.</code></pre>
<h2 id="NOTES-FOR-PS1-EXE">NOTES FOR PS1/EXE</h2>
<p>This is the executable format used by the Sony PlayStation (PSone), a MIPS R3000 based gaming console which is popular since the late &#39;90s. Support of this format is very similar to the Atari one, because of nostalgic feelings of one of the authors.</p>
<p>Packed programs will be byte-identical to the original after uncompression, until further notice.</p>
<p>Maximum uncompressed size: ~1.89 / ~7.60 MiB.</p>
<p>Notes:</p>
<pre><code>- UPX creates as default a suitable executable for CD-Mastering
and console transfer. For a CD-Master main executable you could also try
the special option &quot;--boot-only&quot; as described below.
It has been reported that upx packed executables are fully compatible with
the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
Sony PlayStation (PSone) emulation mode.
- Normally the packed files use the same memory areas like the uncompressed
versions, so they will not override other memory areas while unpacking.
If this isn&#39;t possible UPX will abort showing a &#39;packed data overlap&#39;
error. With the &quot;--force&quot; option UPX will relocate the loading address
for the packed file, but this isn&#39;t a real problem if it is a single or
the main executable.</code></pre>
<p>Extra options available for this executable format:</p>
<pre><code>--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--8-bit Uses 8 bit size compression [default: 32 bit]
--8mib-ram PSone has 8 MiB ram available [default: 2 MiB]
--boot-only This format is for main exes and CD-Mastering only !
It may slightly improve the compression ratio,
decompression routines are faster than default ones.
But it cannot be used for console transfer !
--no-align This option disables CD mode 2 data sector format
alignment. May slightly improves the compression ratio,
but the compressed executable will not boot from a CD.
Use it for console transfer only !</code></pre>
<h2 id="NOTES-FOR-RTM32-PE-and-ARM-PE">NOTES FOR RTM32/PE and ARM/PE</h2>
<p>Same as win32/pe.</p>
<h2 id="NOTES-FOR-TMT-ADAM">NOTES FOR TMT/ADAM</h2>
<p>This format is used by the TMT Pascal compiler - see http://www.tmt.com/ .</p>
<p>Extra options available for this executable format:</p>
<pre><code>--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.</code></pre>
<h2 id="NOTES-FOR-VMLINUZ-386">NOTES FOR VMLINUZ/386</h2>
<p>The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed bootable Linux kernel image (&quot;vmlinuz&quot;, &quot;zImage&quot;, &quot;bzImage&quot;), gzip-decompress it and re-compress it with the <b>UPX</b> compression method.</p>
<p>vmlinuz/386 is completely unrelated to the other Linux executable formats, and it does not share any of their drawbacks.</p>
<p>Notes:</p>
<pre><code>- Be sure that &quot;vmlinuz/386&quot; or &quot;bvmlinuz/386&quot; is displayed
during compression - otherwise a wrong executable format
may have been used, and the kernel won&#39;t boot.</code></pre>
<p>Benefits:</p>
<pre><code>- Better compression (but note that the kernel was already compressed,
so the improvement is not as large as with other formats).
Still, the bytes saved may be essential for special needs like
boot disks.
For example, this is what I get for my 2.2.16 kernel:
1589708 vmlinux
641073 bzImage [original]
560755 bzImage.upx [compressed by &quot;upx -9&quot;]
- Much faster decompression at kernel boot time (but kernel
decompression speed is not really an issue these days).</code></pre>
<p>Drawbacks:</p>
<pre><code>(none)</code></pre>
<p>Extra options available for this executable format:</p>
<pre><code>--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.</code></pre>
<h2 id="NOTES-FOR-WATCOM-LE">NOTES FOR WATCOM/LE</h2>
<p><b>UPX</b> has been successfully tested with the following extenders: DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender is partly supported (for details see the file bugs BUGS).</p>
<p>DLLs and the LX format are not supported.</p>
<p>Extra options available for this executable format:</p>
<pre><code>--le Produce an unbound LE output instead of
keeping the current stub.</code></pre>
<h2 id="NOTES-FOR-WIN32-PE">NOTES FOR WIN32/PE</h2>
<p>The PE support in <b>UPX</b> is quite stable now, but probably there are still some incompatibilities with some files.</p>
<p>Because of the way <b>UPX</b> (and other packers for this format) works, you can see increased memory usage of your compressed files because the whole program is loaded into memory at startup. If you start several instances of huge compressed programs you&#39;re wasting memory because the common segments of the program won&#39;t get shared across the instances. On the other hand if you&#39;re compressing only smaller programs, or running only one instance of larger programs, then this penalty is smaller, but it&#39;s still there.</p>
<p>If you&#39;re running executables from network, then compressed programs will load faster, and require less bandwidth during execution.</p>
<p>DLLs are supported. But UPX compressed DLLs can not share common data and code when they got used by multiple applications. So compressing msvcrt.dll is a waste of memory, but compressing the dll plugins of a particular application may be a better idea.</p>
<p>Screensavers are supported, with the restriction that the filename must end with &quot;.scr&quot; (as screensavers are handled slightly different than normal exe files).</p>
<p>UPX compressed PE files have some minor memory overhead (usually in the 10 - 30 KiB range) which can be seen by specifying the &quot;-i&quot; command line switch during compression.</p>
<p>Extra options available for this executable format:</p>
<pre><code>--compress-exports=0 Don&#39;t compress the export section.
Use this if you plan to run the compressed
program under Wine.
--compress-exports=1 Compress the export section. [DEFAULT]
Compression of the export section can improve the
compression ratio quite a bit but may not work
with all programs (like winword.exe).
UPX never compresses the export section of a DLL
regardless of this option.
--compress-icons=0 Don&#39;t compress any icons.
--compress-icons=1 Compress all but the first icon.
--compress-icons=2 Compress all icons which are not in the
first icon directory. [DEFAULT]
--compress-icons=3 Compress all icons.
--compress-resources=0 Don&#39;t compress any resources at all.
--keep-resource=list Don&#39;t compress resources specified by the list.
The members of the list are separated by commas.
A list member has the following format: I&lt;type[/name]&gt;.
I&lt;Type&gt; is the type of the resource. Standard types
must be specified as decimal numbers, user types can be
specified by decimal IDs or strings. I&lt;Name&gt; is the
identifier of the resource. It can be a decimal number
or a string. For example:
--keep-resource=2/MYBITMAP,5,6/12345
UPX won&#39;t compress the named bitmap resource &quot;MYBITMAP&quot;,
it leaves every dialog (5) resource uncompressed, and
it won&#39;t touch the string table resource with identifier
12345.
--force Force compression even when there is an
unexpected value in a header field.
Use with care.
--strip-relocs=0 Don&#39;t strip relocation records.
--strip-relocs=1 Strip relocation records. [DEFAULT]
This option only works on executables with base
address greater or equal to 0x400000. Usually the
compressed files becomes smaller, but some files
may become larger. Note that the resulting file will
not work under Windows 3.x (Win32s).
UPX never strips relocations from a DLL
regardless of this option.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.</code></pre>
<h1 id="DIAGNOSTICS">DIAGNOSTICS</h1>
<p>Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.</p>
<p><b>UPX</b>&#39;s diagnostics are intended to be self-explanatory.</p>
<h1 id="BUGS">BUGS</h1>
<p>Please report all bugs immediately to the authors.</p>
<h1 id="AUTHORS">AUTHORS</h1>
<pre><code>Markus F.X.J. Oberhumer &lt;markus@oberhumer.com&gt;
http://www.oberhumer.com
Laszlo Molnar &lt;ezerotven+github@gmail.com&gt;
John F. Reiser &lt;jreiser@BitWagon.com&gt;</code></pre>
<h1 id="COPYRIGHT">COPYRIGHT</h1>
<p>Copyright (C) 1996-2025 Markus Franz Xaver Johannes Oberhumer</p>
<p>Copyright (C) 1996-2025 Laszlo Molnar</p>
<p>Copyright (C) 2000-2025 John F. Reiser</p>
<p><b>UPX</b> is distributed with full source code under the terms of the GNU General Public License v2+; either under the pure GPLv2+ (see the file COPYING), or (at your option) under the GPLv+2 with special exceptions and restrictions granting the free usage for all binaries including commercial programs (see the file LICENSE).</p>
<p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>
<p>You should have received a copy of the UPX License Agreements along with this program; see the files COPYING and LICENSE. If not, visit the UPX home page.</p>
</body>
</html>
+838
View File
@@ -0,0 +1,838 @@
NAME
upx - compress or expand executable files
SYNOPSIS
upx [ *command* ] [ *options* ] *filename*...
ABSTRACT
The Ultimate Packer for eXecutables
Copyright (c) 1996-2025 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io
UPX is a portable, extendable, high-performance executable packer for
several different executable formats. It achieves an excellent
compression ratio and offers **very** fast decompression. Your
executables suffer no memory overhead or other drawbacks for most of the
formats supported, because of in-place decompression.
DISCLAIMER
UPX comes with ABSOLUTELY NO WARRANTY; for details see the file COPYING.
Please report all problems or suggestions to the authors. Thanks.
SECURITY CONTEXT
IMPORTANT NOTE: UPX inherits the security context of any files it
handles.
This means that packing, unpacking, or even testing or listing a file
requires the same security considerations as actually executing the
file.
Use UPX on trusted files only!
DESCRIPTION
UPX is a versatile executable packer with the following features:
- secure: as UPX is documented Open Source since many years any relevant
Security/Antivirus software is able to peek inside UPX compressed
apps to verify them
- excellent compression ratio: typically compresses better than Zip,
use UPX to decrease the size of your distribution !
- very fast decompression: more than 500 MB/sec on any reasonably modern
machine
- no memory overhead for your compressed executables for most of the
supported formats because of in-place decompression
- safe: you can list, test and unpack your executables.
Also, a checksum of both the compressed and uncompressed file is
maintained internally.
- universal: UPX can pack a number of executable formats, including
Windows programs and DLLs, macOS apps and Linux executables
- portable: UPX is written in portable endian-neutral C++
- extendable: because of the class layout it's very easy to support
new executable formats or add new compression algorithms
- free: UPX is distributed with full source code under the GNU General
Public License v2+, with special exceptions granting the free usage
for commercial programs
You probably understand now why we call UPX the "*ultimate*" executable
packer.
COMMANDS
Compress
This is the default operation, eg. upx yourfile.exe will compress the
file specified on the command line.
Decompress
All UPX supported file formats can be unpacked using the -d switch, eg.
upx -d yourfile.exe will uncompress the file you've just compressed.
Test
The -t command tests the integrity of the compressed and uncompressed
data, eg. upx -t yourfile.exe check whether your file can be safely
decompressed. Note, that this command doesn't check the whole file, only
the part that will be uncompressed during program execution. This means
that you should not use this command instead of a virus checker.
List
The -l command prints out some information about the compressed files
specified on the command line as parameters, eg upx -l yourfile.exe
shows the compressed / uncompressed size and the compression ratio of
*yourfile.exe*.
OPTIONS
-q: be quiet, suppress warnings
-q -q (or -qq): be very quiet, suppress errors
-q -q -q (or -qqq): produce no output at all
--help: prints the help
--version: print the version of UPX
--exact: when compressing, require to be able to get a byte-identical
file after decompression with option -d. [NOTE: this is work in progress
and is not supported for all formats yet. If you do care, as a
workaround you can compress and then decompress your program a first
time - any further compress-decompress steps should then yield
byte-identical results as compared to the first decompressed version.]
-k: keep backup files
-o file: write output to file
[ ...more docs need to be written... - type `upx --help' for now ]
COMPRESSION LEVELS & TUNING
UPX offers ten different compression levels from -1 to -9, and --best.
The default compression level is -8 for files smaller than 512 KiB, and
-7 otherwise.
* Compression levels 1, 2 and 3 are pretty fast.
* Compression levels 4, 5 and 6 achieve a good time/ratio performance.
* Compression levels 7, 8 and 9 favor compression ratio over speed.
* Compression level --best may take a long time.
Note that compression level --best can be somewhat slow for large files,
but you definitely should use it when releasing a final version of your
program.
Quick info for achieving the best compression ratio:
* Try upx --brute --no-lzma myfile.exe or even upx --ultra-brute
--no-lzma myfile.exe.
* The option --lzma enables LZMA compression, which compresses better
but is *significantly slower* at decompression. You probably do not
want to use it for large files.
(Note that --lzma is automatically enabled by --all-methods and
--brute, use --no-lzma to override.)
* Try if --overlay=strip works.
* For win32/pe programs there's --strip-relocs=0. See notes below.
OVERLAY HANDLING OPTIONS
Info: An "overlay" means auxiliary data attached after the logical end
of an executable, and it often contains application specific data (this
is a common practice to avoid an extra data file, though it would be
better to use resource sections).
UPX handles overlays like many other executable packers do: it simply
copies the overlay after the compressed image. This works with some
files, but doesn't work with others, depending on how an application
actually accesses this overlaid data.
--overlay=copy Copy any extra data attached to the file. [DEFAULT]
--overlay=strip Strip any overlay from the program instead of
copying it. Be warned, this may make the compressed
program crash or otherwise unusable.
--overlay=skip Refuse to compress any program which has an overlay.
ENVIRONMENT VARIABLE
The environment variable UPX can hold a set of default options for UPX.
These options are interpreted first and can be overwritten by explicit
command line parameters. For example:
for DOS/Windows: set UPX=-9 --compress-icons#0
for sh/ksh/zsh: UPX="-9 --compress-icons=0"; export UPX
for csh/tcsh: setenv UPX "-9 --compress-icons=0"
Under DOS/Windows you must use '#' instead of '=' when setting the
environment variable because of a COMMAND.COM limitation.
Not all of the options are valid in the environment variable - UPX will
tell you.
You can explicitly use the --no-env option to ignore the environment
variable.
NOTES FOR THE SUPPORTED EXECUTABLE FORMATS
NOTES FOR ATARI/TOS
This is the executable format used by the Atari ST/TT, a Motorola 68000
based personal computer which was popular in the late '80s. Support of
this format is only because of nostalgic feelings of one of the authors
and serves no practical purpose :-). See https://freemint.github.io for
more info.
Packed programs will be byte-identical to the original after
uncompression. All debug information will be stripped, though.
Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
NOTES FOR BVMLINUZ/I386
Same as vmlinuz/i386.
NOTES FOR DOS/COM
Obviously UPX won't work with executables that want to read data from
themselves (like some commandline utilities that ship with Win95/98/ME).
Compressed programs only work on a 286+.
Packed programs will be byte-identical to the original after
uncompression.
Maximum uncompressed size: ~65100 bytes.
Extra options available for this executable format:
--8086 Create an executable that works on any 8086 CPU.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR DOS/EXE
dos/exe stands for all "normal" 16-bit DOS executables.
Obviously UPX won't work with executables that want to read data from
themselves (like some command line utilities that ship with
Win95/98/ME).
Compressed programs only work on a 286+.
Extra options available for this executable format:
--8086 Create an executable that works on any 8086 CPU.
--no-reloc Use no relocation records in the exe header.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
NOTES FOR DOS/SYS
Compressed programs only work on a 286+.
Packed programs will be byte-identical to the original after
uncompression.
Maximum uncompressed size: ~65350 bytes.
Extra options available for this executable format:
--8086 Create an executable that works on any 8086 CPU.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR DJGPP2/COFF
First of all, it is recommended to use UPX *instead* of strip. strip has
the very bad habit of replacing your stub with its own (outdated)
version. Additionally UPX corrects a bug/feature in strip v2.8.x: it
will fix the 4 KiB alignment of the stub.
UPX includes the full functionality of stubify. This means it will
automatically stubify your COFF files. Use the option --coff to disable
this functionality (see below).
UPX automatically handles Allegro packfiles.
The DLM format (a rather exotic shared library extension) is not
supported.
Packed programs will be byte-identical to the original after
uncompression. All debug information and trailing garbage will be
stripped, though.
Extra options available for this executable format:
--coff Produce COFF output instead of EXE. By default
UPX keeps your current stub.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR LINUX [general]
Introduction
Linux/386 support in UPX consists of 3 different executable formats,
one optimized for ELF executables ("linux/elf386"), one optimized
for shell scripts ("linux/sh386"), and one generic format
("linux/386").
We will start with a general discussion first, but please
also read the relevant docs for each of the individual formats.
Also, there is special support for bootable kernels - see the
description of the vmlinuz/386 format.
General user's overview
Running a compressed executable program trades less space on a
``permanent'' storage medium (such as a hard disk, floppy disk,
CD-ROM, flash memory, EPROM, etc.) for more space in one or more
``temporary'' storage media (such as RAM, swap space, /tmp, etc.).
Running a compressed executable also requires some additional CPU
cycles to generate the compressed executable in the first place,
and to decompress it at each invocation.
How much space is traded? It depends on the executable, but many
programs save 30% to 50% of permanent disk space. How much CPU
overhead is there? Again, it depends on the executable, but
decompression speed generally is at least many megabytes per second,
and frequently is limited by the speed of the underlying disk
or network I/O.
Depending on the statistics of usage and access, and the relative
speeds of CPU, RAM, swap space, /tmp, and file system storage, then
invoking and running a compressed executable can be faster than
directly running the corresponding uncompressed program.
The operating system might perform fewer expensive I/O operations
to invoke the compressed program. Paging to or from swap space
or /tmp might be faster than paging from the general file system.
``Medium-sized'' programs which access about 1/3 to 1/2 of their
stored program bytes can do particularly well with compression.
Small programs tend not to benefit as much because the absolute
savings is less. Big programs tend not to benefit proportionally
because each invocation may use only a small fraction of the program,
yet UPX decompresses the entire program before invoking it.
But in environments where disk or flash memory storage is limited,
then compression may win anyway.
Currently, executables compressed by UPX do not share RAM at runtime
in the way that executables mapped from a file system do. As a
result, if the same program is run simultaneously by more than one
process, then using the compressed version will require more RAM and/or
swap space. So, shell programs (bash, csh, etc.) and ``make''
might not be good candidates for compression.
UPX recognizes three executable formats for Linux: Linux/elf386,
Linux/sh386, and Linux/386. Linux/386 is the most generic format;
it accommodates any file that can be executed. At runtime, the UPX
decompression stub re-creates in /tmp a copy of the original file,
and then the copy is (re-)executed with the same arguments.
ELF binary executables prefer the Linux/elf386 format by default,
because UPX decompresses them directly into RAM, uses only one
exec, does not use space in /tmp, and does not use /proc.
Shell scripts where the underlying shell accepts a ``-c'' argument
can use the Linux/sh386 format. UPX decompresses the shell script
into low memory, then maps the shell and passes the entire text of the
script as an argument with a leading ``-c''.
General benefits:
- UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
libc6, Shell/Perl/Python/... scripts, standalone Java .class
binaries, or whatever...
All scripts and programs will work just as before.
- Compressed programs are completely self-contained. No need for
any external program.
- UPX keeps your original program untouched. This means that
after decompression you will have a byte-identical version,
and you can use UPX as a file compressor just like gzip.
[ Note that UPX maintains a checksum of the file internally,
so it is indeed a reliable alternative. ]
- As the stub only uses syscalls and isn't linked against libc it
should run under any Linux configuration that can run ELF
binaries.
- For the same reason compressed executables should run under
FreeBSD and other systems which can run Linux binaries.
[ Please send feedback on this topic ]
General drawbacks:
- It is not advisable to compress programs which usually have many
instances running (like `sh' or `make') because the common segments of
compressed programs won't be shared any longer between different
processes.
- `ldd' and `size' won't show anything useful because all they
see is the statically linked stub. Since version 0.82 the section
headers are stripped from the UPX stub and `size' doesn't even
recognize the file format. The file patches/patch-elfcode.h has a
patch to fix this bug in `size' and other programs which use GNU BFD.
General notes:
- As UPX leaves your original program untouched it is advantageous
to strip it before compression.
- If you compress a script you will lose platform independence -
this could be a problem if you are using NFS mounted disks.
- Compression of suid, guid and sticky-bit programs is rejected
because of possible security implications.
- For the same reason there is no sense in making any compressed
program suid.
- Obviously UPX won't work with executables that want to read data
from themselves. E.g., this might be a problem for Perl scripts
which access their __DATA__ lines.
- In case of internal errors the stub will abort with exitcode 127.
Typical reasons for this to happen are that the program has somehow
been modified after compression.
Running `strace -o strace.log compressed_file' will tell you more.
NOTES FOR LINUX/ELF386
Please read the general Linux description first.
The linux/elf386 format decompresses directly into RAM, uses only one
exec, does not use space in /tmp, and does not use /proc.
Linux/elf386 is automatically selected for Linux ELF executables.
Packed programs will be byte-identical to the original after
uncompression.
How it works:
For ELF executables, UPX decompresses directly to memory, simulating
the mapping that the operating system kernel uses during exec(),
including the PT_INTERP program interpreter (if any).
The brk() is set by a special PT_LOAD segment in the compressed
executable itself. UPX then wipes the stack clean except for
arguments, environment variables, and Elf_auxv entries (this is
required by bugs in the startup code of /lib/ld-linux.so as of
May 2000), and transfers control to the program interpreter or
the e_entry address of the original executable.
The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.
Specific drawbacks:
- For linux/elf386 and linux/sh386 formats, you will be relying on
RAM and swap space to hold all of the decompressed program during
the lifetime of the process. If you already use most of your swap
space, then you may run out. A system that is "out of memory"
can become fragile. Many programs do not react gracefully when
malloc() returns 0. With newer Linux kernels, the kernel
may decide to kill some processes to regain memory, and you
may not like the kernel's choice of which to kill. Running
/usr/bin/top is one way to check on the usage of swap space.
Extra options available for this executable format:
(none)
NOTES FOR LINUX/SH386
Please read the general Linux description first.
Shell scripts where the underling shell accepts a ``-c'' argument can
use the Linux/sh386 format. UPX decompresses the shell script into low
memory, then maps the shell and passes the entire text of the script as
an argument with a leading ``-c''. It does not use space in /tmp, and
does not use /proc.
Linux/sh386 is automatically selected for shell scripts that use a known
shell.
Packed programs will be byte-identical to the original after
uncompression.
How it works:
For shell script executables (files beginning with "#!/" or "#! /")
where the shell is known to accept "-c <command>", UPX decompresses
the file into low memory, then maps the shell (and its PT_INTERP),
and passes control to the shell with the entire decompressed file
as the argument after "-c". Known shells are sh, ash, bash, bsh, csh,
ksh, tcsh, pdksh. Restriction: UPX cannot use this method
for shell scripts which use the one optional string argument after
the shell name in the script (example: "#! /bin/sh option3\n".)
The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.
Specific drawbacks:
- For linux/elf386 and linux/sh386 formats, you will be relying on
RAM and swap space to hold all of the decompressed program during
the lifetime of the process. If you already use most of your swap
space, then you may run out. A system that is "out of memory"
can become fragile. Many programs do not react gracefully when
malloc() returns 0. With newer Linux kernels, the kernel
may decide to kill some processes to regain memory, and you
may not like the kernel's choice of which to kill. Running
/usr/bin/top is one way to check on the usage of swap space.
Extra options available for this executable format:
(none)
NOTES FOR LINUX/386
Please read the general Linux description first.
The generic linux/386 format decompresses to /tmp and needs /proc file
system support. It starts the decompressed program via the execve()
syscall.
Linux/386 is only selected if the specialized linux/elf386 and
linux/sh386 won't recognize a file.
Packed programs will be byte-identical to the original after
uncompression.
How it works:
For files which are not ELF and not a script for a known "-c" shell,
UPX uses kernel execve(), which first requires decompressing to a
temporary file in the file system. Interestingly -
because of the good memory management of the Linux kernel - this
often does not introduce a noticeable delay, and in fact there
will be no disk access at all if you have enough free memory as
the entire process takes places within the file system buffers.
A compressed executable consists of the UPX stub and an overlay
which contains the original program in a compressed form.
The UPX stub is a statically linked ELF executable and does
the following at program startup:
1) decompress the overlay to a temporary location in /tmp
2) open the temporary file for reading
3) try to delete the temporary file and start (execve)
the uncompressed program in /tmp using /proc/<pid>/fd/X as
attained by step 2)
4) if that fails, fork off a subprocess to clean up and
start the program in /tmp in the meantime
The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.
Specific drawbacks:
- You need additional free disk space for the uncompressed program
in your /tmp directory. This program is deleted immediately after
decompression, but you still need it for the full execution time
of the program.
- You must have /proc file system support as the stub wants to open
/proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
cannot compress programs that are used during the boot sequence
before /proc is mounted.
- Utilities like `top' will display numerical values in the process
name field. This is because Linux computes the process name from
the first argument of the last execve syscall (which is typically
something like /proc/<pid>/fd/3).
- Because of temporary decompression to disk the decompression speed
is not as fast as with the other executable formats. Still, I can see
no noticeable delay when starting programs like my ~3 MiB emacs (which
is less than 1 MiB when compressed :-).
Extra options available for this executable format:
--force-execve Force the use of the generic linux/386 "execve"
format, i.e. do not try the linux/elf386 and
linux/sh386 formats.
NOTES FOR PS1/EXE
This is the executable format used by the Sony PlayStation (PSone), a
MIPS R3000 based gaming console which is popular since the late '90s.
Support of this format is very similar to the Atari one, because of
nostalgic feelings of one of the authors.
Packed programs will be byte-identical to the original after
uncompression, until further notice.
Maximum uncompressed size: ~1.89 / ~7.60 MiB.
Notes:
- UPX creates as default a suitable executable for CD-Mastering
and console transfer. For a CD-Master main executable you could also try
the special option "--boot-only" as described below.
It has been reported that upx packed executables are fully compatible with
the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
Sony PlayStation (PSone) emulation mode.
- Normally the packed files use the same memory areas like the uncompressed
versions, so they will not override other memory areas while unpacking.
If this isn't possible UPX will abort showing a 'packed data overlap'
error. With the "--force" option UPX will relocate the loading address
for the packed file, but this isn't a real problem if it is a single or
the main executable.
Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--8-bit Uses 8 bit size compression [default: 32 bit]
--8mib-ram PSone has 8 MiB ram available [default: 2 MiB]
--boot-only This format is for main exes and CD-Mastering only !
It may slightly improve the compression ratio,
decompression routines are faster than default ones.
But it cannot be used for console transfer !
--no-align This option disables CD mode 2 data sector format
alignment. May slightly improves the compression ratio,
but the compressed executable will not boot from a CD.
Use it for console transfer only !
NOTES FOR RTM32/PE and ARM/PE
Same as win32/pe.
NOTES FOR TMT/ADAM
This format is used by the TMT Pascal compiler - see http://www.tmt.com/
.
Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR VMLINUZ/386
The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed bootable
Linux kernel image ("vmlinuz", "zImage", "bzImage"), gzip-decompress it
and re-compress it with the UPX compression method.
vmlinuz/386 is completely unrelated to the other Linux executable
formats, and it does not share any of their drawbacks.
Notes:
- Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed
during compression - otherwise a wrong executable format
may have been used, and the kernel won't boot.
Benefits:
- Better compression (but note that the kernel was already compressed,
so the improvement is not as large as with other formats).
Still, the bytes saved may be essential for special needs like
boot disks.
For example, this is what I get for my 2.2.16 kernel:
1589708 vmlinux
641073 bzImage [original]
560755 bzImage.upx [compressed by "upx -9"]
- Much faster decompression at kernel boot time (but kernel
decompression speed is not really an issue these days).
Drawbacks:
(none)
Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR WATCOM/LE
UPX has been successfully tested with the following extenders: DOS4G,
DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender is partly
supported (for details see the file bugs BUGS).
DLLs and the LX format are not supported.
Extra options available for this executable format:
--le Produce an unbound LE output instead of
keeping the current stub.
NOTES FOR WIN32/PE
The PE support in UPX is quite stable now, but probably there are still
some incompatibilities with some files.
Because of the way UPX (and other packers for this format) works, you
can see increased memory usage of your compressed files because the
whole program is loaded into memory at startup. If you start several
instances of huge compressed programs you're wasting memory because the
common segments of the program won't get shared across the instances. On
the other hand if you're compressing only smaller programs, or running
only one instance of larger programs, then this penalty is smaller, but
it's still there.
If you're running executables from network, then compressed programs
will load faster, and require less bandwidth during execution.
DLLs are supported. But UPX compressed DLLs can not share common data
and code when they got used by multiple applications. So compressing
msvcrt.dll is a waste of memory, but compressing the dll plugins of a
particular application may be a better idea.
Screensavers are supported, with the restriction that the filename must
end with ".scr" (as screensavers are handled slightly different than
normal exe files).
UPX compressed PE files have some minor memory overhead (usually in the
10 - 30 KiB range) which can be seen by specifying the "-i" command line
switch during compression.
Extra options available for this executable format:
--compress-exports=0 Don't compress the export section.
Use this if you plan to run the compressed
program under Wine.
--compress-exports=1 Compress the export section. [DEFAULT]
Compression of the export section can improve the
compression ratio quite a bit but may not work
with all programs (like winword.exe).
UPX never compresses the export section of a DLL
regardless of this option.
--compress-icons=0 Don't compress any icons.
--compress-icons=1 Compress all but the first icon.
--compress-icons=2 Compress all icons which are not in the
first icon directory. [DEFAULT]
--compress-icons=3 Compress all icons.
--compress-resources=0 Don't compress any resources at all.
--keep-resource=list Don't compress resources specified by the list.
The members of the list are separated by commas.
A list member has the following format: I<type[/name]>.
I<Type> is the type of the resource. Standard types
must be specified as decimal numbers, user types can be
specified by decimal IDs or strings. I<Name> is the
identifier of the resource. It can be a decimal number
or a string. For example:
--keep-resource=2/MYBITMAP,5,6/12345
UPX won't compress the named bitmap resource "MYBITMAP",
it leaves every dialog (5) resource uncompressed, and
it won't touch the string table resource with identifier
12345.
--force Force compression even when there is an
unexpected value in a header field.
Use with care.
--strip-relocs=0 Don't strip relocation records.
--strip-relocs=1 Strip relocation records. [DEFAULT]
This option only works on executables with base
address greater or equal to 0x400000. Usually the
compressed files becomes smaller, but some files
may become larger. Note that the resulting file will
not work under Windows 3.x (Win32s).
UPX never strips relocations from a DLL
regardless of this option.
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
DIAGNOSTICS
Exit status is normally 0; if an error occurs, exit status is 1. If a
warning occurs, exit status is 2.
UPX's diagnostics are intended to be self-explanatory.
BUGS
Please report all bugs immediately to the authors.
AUTHORS
Markus F.X.J. Oberhumer <markus@oberhumer.com>
http://www.oberhumer.com
Laszlo Molnar <ezerotven+github@gmail.com>
John F. Reiser <jreiser@BitWagon.com>
COPYRIGHT
Copyright (C) 1996-2025 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2025 Laszlo Molnar
Copyright (C) 2000-2025 John F. Reiser
UPX is distributed with full source code under the terms of the GNU
General Public License v2+; either under the pure GPLv2+ (see the file
COPYING), or (at your option) under the GPLv+2 with special exceptions
and restrictions granting the free usage for all binaries including
commercial programs (see the file LICENSE).
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the UPX License Agreements along with
this program; see the files COPYING and LICENSE. If not, visit the UPX
home page.
Generated
+960
View File
@@ -0,0 +1,960 @@
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "UPX 1"
.TH UPX 1 2025-10-24 "upx 5.1.0" " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
upx \- compress or expand executable files
.SH SYNOPSIS
.IX Header "SYNOPSIS"
\&\fBupx\fR [\ \fIcommand\fR\ ] [\ \fIoptions\fR\ ] \fIfilename\fR...
.SH ABSTRACT
.IX Header "ABSTRACT"
.Vb 3
\& The Ultimate Packer for eXecutables
\& Copyright (c) 1996\-2025 Markus Oberhumer, Laszlo Molnar & John Reiser
\& https://upx.github.io
.Ve
.PP
\&\fBUPX\fR is a portable, extendable, high-performance executable packer for
several different executable formats. It achieves an excellent compression
ratio and offers \fI*very*\fR fast decompression. Your executables suffer
no memory overhead or other drawbacks for most of the formats supported,
because of in-place decompression.
.SH DISCLAIMER
.IX Header "DISCLAIMER"
\&\fBUPX\fR comes with ABSOLUTELY NO WARRANTY; for details see the file COPYING.
.PP
Please report all problems or suggestions to the authors. Thanks.
.SH "SECURITY CONTEXT"
.IX Header "SECURITY CONTEXT"
IMPORTANT NOTE: \fBUPX\fR inherits the security context of any files it handles.
.PP
This means that packing, unpacking, or even testing or listing a file requires
the same security considerations as actually executing the file.
.PP
Use \fBUPX\fR on trusted files only!
.SH DESCRIPTION
.IX Header "DESCRIPTION"
\&\fBUPX\fR is a versatile executable packer with the following features:
.PP
.Vb 3
\& \- secure: as UPX is documented Open Source since many years any relevant
\& Security/Antivirus software is able to peek inside UPX compressed
\& apps to verify them
\&
\& \- excellent compression ratio: typically compresses better than Zip,
\& use UPX to decrease the size of your distribution !
\&
\& \- very fast decompression: more than 500 MB/sec on any reasonably modern
\& machine
\&
\& \- no memory overhead for your compressed executables for most of the
\& supported formats because of in\-place decompression
\&
\& \- safe: you can list, test and unpack your executables.
\& Also, a checksum of both the compressed and uncompressed file is
\& maintained internally.
\&
\& \- universal: UPX can pack a number of executable formats, including
\& Windows programs and DLLs, macOS apps and Linux executables
\&
\& \- portable: UPX is written in portable endian\-neutral C++
\&
\& \- extendable: because of the class layout it\*(Aqs very easy to support
\& new executable formats or add new compression algorithms
\&
\& \- free: UPX is distributed with full source code under the GNU General
\& Public License v2+, with special exceptions granting the free usage
\& for commercial programs
.Ve
.PP
You probably understand now why we call \fBUPX\fR the "\fIultimate\fR"
executable packer.
.SH COMMANDS
.IX Header "COMMANDS"
.SS Compress
.IX Subsection "Compress"
This is the default operation, eg. \fBupx yourfile.exe\fR will compress the file
specified on the command line.
.SS Decompress
.IX Subsection "Decompress"
All \fBUPX\fR supported file formats can be unpacked using the \fB\-d\fR switch, eg.
\&\fBupx \-d yourfile.exe\fR will uncompress the file you've just compressed.
.SS Test
.IX Subsection "Test"
The \fB\-t\fR command tests the integrity of the compressed and uncompressed
data, eg. \fBupx \-t yourfile.exe\fR check whether your file can be safely
decompressed. Note, that this command doesn't check the whole file, only
the part that will be uncompressed during program execution. This means
that you should not use this command instead of a virus checker.
.SS List
.IX Subsection "List"
The \fB\-l\fR command prints out some information about the compressed files
specified on the command line as parameters, eg \fBupx \-l yourfile.exe\fR
shows the compressed / uncompressed size and the compression ratio of
\&\fIyourfile.exe\fR.
.SH OPTIONS
.IX Header "OPTIONS"
\&\fB\-q\fR: be quiet, suppress warnings
.PP
\&\fB\-q \-q\fR (or \fB\-qq\fR): be very quiet, suppress errors
.PP
\&\fB\-q \-q \-q\fR (or \fB\-qqq\fR): produce no output at all
.PP
\&\fB\-\-help\fR: prints the help
.PP
\&\fB\-\-version\fR: print the version of \fBUPX\fR
.PP
\&\fB\-\-exact\fR: when compressing, require to be able to get a byte-identical file
after decompression with option \fB\-d\fR. [NOTE: this is work in progress and is
not supported for all formats yet. If you do care, as a workaround you can
compress and then decompress your program a first time \- any further
compress-decompress steps should then yield byte-identical results
as compared to the first decompressed version.]
.PP
\&\fB\-k\fR: keep backup files
.PP
\&\fB\-o file\fR: write output to file
.PP
[ ...more docs need to be written... \- type `\fBupx \-\-help\fR' for now ]
.SH "COMPRESSION LEVELS & TUNING"
.IX Header "COMPRESSION LEVELS & TUNING"
\&\fBUPX\fR offers ten different compression levels from \fB\-1\fR to \fB\-9\fR,
and \fB\-\-best\fR. The default compression level is \fB\-8\fR for files
smaller than 512 KiB, and \fB\-7\fR otherwise.
.IP \(bu 4
Compression levels 1, 2 and 3 are pretty fast.
.IP \(bu 4
Compression levels 4, 5 and 6 achieve a good time/ratio performance.
.IP \(bu 4
Compression levels 7, 8 and 9 favor compression ratio over speed.
.IP \(bu 4
Compression level \fB\-\-best\fR may take a long time.
.PP
Note that compression level \fB\-\-best\fR can be somewhat slow for large
files, but you definitely should use it when releasing a final version
of your program.
.PP
Quick info for achieving the best compression ratio:
.IP \(bu 4
Try \fBupx \-\-brute \-\-no\-lzma myfile.exe\fR or even
\&\fBupx \-\-ultra\-brute \-\-no\-lzma myfile.exe\fR.
.IP \(bu 4
The option \fB\-\-lzma\fR enables LZMA compression, which compresses better but
is *significantly slower* at decompression. You probably do not want
to use it for large files.
.Sp
(Note that \fB\-\-lzma\fR is automatically enabled by \fB\-\-all\-methods\fR and
\&\fB\-\-brute\fR, use \fB\-\-no\-lzma\fR to override.)
.IP \(bu 4
Try if \fB\-\-overlay=strip\fR works.
.IP \(bu 4
For win32/pe programs there's \fB\-\-strip\-relocs=0\fR. See notes below.
.SH "OVERLAY HANDLING OPTIONS"
.IX Header "OVERLAY HANDLING OPTIONS"
Info: An "overlay" means auxiliary data attached after the logical end of
an executable, and it often contains application specific data
(this is a common practice to avoid an extra data file, though
it would be better to use resource sections).
.PP
\&\fBUPX\fR handles overlays like many other executable packers do: it simply
copies the overlay after the compressed image. This works with some
files, but doesn't work with others, depending on how an application
actually accesses this overlaid data.
.PP
.Vb 1
\& \-\-overlay=copy Copy any extra data attached to the file. [DEFAULT]
\&
\& \-\-overlay=strip Strip any overlay from the program instead of
\& copying it. Be warned, this may make the compressed
\& program crash or otherwise unusable.
\&
\& \-\-overlay=skip Refuse to compress any program which has an overlay.
.Ve
.SH "ENVIRONMENT VARIABLE"
.IX Header "ENVIRONMENT VARIABLE"
The environment variable \fBUPX\fR can hold a set of default
options for \fBUPX\fR. These options are interpreted first and
can be overwritten by explicit command line parameters.
For example:
.PP
.Vb 3
\& for DOS/Windows: set UPX=\-9 \-\-compress\-icons#0
\& for sh/ksh/zsh: UPX="\-9 \-\-compress\-icons=0"; export UPX
\& for csh/tcsh: setenv UPX "\-9 \-\-compress\-icons=0"
.Ve
.PP
Under DOS/Windows you must use '#' instead of '=' when setting the
environment variable because of a COMMAND.COM limitation.
.PP
Not all of the options are valid in the environment variable \-
\&\fBUPX\fR will tell you.
.PP
You can explicitly use the \fB\-\-no\-env\fR option to ignore the
environment variable.
.SH "NOTES FOR THE SUPPORTED EXECUTABLE FORMATS"
.IX Header "NOTES FOR THE SUPPORTED EXECUTABLE FORMATS"
.SS "NOTES FOR ATARI/TOS"
.IX Subsection "NOTES FOR ATARI/TOS"
This is the executable format used by the Atari ST/TT, a Motorola 68000
based personal computer which was popular in the late '80s. Support
of this format is only because of nostalgic feelings of one of
the authors and serves no practical purpose :\-).
See https://freemint.github.io for more info.
.PP
Packed programs will be byte-identical to the original after uncompression.
All debug information will be stripped, though.
.PP
Extra options available for this executable format:
.PP
.Vb 4
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
.Ve
.SS "NOTES FOR BVMLINUZ/I386"
.IX Subsection "NOTES FOR BVMLINUZ/I386"
Same as vmlinuz/i386.
.SS "NOTES FOR DOS/COM"
.IX Subsection "NOTES FOR DOS/COM"
Obviously \fBUPX\fR won't work with executables that want to read data from
themselves (like some commandline utilities that ship with Win95/98/ME).
.PP
Compressed programs only work on a 286+.
.PP
Packed programs will be byte-identical to the original after uncompression.
.PP
Maximum uncompressed size: ~65100 bytes.
.PP
Extra options available for this executable format:
.PP
.Vb 1
\& \-\-8086 Create an executable that works on any 8086 CPU.
\&
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
\&
\& \-\-all\-filters Compress the program several times, using all
\& available preprocessing filters. This may improve
\& the compression ratio in some cases, but usually
\& the default filter gives the best results anyway.
.Ve
.SS "NOTES FOR DOS/EXE"
.IX Subsection "NOTES FOR DOS/EXE"
dos/exe stands for all "normal" 16\-bit DOS executables.
.PP
Obviously \fBUPX\fR won't work with executables that want to read data from
themselves (like some command line utilities that ship with Win95/98/ME).
.PP
Compressed programs only work on a 286+.
.PP
Extra options available for this executable format:
.PP
.Vb 1
\& \-\-8086 Create an executable that works on any 8086 CPU.
\&
\& \-\-no\-reloc Use no relocation records in the exe header.
\&
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
.Ve
.SS "NOTES FOR DOS/SYS"
.IX Subsection "NOTES FOR DOS/SYS"
Compressed programs only work on a 286+.
.PP
Packed programs will be byte-identical to the original after uncompression.
.PP
Maximum uncompressed size: ~65350 bytes.
.PP
Extra options available for this executable format:
.PP
.Vb 1
\& \-\-8086 Create an executable that works on any 8086 CPU.
\&
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
\&
\& \-\-all\-filters Compress the program several times, using all
\& available preprocessing filters. This may improve
\& the compression ratio in some cases, but usually
\& the default filter gives the best results anyway.
.Ve
.SS "NOTES FOR DJGPP2/COFF"
.IX Subsection "NOTES FOR DJGPP2/COFF"
First of all, it is recommended to use \fBUPX\fR *instead* of \fBstrip\fR. strip has
the very bad habit of replacing your stub with its own (outdated) version.
Additionally \fBUPX\fR corrects a bug/feature in strip v2.8.x: it
will fix the 4 KiB alignment of the stub.
.PP
\&\fBUPX\fR includes the full functionality of stubify. This means it will
automatically stubify your COFF files. Use the option \fB\-\-coff\fR to
disable this functionality (see below).
.PP
\&\fBUPX\fR automatically handles Allegro packfiles.
.PP
The DLM format (a rather exotic shared library extension) is not supported.
.PP
Packed programs will be byte-identical to the original after uncompression.
All debug information and trailing garbage will be stripped, though.
.PP
Extra options available for this executable format:
.PP
.Vb 2
\& \-\-coff Produce COFF output instead of EXE. By default
\& UPX keeps your current stub.
\&
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
\&
\& \-\-all\-filters Compress the program several times, using all
\& available preprocessing filters. This may improve
\& the compression ratio in some cases, but usually
\& the default filter gives the best results anyway.
.Ve
.SS "NOTES FOR LINUX [general]"
.IX Subsection "NOTES FOR LINUX [general]"
Introduction
.PP
.Vb 4
\& Linux/386 support in UPX consists of 3 different executable formats,
\& one optimized for ELF executables ("linux/elf386"), one optimized
\& for shell scripts ("linux/sh386"), and one generic format
\& ("linux/386").
\&
\& We will start with a general discussion first, but please
\& also read the relevant docs for each of the individual formats.
\&
\& Also, there is special support for bootable kernels \- see the
\& description of the vmlinuz/386 format.
.Ve
.PP
General user's overview
.PP
.Vb 7
\& Running a compressed executable program trades less space on a
\& \`\`permanent\*(Aq\*(Aq storage medium (such as a hard disk, floppy disk,
\& CD\-ROM, flash memory, EPROM, etc.) for more space in one or more
\& \`\`temporary\*(Aq\*(Aq storage media (such as RAM, swap space, /tmp, etc.).
\& Running a compressed executable also requires some additional CPU
\& cycles to generate the compressed executable in the first place,
\& and to decompress it at each invocation.
\&
\& How much space is traded? It depends on the executable, but many
\& programs save 30% to 50% of permanent disk space. How much CPU
\& overhead is there? Again, it depends on the executable, but
\& decompression speed generally is at least many megabytes per second,
\& and frequently is limited by the speed of the underlying disk
\& or network I/O.
\&
\& Depending on the statistics of usage and access, and the relative
\& speeds of CPU, RAM, swap space, /tmp, and file system storage, then
\& invoking and running a compressed executable can be faster than
\& directly running the corresponding uncompressed program.
\& The operating system might perform fewer expensive I/O operations
\& to invoke the compressed program. Paging to or from swap space
\& or /tmp might be faster than paging from the general file system.
\& \`\`Medium\-sized\*(Aq\*(Aq programs which access about 1/3 to 1/2 of their
\& stored program bytes can do particularly well with compression.
\& Small programs tend not to benefit as much because the absolute
\& savings is less. Big programs tend not to benefit proportionally
\& because each invocation may use only a small fraction of the program,
\& yet UPX decompresses the entire program before invoking it.
\& But in environments where disk or flash memory storage is limited,
\& then compression may win anyway.
\&
\& Currently, executables compressed by UPX do not share RAM at runtime
\& in the way that executables mapped from a file system do. As a
\& result, if the same program is run simultaneously by more than one
\& process, then using the compressed version will require more RAM and/or
\& swap space. So, shell programs (bash, csh, etc.) and \`\`make\*(Aq\*(Aq
\& might not be good candidates for compression.
\&
\& UPX recognizes three executable formats for Linux: Linux/elf386,
\& Linux/sh386, and Linux/386. Linux/386 is the most generic format;
\& it accommodates any file that can be executed. At runtime, the UPX
\& decompression stub re\-creates in /tmp a copy of the original file,
\& and then the copy is (re\-)executed with the same arguments.
\& ELF binary executables prefer the Linux/elf386 format by default,
\& because UPX decompresses them directly into RAM, uses only one
\& exec, does not use space in /tmp, and does not use /proc.
\& Shell scripts where the underlying shell accepts a \`\`\-c\*(Aq\*(Aq argument
\& can use the Linux/sh386 format. UPX decompresses the shell script
\& into low memory, then maps the shell and passes the entire text of the
\& script as an argument with a leading \`\`\-c\*(Aq\*(Aq.
.Ve
.PP
General benefits:
.PP
.Vb 4
\& \- UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
\& libc6, Shell/Perl/Python/... scripts, standalone Java .class
\& binaries, or whatever...
\& All scripts and programs will work just as before.
\&
\& \- Compressed programs are completely self\-contained. No need for
\& any external program.
\&
\& \- UPX keeps your original program untouched. This means that
\& after decompression you will have a byte\-identical version,
\& and you can use UPX as a file compressor just like gzip.
\& [ Note that UPX maintains a checksum of the file internally,
\& so it is indeed a reliable alternative. ]
\&
\& \- As the stub only uses syscalls and isn\*(Aqt linked against libc it
\& should run under any Linux configuration that can run ELF
\& binaries.
\&
\& \- For the same reason compressed executables should run under
\& FreeBSD and other systems which can run Linux binaries.
\& [ Please send feedback on this topic ]
.Ve
.PP
General drawbacks:
.PP
.Vb 4
\& \- It is not advisable to compress programs which usually have many
\& instances running (like \`sh\*(Aq or \`make\*(Aq) because the common segments of
\& compressed programs won\*(Aqt be shared any longer between different
\& processes.
\&
\& \- \`ldd\*(Aq and \`size\*(Aq won\*(Aqt show anything useful because all they
\& see is the statically linked stub. Since version 0.82 the section
\& headers are stripped from the UPX stub and \`size\*(Aq doesn\*(Aqt even
\& recognize the file format. The file patches/patch\-elfcode.h has a
\& patch to fix this bug in \`size\*(Aq and other programs which use GNU BFD.
.Ve
.PP
General notes:
.PP
.Vb 2
\& \- As UPX leaves your original program untouched it is advantageous
\& to strip it before compression.
\&
\& \- If you compress a script you will lose platform independence \-
\& this could be a problem if you are using NFS mounted disks.
\&
\& \- Compression of suid, guid and sticky\-bit programs is rejected
\& because of possible security implications.
\&
\& \- For the same reason there is no sense in making any compressed
\& program suid.
\&
\& \- Obviously UPX won\*(Aqt work with executables that want to read data
\& from themselves. E.g., this might be a problem for Perl scripts
\& which access their _\|_DATA_\|_ lines.
\&
\& \- In case of internal errors the stub will abort with exitcode 127.
\& Typical reasons for this to happen are that the program has somehow
\& been modified after compression.
\& Running \`strace \-o strace.log compressed_file\*(Aq will tell you more.
.Ve
.SS "NOTES FOR LINUX/ELF386"
.IX Subsection "NOTES FOR LINUX/ELF386"
Please read the general Linux description first.
.PP
The linux/elf386 format decompresses directly into RAM,
uses only one exec, does not use space in /tmp,
and does not use /proc.
.PP
Linux/elf386 is automatically selected for Linux ELF executables.
.PP
Packed programs will be byte-identical to the original after uncompression.
.PP
How it works:
.PP
.Vb 9
\& For ELF executables, UPX decompresses directly to memory, simulating
\& the mapping that the operating system kernel uses during exec(),
\& including the PT_INTERP program interpreter (if any).
\& The brk() is set by a special PT_LOAD segment in the compressed
\& executable itself. UPX then wipes the stack clean except for
\& arguments, environment variables, and Elf_auxv entries (this is
\& required by bugs in the startup code of /lib/ld\-linux.so as of
\& May 2000), and transfers control to the program interpreter or
\& the e_entry address of the original executable.
\&
\& The UPX stub is about 1700 bytes long, partly written in assembler
\& and only uses kernel syscalls. It is not linked against any libc.
.Ve
.PP
Specific drawbacks:
.PP
.Vb 9
\& \- For linux/elf386 and linux/sh386 formats, you will be relying on
\& RAM and swap space to hold all of the decompressed program during
\& the lifetime of the process. If you already use most of your swap
\& space, then you may run out. A system that is "out of memory"
\& can become fragile. Many programs do not react gracefully when
\& malloc() returns 0. With newer Linux kernels, the kernel
\& may decide to kill some processes to regain memory, and you
\& may not like the kernel\*(Aqs choice of which to kill. Running
\& /usr/bin/top is one way to check on the usage of swap space.
.Ve
.PP
Extra options available for this executable format:
.PP
.Vb 1
\& (none)
.Ve
.SS "NOTES FOR LINUX/SH386"
.IX Subsection "NOTES FOR LINUX/SH386"
Please read the general Linux description first.
.PP
Shell scripts where the underling shell accepts a ``\-c'' argument
can use the Linux/sh386 format. \fBUPX\fR decompresses the shell script
into low memory, then maps the shell and passes the entire text of the
script as an argument with a leading ``\-c''.
It does not use space in /tmp, and does not use /proc.
.PP
Linux/sh386 is automatically selected for shell scripts that
use a known shell.
.PP
Packed programs will be byte-identical to the original after uncompression.
.PP
How it works:
.PP
.Vb 8
\& For shell script executables (files beginning with "#!/" or "#! /")
\& where the shell is known to accept "\-c <command>", UPX decompresses
\& the file into low memory, then maps the shell (and its PT_INTERP),
\& and passes control to the shell with the entire decompressed file
\& as the argument after "\-c". Known shells are sh, ash, bash, bsh, csh,
\& ksh, tcsh, pdksh. Restriction: UPX cannot use this method
\& for shell scripts which use the one optional string argument after
\& the shell name in the script (example: "#! /bin/sh option3\en".)
\&
\& The UPX stub is about 1700 bytes long, partly written in assembler
\& and only uses kernel syscalls. It is not linked against any libc.
.Ve
.PP
Specific drawbacks:
.PP
.Vb 9
\& \- For linux/elf386 and linux/sh386 formats, you will be relying on
\& RAM and swap space to hold all of the decompressed program during
\& the lifetime of the process. If you already use most of your swap
\& space, then you may run out. A system that is "out of memory"
\& can become fragile. Many programs do not react gracefully when
\& malloc() returns 0. With newer Linux kernels, the kernel
\& may decide to kill some processes to regain memory, and you
\& may not like the kernel\*(Aqs choice of which to kill. Running
\& /usr/bin/top is one way to check on the usage of swap space.
.Ve
.PP
Extra options available for this executable format:
.PP
.Vb 1
\& (none)
.Ve
.SS "NOTES FOR LINUX/386"
.IX Subsection "NOTES FOR LINUX/386"
Please read the general Linux description first.
.PP
The generic linux/386 format decompresses to /tmp and needs
/proc file system support. It starts the decompressed program
via the \fBexecve()\fR syscall.
.PP
Linux/386 is only selected if the specialized linux/elf386
and linux/sh386 won't recognize a file.
.PP
Packed programs will be byte-identical to the original after uncompression.
.PP
How it works:
.PP
.Vb 7
\& For files which are not ELF and not a script for a known "\-c" shell,
\& UPX uses kernel execve(), which first requires decompressing to a
\& temporary file in the file system. Interestingly \-
\& because of the good memory management of the Linux kernel \- this
\& often does not introduce a noticeable delay, and in fact there
\& will be no disk access at all if you have enough free memory as
\& the entire process takes places within the file system buffers.
\&
\& A compressed executable consists of the UPX stub and an overlay
\& which contains the original program in a compressed form.
\&
\& The UPX stub is a statically linked ELF executable and does
\& the following at program startup:
\&
\& 1) decompress the overlay to a temporary location in /tmp
\& 2) open the temporary file for reading
\& 3) try to delete the temporary file and start (execve)
\& the uncompressed program in /tmp using /proc/<pid>/fd/X as
\& attained by step 2)
\& 4) if that fails, fork off a subprocess to clean up and
\& start the program in /tmp in the meantime
\&
\& The UPX stub is about 1700 bytes long, partly written in assembler
\& and only uses kernel syscalls. It is not linked against any libc.
.Ve
.PP
Specific drawbacks:
.PP
.Vb 4
\& \- You need additional free disk space for the uncompressed program
\& in your /tmp directory. This program is deleted immediately after
\& decompression, but you still need it for the full execution time
\& of the program.
\&
\& \- You must have /proc file system support as the stub wants to open
\& /proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
\& cannot compress programs that are used during the boot sequence
\& before /proc is mounted.
\&
\& \- Utilities like \`top\*(Aq will display numerical values in the process
\& name field. This is because Linux computes the process name from
\& the first argument of the last execve syscall (which is typically
\& something like /proc/<pid>/fd/3).
\&
\& \- Because of temporary decompression to disk the decompression speed
\& is not as fast as with the other executable formats. Still, I can see
\& no noticeable delay when starting programs like my ~3 MiB emacs (which
\& is less than 1 MiB when compressed :\-).
.Ve
.PP
Extra options available for this executable format:
.PP
.Vb 3
\& \-\-force\-execve Force the use of the generic linux/386 "execve"
\& format, i.e. do not try the linux/elf386 and
\& linux/sh386 formats.
.Ve
.SS "NOTES FOR PS1/EXE"
.IX Subsection "NOTES FOR PS1/EXE"
This is the executable format used by the Sony PlayStation (PSone),
a MIPS R3000 based gaming console which is popular since the late '90s.
Support of this format is very similar to the Atari one, because of
nostalgic feelings of one of the authors.
.PP
Packed programs will be byte-identical to the original after uncompression,
until further notice.
.PP
Maximum uncompressed size: ~1.89 / ~7.60 MiB.
.PP
Notes:
.PP
.Vb 6
\& \- UPX creates as default a suitable executable for CD\-Mastering
\& and console transfer. For a CD\-Master main executable you could also try
\& the special option "\-\-boot\-only" as described below.
\& It has been reported that upx packed executables are fully compatible with
\& the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
\& Sony PlayStation (PSone) emulation mode.
\&
\& \- Normally the packed files use the same memory areas like the uncompressed
\& versions, so they will not override other memory areas while unpacking.
\& If this isn\*(Aqt possible UPX will abort showing a \*(Aqpacked data overlap\*(Aq
\& error. With the "\-\-force" option UPX will relocate the loading address
\& for the packed file, but this isn\*(Aqt a real problem if it is a single or
\& the main executable.
.Ve
.PP
Extra options available for this executable format:
.PP
.Vb 4
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
\&
\& \-\-8\-bit Uses 8 bit size compression [default: 32 bit]
\&
\& \-\-8mib\-ram PSone has 8 MiB ram available [default: 2 MiB]
\&
\& \-\-boot\-only This format is for main exes and CD\-Mastering only !
\& It may slightly improve the compression ratio,
\& decompression routines are faster than default ones.
\& But it cannot be used for console transfer !
\&
\& \-\-no\-align This option disables CD mode 2 data sector format
\& alignment. May slightly improves the compression ratio,
\& but the compressed executable will not boot from a CD.
\& Use it for console transfer only !
.Ve
.SS "NOTES FOR RTM32/PE and ARM/PE"
.IX Subsection "NOTES FOR RTM32/PE and ARM/PE"
Same as win32/pe.
.SS "NOTES FOR TMT/ADAM"
.IX Subsection "NOTES FOR TMT/ADAM"
This format is used by the TMT Pascal compiler \- see http://www.tmt.com/ .
.PP
Extra options available for this executable format:
.PP
.Vb 4
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
\&
\& \-\-all\-filters Compress the program several times, using all
\& available preprocessing filters. This may improve
\& the compression ratio in some cases, but usually
\& the default filter gives the best results anyway.
.Ve
.SS "NOTES FOR VMLINUZ/386"
.IX Subsection "NOTES FOR VMLINUZ/386"
The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed
bootable Linux kernel image ("vmlinuz", "zImage", "bzImage"),
gzip-decompress it and re-compress it with the \fBUPX\fR compression method.
.PP
vmlinuz/386 is completely unrelated to the other Linux executable
formats, and it does not share any of their drawbacks.
.PP
Notes:
.PP
.Vb 3
\& \- Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed
\& during compression \- otherwise a wrong executable format
\& may have been used, and the kernel won\*(Aqt boot.
.Ve
.PP
Benefits:
.PP
.Vb 4
\& \- Better compression (but note that the kernel was already compressed,
\& so the improvement is not as large as with other formats).
\& Still, the bytes saved may be essential for special needs like
\& boot disks.
\&
\& For example, this is what I get for my 2.2.16 kernel:
\& 1589708 vmlinux
\& 641073 bzImage [original]
\& 560755 bzImage.upx [compressed by "upx \-9"]
\&
\& \- Much faster decompression at kernel boot time (but kernel
\& decompression speed is not really an issue these days).
.Ve
.PP
Drawbacks:
.PP
.Vb 1
\& (none)
.Ve
.PP
Extra options available for this executable format:
.PP
.Vb 4
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
\&
\& \-\-all\-filters Compress the program several times, using all
\& available preprocessing filters. This may improve
\& the compression ratio in some cases, but usually
\& the default filter gives the best results anyway.
.Ve
.SS "NOTES FOR WATCOM/LE"
.IX Subsection "NOTES FOR WATCOM/LE"
\&\fBUPX\fR has been successfully tested with the following extenders:
DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay.
The WDOS/X extender is partly supported (for details
see the file bugs BUGS).
.PP
DLLs and the LX format are not supported.
.PP
Extra options available for this executable format:
.PP
.Vb 2
\& \-\-le Produce an unbound LE output instead of
\& keeping the current stub.
.Ve
.SS "NOTES FOR WIN32/PE"
.IX Subsection "NOTES FOR WIN32/PE"
The PE support in \fBUPX\fR is quite stable now, but probably there are
still some incompatibilities with some files.
.PP
Because of the way \fBUPX\fR (and other packers for this format) works, you
can see increased memory usage of your compressed files because the whole
program is loaded into memory at startup.
If you start several instances of huge compressed programs you're
wasting memory because the common segments of the program won't
get shared across the instances.
On the other hand if you're compressing only smaller programs, or
running only one instance of larger programs, then this penalty is
smaller, but it's still there.
.PP
If you're running executables from network, then compressed programs
will load faster, and require less bandwidth during execution.
.PP
DLLs are supported. But UPX compressed DLLs can not share common data and
code when they got used by multiple applications. So compressing msvcrt.dll
is a waste of memory, but compressing the dll plugins of a particular
application may be a better idea.
.PP
Screensavers are supported, with the restriction that the filename
must end with ".scr" (as screensavers are handled slightly different
than normal exe files).
.PP
UPX compressed PE files have some minor memory overhead (usually in the
10 \- 30 KiB range) which can be seen by specifying the "\-i" command
line switch during compression.
.PP
Extra options available for this executable format:
.PP
.Vb 9
\& \-\-compress\-exports=0 Don\*(Aqt compress the export section.
\& Use this if you plan to run the compressed
\& program under Wine.
\& \-\-compress\-exports=1 Compress the export section. [DEFAULT]
\& Compression of the export section can improve the
\& compression ratio quite a bit but may not work
\& with all programs (like winword.exe).
\& UPX never compresses the export section of a DLL
\& regardless of this option.
\&
\& \-\-compress\-icons=0 Don\*(Aqt compress any icons.
\& \-\-compress\-icons=1 Compress all but the first icon.
\& \-\-compress\-icons=2 Compress all icons which are not in the
\& first icon directory. [DEFAULT]
\& \-\-compress\-icons=3 Compress all icons.
\&
\& \-\-compress\-resources=0 Don\*(Aqt compress any resources at all.
\&
\& \-\-keep\-resource=list Don\*(Aqt compress resources specified by the list.
\& The members of the list are separated by commas.
\& A list member has the following format: I<type[/name]>.
\& I<Type> is the type of the resource. Standard types
\& must be specified as decimal numbers, user types can be
\& specified by decimal IDs or strings. I<Name> is the
\& identifier of the resource. It can be a decimal number
\& or a string. For example:
\&
\& \-\-keep\-resource=2/MYBITMAP,5,6/12345
\&
\& UPX won\*(Aqt compress the named bitmap resource "MYBITMAP",
\& it leaves every dialog (5) resource uncompressed, and
\& it won\*(Aqt touch the string table resource with identifier
\& 12345.
\&
\& \-\-force Force compression even when there is an
\& unexpected value in a header field.
\& Use with care.
\&
\& \-\-strip\-relocs=0 Don\*(Aqt strip relocation records.
\& \-\-strip\-relocs=1 Strip relocation records. [DEFAULT]
\& This option only works on executables with base
\& address greater or equal to 0x400000. Usually the
\& compressed files becomes smaller, but some files
\& may become larger. Note that the resulting file will
\& not work under Windows 3.x (Win32s).
\& UPX never strips relocations from a DLL
\& regardless of this option.
\&
\& \-\-all\-methods Compress the program several times, using all
\& available compression methods. This may improve
\& the compression ratio in some cases, but usually
\& the default method gives the best results anyway.
\&
\& \-\-all\-filters Compress the program several times, using all
\& available preprocessing filters. This may improve
\& the compression ratio in some cases, but usually
\& the default filter gives the best results anyway.
.Ve
.SH DIAGNOSTICS
.IX Header "DIAGNOSTICS"
Exit status is normally 0; if an error occurs, exit status
is 1. If a warning occurs, exit status is 2.
.PP
\&\fBUPX\fR's diagnostics are intended to be self-explanatory.
.SH BUGS
.IX Header "BUGS"
Please report all bugs immediately to the authors.
.SH AUTHORS
.IX Header "AUTHORS"
.Vb 2
\& Markus F.X.J. Oberhumer <markus@oberhumer.com>
\& http://www.oberhumer.com
\&
\& Laszlo Molnar <ezerotven+github@gmail.com>
\&
\& John F. Reiser <jreiser@BitWagon.com>
.Ve
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright (C) 1996\-2025 Markus Franz Xaver Johannes Oberhumer
.PP
Copyright (C) 1996\-2025 Laszlo Molnar
.PP
Copyright (C) 2000\-2025 John F. Reiser
.PP
\&\fBUPX\fR is distributed with full source code under the terms of the
GNU General Public License v2+; either under the pure GPLv2+ (see
the file COPYING), or (at your option) under the GPLv+2 with special
exceptions and restrictions granting the free usage for all binaries
including commercial programs (see the file LICENSE).
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.PP
You should have received a copy of the UPX License Agreements along
with this program; see the files COPYING and LICENSE. If not,
visit the UPX home page.
+140 -134
View File
@@ -12,9 +12,9 @@ B<upx> S<[ I<command> ]> S<[ I<options> ]> I<filename>...
=head1 ABSTRACT
The Ultimate Packer for eXecutables
Copyright (c) 1996-2004 Markus Oberhumer & Laszlo Molnar
http://upx.sourceforge.net
The Ultimate Packer for eXecutables
Copyright (c) 1996-2025 Markus Oberhumer, Laszlo Molnar & John Reiser
https://upx.github.io
B<UPX> is a portable, extendable, high-performance executable packer for
@@ -23,69 +23,59 @@ ratio and offers I<*very*> fast decompression. Your executables suffer
no memory overhead or other drawbacks for most of the formats supported,
because of in-place decompression.
While you may use B<UPX> freely for both non-commercial and commercial
executables (for details see the file LICENSE), we would highly
appreciate if you credit B<UPX> and ourselves in the documentation,
possibly including a reference to the B<UPX> home page. Thanks.
[ Using B<UPX> in non-OpenSource applications without proper credits
is considered not politically correct ;-) ]
=head1 DISCLAIMER
B<UPX> comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.
This is the first production quality release, and we plan that future 1.xx
releases will be backward compatible with this version.
B<UPX> comes with ABSOLUTELY NO WARRANTY; for details see the file COPYING.
Please report all problems or suggestions to the authors. Thanks.
=head1 SECURITY CONTEXT
IMPORTANT NOTE: B<UPX> inherits the security context of any files it handles.
This means that packing, unpacking, or even testing or listing a file requires
the same security considerations as actually executing the file.
Use B<UPX> on trusted files only!
=head1 DESCRIPTION
B<UPX> is a versatile executable packer with the following features:
- excellent compression ratio: compresses better than zip/gzip,
- secure: as UPX is documented Open Source since many years any relevant
Security/Antivirus software is able to peek inside UPX compressed
apps to verify them
- excellent compression ratio: typically compresses better than Zip,
use UPX to decrease the size of your distribution !
- very fast decompression: about 10 MB/sec on an ancient Pentium 133,
about 200 MB/sec on an Athlon XP 2000+.
- very fast decompression: more than 500 MB/sec on any reasonably modern
machine
- no memory overhead for your compressed executables for most of the
supported formats
supported formats because of in-place decompression
- safe: you can list, test and unpack your executables
- safe: you can list, test and unpack your executables.
Also, a checksum of both the compressed and uncompressed file is
maintained internally.
- universal: UPX can pack a number of executable formats:
* atari/tos
* bvmlinuz/386 [bootable Linux kernel]
* djgpp2/coff
* dos/com
* dos/exe
* dos/sys
* linux/386
* linux/elf386
* linux/sh386
* ps1/exe
* rtm32/pe
* tmt/adam
* vmlinuz/386 [bootable Linux kernel]
* watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
* win32/pe
- universal: UPX can pack a number of executable formats, including
Windows programs and DLLs, macOS apps and Linux executables
- portable: UPX is written in portable endian-neutral C++
- extendable: because of the class layout it's very easy to support
new executable formats or add new compression algorithms
- free: UPX can be distributed and used freely. And from version 0.99
the full source code of UPX is released under the GNU General Public
License (GPL) !
- free: UPX is distributed with full source code under the GNU General
Public License v2+, with special exceptions granting the free usage
for commercial programs
You probably understand now why we call B<UPX> the "I<ultimate>"
executable packer.
@@ -133,7 +123,18 @@ B<--help>: prints the help
B<--version>: print the version of B<UPX>
[ ...to be written... - type `B<upx --help>' for now ]
B<--exact>: when compressing, require to be able to get a byte-identical file
after decompression with option B<-d>. [NOTE: this is work in progress and is
not supported for all formats yet. If you do care, as a workaround you can
compress and then decompress your program a first time - any further
compress-decompress steps should then yield byte-identical results
as compared to the first decompressed version.]
B<-k>: keep backup files
B<-o file>: write output to file
[ ...more docs need to be written... - type `B<upx --help>' for now ]
@@ -141,7 +142,7 @@ B<--version>: print the version of B<UPX>
B<UPX> offers ten different compression levels from B<-1> to B<-9>,
and B<--best>. The default compression level is B<-8> for files
smaller than 512 kB, and B<-7> otherwise.
smaller than 512 KiB, and B<-7> otherwise.
=over 4
@@ -167,38 +168,23 @@ Note that compression level B<--best> can be somewhat slow for large
files, but you definitely should use it when releasing a final version
of your program.
Quick start for achieving the best compression ratio:
=over 4
Try B<upx --brute myfile.exe>.
=back
Details for achieving the best compression ratio:
Quick info for achieving the best compression ratio:
=over 4
=item *
Use the compression level B<--best>.
Try B<upx --brute --no-lzma myfile.exe> or even
B<upx --ultra-brute --no-lzma myfile.exe>.
=item *
Try one or both of the options B<--all-methods> and B<--all-filters>.
The option B<--lzma> enables LZMA compression, which compresses better but
is *significantly slower* at decompression. You probably do not want
to use it for large files.
=item *
Try the option B<--crp-ms=NUMBER>. This uses more memory during compression
to achieve a (slightly) better compression ratio.
NUMBER must be a decimal value from 10000 to 999999, inclusive.
The default value is 10000 (ten thousand).
=item *
Info: the option B<--brute> is an abbrevation for the options
B<S<--best> S<--all-methods> S<--all-filters> S<--crp-ms=999999>>.
(Note that B<--lzma> is automatically enabled by B<--all-methods> and
B<--brute>, use B<--no-lzma> to override.)
=item *
@@ -214,7 +200,7 @@ For win32/pe programs there's B<--strip-relocs=0>. See notes below.
=head1 OVERLAY HANDLING OPTIONS
Info: An "overlay" means auxillary data atached after the logical end of
Info: An "overlay" means auxiliary data attached after the logical end of
an executable, and it often contains application specific data
(this is a common practice to avoid an extra data file, though
it would be better to use resource sections).
@@ -222,10 +208,7 @@ it would be better to use resource sections).
B<UPX> handles overlays like many other executable packers do: it simply
copies the overlay after the compressed image. This works with some
files, but doesn't work with others, depending on how an application
actually accesses this overlayed data.
Since version 0.90 UPX defaults to B<--overlay=copy> for
all executable formats.
actually accesses this overlaid data.
--overlay=copy Copy any extra data attached to the file. [DEFAULT]
@@ -237,7 +220,7 @@ all executable formats.
=head1 ENVIRONMENT
=head1 ENVIRONMENT VARIABLE
The environment variable B<UPX> can hold a set of default
options for B<UPX>. These options are interpreted first and
@@ -267,7 +250,7 @@ This is the executable format used by the Atari ST/TT, a Motorola 68000
based personal computer which was popular in the late '80s. Support
of this format is only because of nostalgic feelings of one of
the authors and serves no practical purpose :-).
See http://www.freemint.de for more info.
See https://freemint.github.io for more info.
Packed programs will be byte-identical to the original after uncompression.
All debug information will be stripped, though.
@@ -338,9 +321,6 @@ Extra options available for this executable format:
=head2 NOTES FOR DOS/SYS
You can only compress plain sys files, sys/exe (two in one)
combos are not supported.
Compressed programs only work on a 286+.
Packed programs will be byte-identical to the original after uncompression.
@@ -368,7 +348,7 @@ Extra options available for this executable format:
First of all, it is recommended to use B<UPX> *instead* of B<strip>. strip has
the very bad habit of replacing your stub with its own (outdated) version.
Additionally B<UPX> corrects a bug/feature in strip v2.8.x: it
will fix the 4 KByte aligment of the stub.
will fix the 4 KiB alignment of the stub.
B<UPX> includes the full functionality of stubify. This means it will
automatically stubify your COFF files. Use the option B<--coff> to
@@ -403,7 +383,7 @@ Extra options available for this executable format:
Introduction
Linux/386 support in UPX consists of 3 different executable formats,
one optimized for ELF excutables ("linux/elf386"), one optimized
one optimized for ELF executables ("linux/elf386"), one optimized
for shell scripts ("linux/sh386"), and one generic format
("linux/386").
@@ -431,14 +411,14 @@ General user's overview
or network I/O.
Depending on the statistics of usage and access, and the relative
speeds of CPU, RAM, swap space, /tmp, and filesystem storage, then
speeds of CPU, RAM, swap space, /tmp, and file system storage, then
invoking and running a compressed executable can be faster than
directly running the corresponding uncompressed program.
The operating system might perfrom fewer expensive I/O operations
The operating system might perform fewer expensive I/O operations
to invoke the compressed program. Paging to or from swap space
or /tmp might be faster than paging from the general filesystem.
or /tmp might be faster than paging from the general file system.
``Medium-sized'' programs which access about 1/3 to 1/2 of their
stored program bytes can do particulary well with compression.
stored program bytes can do particularly well with compression.
Small programs tend not to benefit as much because the absolute
savings is less. Big programs tend not to benefit proportionally
because each invocation may use only a small fraction of the program,
@@ -447,7 +427,7 @@ General user's overview
then compression may win anyway.
Currently, executables compressed by UPX do not share RAM at runtime
in the way that executables mapped from a filesystem do. As a
in the way that executables mapped from a file system do. As a
result, if the same program is run simultaneously by more than one
process, then using the compressed version will require more RAM and/or
swap space. So, shell programs (bash, csh, etc.) and ``make''
@@ -536,7 +516,7 @@ The linux/elf386 format decompresses directly into RAM,
uses only one exec, does not use space in /tmp,
and does not use /proc.
Linux/elf386 is automatically selected for Linux ELF exectuables.
Linux/elf386 is automatically selected for Linux ELF executables.
Packed programs will be byte-identical to the original after uncompression.
@@ -625,7 +605,7 @@ Extra options available for this executable format:
Please read the general Linux description first.
The generic linux/386 format decompresses to /tmp and needs
/proc filesystem support. It starts the decompressed program
/proc file system support. It starts the decompressed program
via the execve() syscall.
Linux/386 is only selected if the specialized linux/elf386
@@ -637,11 +617,11 @@ How it works:
For files which are not ELF and not a script for a known "-c" shell,
UPX uses kernel execve(), which first requires decompressing to a
temporary file in the filesystem. Interestingly -
temporary file in the file system. Interestingly -
because of the good memory management of the Linux kernel - this
often does not introduce a noticable delay, and in fact there
often does not introduce a noticeable delay, and in fact there
will be no disk access at all if you have enough free memory as
the entire process takes places within the filesystem buffers.
the entire process takes places within the file system buffers.
A compressed executable consists of the UPX stub and an overlay
which contains the original program in a compressed form.
@@ -667,7 +647,7 @@ Specific drawbacks:
decompression, but you still need it for the full execution time
of the program.
- You must have /proc filesystem support as the stub wants to open
- You must have /proc file system support as the stub wants to open
/proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
cannot compress programs that are used during the boot sequence
before /proc is mounted.
@@ -679,8 +659,8 @@ Specific drawbacks:
- Because of temporary decompression to disk the decompression speed
is not as fast as with the other executable formats. Still, I can see
no noticable delay when starting programs like my ~3 MB emacs (which
is less than 1 MB when compressed :-).
no noticeable delay when starting programs like my ~3 MiB emacs (which
is less than 1 MiB when compressed :-).
Extra options available for this executable format:
@@ -693,26 +673,30 @@ Extra options available for this executable format:
=head2 NOTES FOR PS1/EXE
This is the executable format used by the Sony PlayStation (PSone),
a Mips R3000 based gaming console which is popular since the late '90s.
a MIPS R3000 based gaming console which is popular since the late '90s.
Support of this format is very similar to the Atari one, because of
nostalgic feelings of one of the authors, but this format maybe serves
a practical purpose ;-).
nostalgic feelings of one of the authors.
Packed programs will be byte-identical to the original after uncompression.
Packed programs will be byte-identical to the original after uncompression,
until further notice.
Maximum uncompressed size: ~1998848 bytes.
Maximum uncompressed size: ~1.89 / ~7.60 MiB.
Notes:
- UPX creates as default a 'CD-Rom only' PS1/PS2 compatible executable.
For transfer between client/target use options below.
- UPX creates as default a suitable executable for CD-Mastering
and console transfer. For a CD-Master main executable you could also try
the special option "--boot-only" as described below.
It has been reported that upx packed executables are fully compatible with
the Sony PlayStation 2 (PS2, PStwo) and Sony PlayStation Portable (PSP) in
Sony PlayStation (PSone) emulation mode.
- Normally the packed files use the same memory areas like the uncompressed
versions, so they will not override other memory areas while unpacking.
If this isn't possible UPX will abort showing a 'packed data overlap'
error. With the "--force" option UPX will set a few 'bytes higher' loading
offset for the packed file, but this isn't a real problem if it is a
single or boot-only executable.
error. With the "--force" option UPX will relocate the loading address
for the packed file, but this isn't a real problem if it is a single or
the main executable.
Extra options available for this executable format:
@@ -721,21 +705,23 @@ Extra options available for this executable format:
the compression ratio in some cases, but usually
the default method gives the best results anyway.
--console-run This enables client/target transfer compatibility.
This format also run from a CD, except the "--no-align"
option is used. Upto 2024 bytes larger files
than [default] will be the result, also a
slower decompression speed can be expected.
--8-bit Uses 8 bit size compression [default: 32 bit]
--8mib-ram PSone has 8 MiB ram available [default: 2 MiB]
--boot-only This format is for main exes and CD-Mastering only !
It may slightly improve the compression ratio,
decompression routines are faster than default ones.
But it cannot be used for console transfer !
--no-align This option disables CD mode 2 data sector format
alignment, and enables "--console-run".
This will slightly improve the compression ratio,
alignment. May slightly improves the compression ratio,
but the compressed executable will not boot from a CD.
So use it for client/target transfer only!.
Use it for console transfer only !
=head2 NOTES FOR RTM32/PE
=head2 NOTES FOR RTM32/PE and ARM/PE
Same as win32/pe.
@@ -779,7 +765,7 @@ Benefits:
- Better compression (but note that the kernel was already compressed,
so the improvement is not as large as with other formats).
Still, the bytes saved may be essential for special needs like
bootdisks.
boot disks.
For example, this is what I get for my 2.2.16 kernel:
1589708 vmlinux
@@ -826,13 +812,14 @@ Extra options available for this executable format:
=head2 NOTES FOR WIN32/PE
The PE support in B<UPX> is quite stable now, but probably there are
still some incompabilities with some files.
still some incompatibilities with some files.
Because of the way B<UPX> (and other packers for this format) works, you
can see increased memory usage of your compressed files. If you start
several instances of huge compressed programs you're wasting memory
because the common segements of the program won't get shared
across the instances.
can see increased memory usage of your compressed files because the whole
program is loaded into memory at startup.
If you start several instances of huge compressed programs you're
wasting memory because the common segments of the program won't
get shared across the instances.
On the other hand if you're compressing only smaller programs, or
running only one instance of larger programs, then this penalty is
smaller, but it's still there.
@@ -840,12 +827,19 @@ smaller, but it's still there.
If you're running executables from network, then compressed programs
will load faster, and require less bandwidth during execution.
DLLs are supported.
DLLs are supported. But UPX compressed DLLs can not share common data and
code when they got used by multiple applications. So compressing msvcrt.dll
is a waste of memory, but compressing the dll plugins of a particular
application may be a better idea.
Screensavers are supported, with the restriction that the filename
must end in ".scr" (as screensavers are handled slightly different
must end with ".scr" (as screensavers are handled slightly different
than normal exe files).
UPX compressed PE files have some minor memory overhead (usually in the
10 - 30 KiB range) which can be seen by specifying the "-i" command
line switch during compression.
Extra options available for this executable format:
--compress-exports=0 Don't compress the export section.
@@ -862,16 +856,30 @@ Extra options available for this executable format:
--compress-icons=1 Compress all but the first icon.
--compress-icons=2 Compress all icons which are not in the
first icon directory. [DEFAULT]
--compress-icons=3 Compress all icons.
--compress-resources=0 Don't compress any resources at all.
--keep-resource=list Don't compress resources specified by the list.
The members of the list are separated by commas.
A list member has the following format: I<type[/name]>.
I<Type> is the type of the resource. Standard types
must be specified as decimal numbers, user types can be
specified by decimal IDs or strings. I<Name> is the
identifier of the resource. It can be a decimal number
or a string. For example:
--keep-resource=2/MYBITMAP,5,6/12345
UPX won't compress the named bitmap resource "MYBITMAP",
it leaves every dialog (5) resource uncompressed, and
it won't touch the string table resource with identifier
12345.
--force Force compression even when there is an
unexpected value in a header field.
Use with care.
--strip-loadconf=0 Don't strip Structured Exception Handling load config [DEFAULT].
--strip-loadconf=1 Strip Structured Exception Handling load config.
--strip-relocs=0 Don't strip relocation records.
--strip-relocs=1 Strip relocation records. [DEFAULT]
This option only works on executables with base
@@ -914,32 +922,30 @@ Please report all bugs immediately to the authors.
Markus F.X.J. Oberhumer <markus@oberhumer.com>
http://www.oberhumer.com
Laszlo Molnar <ml1050@users.sourceforge.net>
Laszlo Molnar <ezerotven+github@gmail.com>
John F. Reiser <jreiser@BitWagon.com>
Jens Medoch <jssg@users.sourceforge.net>
=head1 COPYRIGHT
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2025 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2004 Laszlo Molnar
Copyright (C) 1996-2025 Laszlo Molnar
Copyright (C) 2000-2004 John F. Reiser
Copyright (C) 2000-2025 John F. Reiser
Copyright (C) 2002-2004 Jens Medoch
This program may be used freely, and you are welcome to
redistribute it under certain conditions.
B<UPX> is distributed with full source code under the terms of the
GNU General Public License v2+; either under the pure GPLv2+ (see
the file COPYING), or (at your option) under the GPLv+2 with special
exceptions and restrictions granting the free usage for all binaries
including commercial programs (see the file LICENSE).
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
B<UPX License Agreement> for more details.
You should have received a copy of the UPX License Agreement along
with this program; see the file LICENSE. If not, visit the UPX home page.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the UPX License Agreements along
with this program; see the files COPYING and LICENSE. If not,
visit the UPX home page.
Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

@@ -0,0 +1,24 @@
# vim:set ft=yaml ts=2 sw=2 et:
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# for clang-tidy from https://clang.llvm.org/extra/clang-tidy/
---
Checks: >
-*,
bugprone-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-reserved-identifier,
-bugprone-switch-missing-default-case,
clang-analyzer-*,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-core.uninitialized.Assign,
-clang-analyzer-security.insecureAPI.strcpy,
clang-diagnostic-*,
performance-*,
FormatStyle: file
HeaderFilterRegex: '.*'
InheritParentConfig: false
...
@@ -0,0 +1,24 @@
# vim:set ft=yaml ts=2 sw=2 et:
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# for clang-tidy from https://clang.llvm.org/extra/clang-tidy/
---
Checks: >
-*,
bugprone-*,
-bugprone-assignment-in-if-condition,
-bugprone-casting-through-void,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-inc-dec-in-conditions,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
-bugprone-sizeof-expression,
-bugprone-suspicious-include,
clang-analyzer-*,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
clang-diagnostic-*,
performance-*,
FormatStyle: file
HeaderFilterRegex: '.*'
InheritParentConfig: false
...
@@ -0,0 +1,24 @@
# vim:set ft=yaml ts=2 sw=2 et:
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# for clang-tidy from https://clang.llvm.org/extra/clang-tidy/
---
Checks: >
-*,
bugprone-*,
-bugprone-assignment-in-if-condition,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-inc-dec-in-conditions,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-reserved-identifier,
-bugprone-switch-missing-default-case,
clang-analyzer-*,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
clang-diagnostic-*,
performance-*,
FormatStyle: file
HeaderFilterRegex: '.*'
InheritParentConfig: false
...
@@ -0,0 +1,28 @@
# vim:set ft=yaml ts=2 sw=2 et:
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# for clang-tidy from https://clang.llvm.org/extra/clang-tidy/
---
Checks: >
-*,
bugprone-*,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-casting-through-void,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-misplaced-widening-cast,
-bugprone-narrowing-conversions,
-bugprone-reserved-identifier,
-bugprone-switch-missing-default-case,
clang-analyzer-*,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
clang-diagnostic-*,
performance-*,
-performance-no-int-to-ptr,
FormatStyle: file
HeaderFilterRegex: '.*'
InheritParentConfig: false
...
+549
View File
@@ -0,0 +1,549 @@
#!/usr/bin/env python3
#
# ===- run-clang-tidy.py - Parallel clang-tidy runner --------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ===-----------------------------------------------------------------------===#
# FIXME: Integrate with clang-tidy-diff.py
"""
Parallel clang-tidy runner
==========================
Runs clang-tidy over all files in a compilation database. Requires clang-tidy
and clang-apply-replacements in $PATH.
Example invocations.
- Run clang-tidy on all files in the current working directory with a default
set of checks and show warnings in the cpp files and all project headers.
run-clang-tidy.py $PWD
- Fix all header guards.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard
- Fix all header guards included from clang-tidy and header guards
for clang-tidy headers.
run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy \
-header-filter=extra/clang-tidy
Compilation database setup:
http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
"""
from __future__ import print_function
import argparse
import glob
import json
import multiprocessing
import os
import queue
import re
import shutil
import subprocess
import sys
import tempfile
import threading
import traceback
try:
import yaml
except ImportError:
yaml = None
def strtobool(val):
"""Convert a string representation of truth to a bool following LLVM's CLI argument parsing."""
val = val.lower()
if val in ["", "true", "1"]:
return True
elif val in ["false", "0"]:
return False
# Return ArgumentTypeError so that argparse does not substitute its own error message
raise argparse.ArgumentTypeError(
"'{}' is invalid value for boolean argument! Try 0 or 1.".format(val)
)
def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
result = os.path.realpath("./")
while not os.path.isfile(os.path.join(result, path)):
parent = os.path.dirname(result)
if result == parent:
print("Error: could not find compilation database.")
sys.exit(1)
result = parent
return result
def make_absolute(f, directory):
if os.path.isabs(f):
return f
return os.path.normpath(os.path.join(directory, f))
def get_tidy_invocation(
f,
clang_tidy_binary,
checks,
tmpdir,
build_path,
header_filter,
allow_enabling_alpha_checkers,
extra_arg,
extra_arg_before,
quiet,
config_file_path,
config,
line_filter,
use_color,
plugins,
warnings_as_errors,
):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
if allow_enabling_alpha_checkers:
start.append("-allow-enabling-analyzer-alpha-checkers")
if header_filter is not None:
start.append("-header-filter=" + header_filter)
if line_filter is not None:
start.append("-line-filter=" + line_filter)
if use_color is not None:
if use_color:
start.append("--use-color")
else:
start.append("--use-color=false")
if checks:
start.append("-checks=" + checks)
if tmpdir is not None:
start.append("-export-fixes")
# Get a temporary file. We immediately close the handle so clang-tidy can
# overwrite it.
(handle, name) = tempfile.mkstemp(suffix=".yaml", dir=tmpdir)
os.close(handle)
start.append(name)
for arg in extra_arg:
start.append("-extra-arg=%s" % arg)
for arg in extra_arg_before:
start.append("-extra-arg-before=%s" % arg)
start.append("-p=" + build_path)
if quiet:
start.append("-quiet")
if config_file_path:
start.append("--config-file=" + config_file_path)
elif config:
start.append("-config=" + config)
for plugin in plugins:
start.append("-load=" + plugin)
if warnings_as_errors:
start.append("--warnings-as-errors=" + warnings_as_errors)
start.append(f)
return start
def merge_replacement_files(tmpdir, mergefile):
"""Merge all replacement files in a directory into a single file"""
# The fixes suggested by clang-tidy >= 4.0.0 are given under
# the top level key 'Diagnostics' in the output yaml files
mergekey = "Diagnostics"
merged = []
for replacefile in glob.iglob(os.path.join(tmpdir, "*.yaml")):
content = yaml.safe_load(open(replacefile, "r"))
if not content:
continue # Skip empty files.
merged.extend(content.get(mergekey, []))
if merged:
# MainSourceFile: The key is required by the definition inside
# include/clang/Tooling/ReplacementsYaml.h, but the value
# is actually never used inside clang-apply-replacements,
# so we set it to '' here.
output = {"MainSourceFile": "", mergekey: merged}
with open(mergefile, "w") as out:
yaml.safe_dump(output, out)
else:
# Empty the file:
open(mergefile, "w").close()
def find_binary(arg, name, build_path):
"""Get the path for a binary or exit"""
if arg:
if shutil.which(arg):
return arg
else:
raise SystemExit(
"error: passed binary '{}' was not found or is not executable".format(
arg
)
)
built_path = os.path.join(build_path, "bin", name)
binary = shutil.which(name) or shutil.which(built_path)
if binary:
return binary
else:
raise SystemExit(
"error: failed to find {} in $PATH or at {}".format(name, built_path)
)
def apply_fixes(args, clang_apply_replacements_binary, tmpdir):
"""Calls clang-apply-fixes on a given directory."""
invocation = [clang_apply_replacements_binary]
invocation.append("-ignore-insert-conflict")
if args.format:
invocation.append("-format")
if args.style:
invocation.append("-style=" + args.style)
invocation.append(tmpdir)
subprocess.call(invocation)
def run_tidy(args, clang_tidy_binary, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(
name,
clang_tidy_binary,
args.checks,
tmpdir,
build_path,
args.header_filter,
args.allow_enabling_alpha_checkers,
args.extra_arg,
args.extra_arg_before,
args.quiet,
args.config_file,
args.config,
args.line_filter,
args.use_color,
args.plugins,
args.warnings_as_errors,
)
proc = subprocess.Popen(
invocation, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
output, err = proc.communicate()
if proc.returncode != 0:
if proc.returncode < 0:
msg = "%s: terminated by signal %d\n" % (name, -proc.returncode)
err += msg.encode("utf-8")
failed_files.append(name)
with lock:
sys.stdout.write(" ".join(invocation) + "\n" + output.decode("utf-8"))
if len(err) > 0:
sys.stdout.flush()
sys.stderr.write(err.decode("utf-8"))
queue.task_done()
def main():
parser = argparse.ArgumentParser(
description="Runs clang-tidy over all files "
"in a compilation database. Requires "
"clang-tidy and clang-apply-replacements in "
"$PATH or in your build directory."
)
parser.add_argument(
"-allow-enabling-alpha-checkers",
action="store_true",
help="allow alpha checkers from clang-analyzer.",
)
parser.add_argument(
"-clang-tidy-binary", metavar="PATH", help="path to clang-tidy binary"
)
parser.add_argument(
"-clang-apply-replacements-binary",
metavar="PATH",
help="path to clang-apply-replacements binary",
)
parser.add_argument(
"-checks",
default=None,
help="checks filter, when not specified, use clang-tidy default",
)
config_group = parser.add_mutually_exclusive_group()
config_group.add_argument(
"-config",
default=None,
help="Specifies a configuration in YAML/JSON format: "
" -config=\"{Checks: '*', "
' CheckOptions: {x: y}}" '
"When the value is empty, clang-tidy will "
"attempt to find a file named .clang-tidy for "
"each source file in its parent directories.",
)
config_group.add_argument(
"-config-file",
default=None,
help="Specify the path of .clang-tidy or custom config "
"file: e.g. -config-file=/some/path/myTidyConfigFile. "
"This option internally works exactly the same way as "
"-config option after reading specified config file. "
"Use either -config-file or -config, not both.",
)
parser.add_argument(
"-header-filter",
default=None,
help="regular expression matching the names of the "
"headers to output diagnostics from. Diagnostics from "
"the main file of each translation unit are always "
"displayed.",
)
parser.add_argument(
"-line-filter",
default=None,
help="List of files with line ranges to filter the warnings.",
)
if yaml:
parser.add_argument(
"-export-fixes",
metavar="file_or_directory",
dest="export_fixes",
help="A directory or a yaml file to store suggested fixes in, "
"which can be applied with clang-apply-replacements. If the "
"parameter is a directory, the fixes of each compilation unit are "
"stored in individual yaml files in the directory.",
)
else:
parser.add_argument(
"-export-fixes",
metavar="directory",
dest="export_fixes",
help="A directory to store suggested fixes in, which can be applied "
"with clang-apply-replacements. The fixes of each compilation unit are "
"stored in individual yaml files in the directory.",
)
parser.add_argument(
"-j",
type=int,
default=0,
help="number of tidy instances to be run in parallel.",
)
parser.add_argument(
"files", nargs="*", default=[".*"], help="files to be processed (regex on path)"
)
parser.add_argument("-fix", action="store_true", help="apply fix-its")
parser.add_argument(
"-format", action="store_true", help="Reformat code after applying fixes"
)
parser.add_argument(
"-style",
default="file",
help="The style of reformat code after applying fixes",
)
parser.add_argument(
"-use-color",
type=strtobool,
nargs="?",
const=True,
help="Use colors in diagnostics, overriding clang-tidy's"
" default behavior. This option overrides the 'UseColor"
"' option in .clang-tidy file, if any.",
)
parser.add_argument(
"-p", dest="build_path", help="Path used to read a compile command database."
)
parser.add_argument(
"-extra-arg",
dest="extra_arg",
action="append",
default=[],
help="Additional argument to append to the compiler command line.",
)
parser.add_argument(
"-extra-arg-before",
dest="extra_arg_before",
action="append",
default=[],
help="Additional argument to prepend to the compiler command line.",
)
parser.add_argument(
"-quiet", action="store_true", help="Run clang-tidy in quiet mode"
)
parser.add_argument(
"-load",
dest="plugins",
action="append",
default=[],
help="Load the specified plugin in clang-tidy.",
)
parser.add_argument(
"-warnings-as-errors",
default=None,
help="Upgrades warnings to errors. Same format as '-checks'",
)
args = parser.parse_args()
db_path = "compile_commands.json"
if args.build_path is not None:
build_path = args.build_path
else:
# Find our database
build_path = find_compilation_database(db_path)
clang_tidy_binary = find_binary(args.clang_tidy_binary, "clang-tidy", build_path)
if args.fix:
clang_apply_replacements_binary = find_binary(
args.clang_apply_replacements_binary, "clang-apply-replacements", build_path
)
combine_fixes = False
export_fixes_dir = None
delete_fixes_dir = False
if args.export_fixes is not None:
# if a directory is given, create it if it does not exist
if args.export_fixes.endswith(os.path.sep) and not os.path.isdir(
args.export_fixes
):
os.makedirs(args.export_fixes)
if not os.path.isdir(args.export_fixes):
if not yaml:
raise RuntimeError(
"Cannot combine fixes in one yaml file. Either install PyYAML or specify an output directory."
)
combine_fixes = True
if os.path.isdir(args.export_fixes):
export_fixes_dir = args.export_fixes
if export_fixes_dir is None and (args.fix or combine_fixes):
export_fixes_dir = tempfile.mkdtemp()
delete_fixes_dir = True
# Load the database and extract all files.
database = json.load(open(os.path.join(build_path, db_path)))
files = set(
[make_absolute(entry["file"], entry["directory"]) for entry in database]
)
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile("|".join(args.files))
# filter files with mo.group(0), and sort files
matched_files = []
for name in files:
mo = file_name_re.search(name)
if mo and mo.group(0):
matched_files.append(name)
files = sorted(matched_files)
if not files:
if delete_fixes_dir:
shutil.rmtree(export_fixes_dir)
sys.exit(0)
try:
invocation = get_tidy_invocation(
"",
clang_tidy_binary,
args.checks,
None,
build_path,
args.header_filter,
args.allow_enabling_alpha_checkers,
args.extra_arg,
args.extra_arg_before,
args.quiet,
args.config_file,
args.config,
args.line_filter,
args.use_color,
args.plugins,
args.warnings_as_errors,
)
invocation.append("-list-checks")
invocation.append("-")
if args.quiet:
# Even with -quiet we still want to check if we can call clang-tidy.
with open(os.devnull, "w") as dev_null:
subprocess.check_call(invocation, stdout=dev_null)
else:
subprocess.check_call(invocation)
except:
print("Unable to run clang-tidy.", file=sys.stderr)
sys.exit(1)
max_task = args.j
if max_task == 0:
max_task = multiprocessing.cpu_count()
return_code = 0
try:
# Spin up a bunch of tidy-launching threads.
task_queue = queue.Queue(max_task)
# List of files with a non-zero return code.
failed_files = []
lock = threading.Lock()
for _ in range(max_task):
t = threading.Thread(
target=run_tidy,
args=(
args,
clang_tidy_binary,
export_fixes_dir,
build_path,
task_queue,
lock,
failed_files,
),
)
t.daemon = True
t.start()
# Fill the queue with files.
for name in files:
if file_name_re.search(name):
task_queue.put(name)
# Wait for all threads to be done.
task_queue.join()
if len(failed_files):
return_code = 1
except KeyboardInterrupt:
# This is a sad hack. Unfortunately subprocess goes
# bonkers with ctrl-c and we start forking merrily.
print("\nCtrl-C detected, goodbye.")
if delete_fixes_dir:
shutil.rmtree(export_fixes_dir)
os.kill(0, 9)
if combine_fixes:
print("Writing fixes to " + args.export_fixes + " ...")
try:
merge_replacement_files(export_fixes_dir, args.export_fixes)
except:
print("Error exporting fixes.\n", file=sys.stderr)
traceback.print_exc()
return_code = 1
if args.fix:
print("Applying fixes ...")
try:
apply_fixes(args, clang_apply_replacements_binary, export_fixes_dir)
except:
print("Error applying fixes.\n", file=sys.stderr)
traceback.print_exc()
return_code = 1
if delete_fixes_dir:
shutil.rmtree(export_fixes_dir)
sys.exit(return_code)
if __name__ == "__main__":
main()
+455
View File
@@ -0,0 +1,455 @@
#
# UPX "CMake" build file; see https://cmake.org/
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# set USE_STRICT_DEFAULTS
if(NOT DEFINED USE_STRICT_DEFAULTS AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
include("${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/use_strict_defaults.cmake" OPTIONAL)
endif()
if(NOT DEFINED USE_STRICT_DEFAULTS)
# use permissive config defaults when building from source code tarball
set(USE_STRICT_DEFAULTS FALSE CACHE INTERNAL "" FORCE)
endif()
#***********************************************************************
# macros
#***********************************************************************
# support config hooks; developer convenience
macro(upx_cmake_include_hook section)
include("${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/hooks/CMakeLists.${section}.txt" OPTIONAL)
include("${CMAKE_CURRENT_SOURCE_DIR}/maint/make/CMakeLists.${section}.txt" OPTIONAL)
endmacro()
# Disallow in-source build. Note that you will still have to manually
# clean up a few files if you accidentally try an in-source build.
macro(upx_disallow_in_source_build)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
if(",${CMAKE_CURRENT_SOURCE_DIR}," STREQUAL ",${CMAKE_CURRENT_BINARY_DIR},")
# try to clean up (does not work)
#file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/CMakeCache.txt")
#file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cmake.check_cache")
message(FATAL_ERROR "ERROR: In-source builds are not allowed, please use an extra build dir.")
endif()
endmacro()
# ternary conditional operator
macro(upx_ternary result_var_name condition true_value false_value)
if(${condition})
set(${result_var_name} "${true_value}")
else()
set(${result_var_name} "${false_value}")
endif()
endmacro()
# set the default build type; must be called BEFORE project() cmake init
macro(upx_set_default_build_type type)
set(upx_global_default_build_type "${type}")
get_property(upx_global_is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT upx_global_is_multi_config AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "${upx_global_default_build_type}" CACHE STRING "Choose the type of build." FORCE)
endif()
# also enable some global settings by default
if(NOT DEFINED CMAKE_C_STANDARD_REQUIRED)
set(CMAKE_C_STANDARD_REQUIRED ON)
endif()
if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
endmacro()
# set the default multi-config build type; must be called AFTER project() cmake init
macro(upx_apply_build_type)
if(upx_global_is_multi_config)
set(c "${CMAKE_CONFIGURATION_TYPES}")
list(INSERT c 0 "${upx_global_default_build_type}")
if(CMAKE_BUILD_TYPE)
list(INSERT c 0 "${CMAKE_BUILD_TYPE}")
endif()
list(REMOVE_DUPLICATES c)
set(CMAKE_CONFIGURATION_TYPES "${c}" CACHE STRING "List of supported configuration types." FORCE)
endif()
# now also set the build type for use in try_compile()
if(NOT CMAKE_TRY_COMPILE_CONFIGURATION)
if(CMAKE_BUILD_TYPE)
set(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}")
else()
set(CMAKE_TRY_COMPILE_CONFIGURATION "${upx_global_default_build_type}")
endif()
endif()
endmacro()
# set MINGW, MSVC_FRONTEND, GNU_FRONTEND and MSVC_SIMULATE
macro(upx_set_global_vars)
if(NOT DEFINED MINGW AND CMAKE_C_PLATFORM_ID MATCHES "^MinGW")
set(MINGW 1)
endif()
if(NOT DEFINED MSVC_FRONTEND AND (MSVC OR CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "^MSVC"))
set(MSVC_FRONTEND 1)
elseif(NOT DEFINED GNU_FRONTEND AND (CMAKE_C_COMPILER_FRONTEND_VARIANT MATCHES "^GNU" OR CMAKE_C_COMPILER_ID MATCHES "(Clang|GNU|LLVM)"))
set(GNU_FRONTEND 1)
endif()
if(NOT DEFINED MSVC_SIMULATE AND (CMAKE_C_SIMULATE_ID MATCHES "^MSVC"))
set(MSVC_SIMULATE 1)
endif()
endmacro()
# useful for CI jobs: check for working BUILD_RPATH
macro(upx_check_working_build_rpath var_name)
if(WIN32 OR MINGW OR CYGWIN)
# always works; DLLs reside next to the executables
set(${var_name} ON)
upx_cache_bool_vars(ON ${var_name})
elseif(CMAKE_BUILD_WITH_INSTALL_RPATH OR CMAKE_SKIP_RPATH OR CMAKE_SKIP_BUILD_RPATH)
# cannot work; BUILD_RPATH is disabled by global CMake settings
set(${var_name} OFF)
upx_cache_bool_vars(OFF ${var_name})
else()
# we do not know if/how the BUILD_RPATH is set; be cautious by default
upx_cache_bool_vars(OFF ${var_name})
endif()
endmacro()
#***********************************************************************
# util
#***********************************************************************
# convert to CMake bool
function(upx_make_bool_var result_var_name var_name default_value)
set(result "${default_value}")
# only query $var_name if it is defined and not empty
if(NOT ",${var_name}," STREQUAL ",,")
if(DEFINED ${var_name})
if(NOT ",${${var_name}}," STREQUAL ",,")
set(result "${${var_name}}")
endif()
endif()
endif()
if(${result})
set(result ON)
else()
set(result OFF)
endif()
set(${result_var_name} "${result}" PARENT_SCOPE) # return value
endfunction()
function(upx_maybe_unused_var) # ARGV
foreach(var_name ${ARGV})
if(DEFINED ${var_name})
set(dummy "${${var_name}}")
endif()
endforeach()
endfunction()
function(upx_print_var) # ARGV
foreach(var_name ${ARGV})
if(DEFINED ${var_name})
if(NOT ",${${var_name}}," STREQUAL ",,")
if(${var_name})
message(STATUS "${var_name} = ${${var_name}}")
endif()
endif()
endif()
endforeach()
endfunction()
function(upx_print_env_var) # ARGV
foreach(var_name ${ARGV})
if(DEFINED ENV{${var_name}})
if(NOT ",$ENV{${var_name}}," STREQUAL ",,")
message(STATUS "ENV{${var_name}} = '$ENV{${var_name}}'")
endif()
endif()
endforeach()
endfunction()
function(upx_print_have_symbol) # ARGV; needs include(CheckSymbolExists)
set(rq "${CMAKE_REQUIRED_QUIET}")
set(CMAKE_REQUIRED_QUIET ON)
foreach(symbol ${ARGV})
set(cache_var_name "HAVE_symbol_${symbol}")
check_symbol_exists("${symbol}" "limits.h;stddef.h;stdint.h" "${cache_var_name}")
if(${cache_var_name})
message(STATUS "HAVE_symbol ${symbol}")
endif()
endforeach()
set(CMAKE_REQUIRED_QUIET "${rq}")
endfunction()
# examine compiler configuration
function(upx_print_common_symbols)
upx_print_have_symbol(__FAST_MATH__)
upx_print_have_symbol(__PIC__ __pic__ __PIE__ __pie__)
endfunction()
# examine MinGW/Cygwin compiler configuration
function(upx_print_mingw_symbols)
if(WIN32 OR MINGW OR CYGWIN)
if(CMAKE_C_COMPILER_ID MATCHES "(Clang|GNU)")
# runtime library: msvcrt vs ucrt vs cygwin
upx_print_have_symbol(__CRTDLL__ __CYGWIN__ __CYGWIN32__ __CYGWIN64__ __MINGW32__ __MINGW64__ __MINGW64_VERSION_MAJOR __MSVCRT__ __MSVCRT_VERSION__ _UCRT _WIN32 _WIN32_WINNT _WIN64)
# exception handing: SJLJ (setjmp/longjmp) vs DWARF vs SEH
upx_print_have_symbol(__GCC_HAVE_DWARF2_CFI_ASM __SEH__ __USING_SJLJ_EXCEPTIONS__)
# threads: win32 vs posix/pthread/winpthreads vs mcfgthread
upx_print_have_symbol(_REENTRANT __USING_MCFGTHREAD__)
endif()
endif()
endfunction()
# add wildcard expansions to a variable
function(upx_add_glob_files) # ARGV
set(var_name ${ARGV0})
list(REMOVE_AT ARGV 0)
if(${CMAKE_VERSION} VERSION_LESS "3.3")
file(GLOB files ${ARGV})
else()
file(GLOB files LIST_DIRECTORIES false ${ARGV})
endif()
set(result "")
if(DEFINED ${var_name})
set(result "${${var_name}}")
endif()
list(APPEND result "${files}")
list(SORT result)
list(REMOVE_DUPLICATES result)
#message(STATUS "upx_add_glob_files: ${var_name} = ${result}")
set(${var_name} "${result}" PARENT_SCOPE) # return value
endfunction()
# remove wildcard expansions from a variable
function(upx_remove_glob_files) # ARGV
set(var_name ${ARGV0})
list(REMOVE_AT ARGV 0)
file(GLOB files ${ARGV})
set(result "")
if(DEFINED ${var_name})
set(result "${${var_name}}")
foreach(file ${files})
list(REMOVE_ITEM result "${file}")
endforeach()
list(SORT result)
list(REMOVE_DUPLICATES result)
endif()
#message(STATUS "upx_remove_glob_files: ${var_name} = ${result}")
set(${var_name} "${result}" PARENT_SCOPE) # return value
endfunction()
# useful for CI jobs: allow settings via environment and cache result
function(upx_cache_bool_vars) # ARGV
set(default_value "${ARGV0}")
list(REMOVE_AT ARGV 0)
foreach(var_name ${ARGV})
set(value ${default_value})
if(DEFINED UPX_CACHE_VALUE_${var_name}) # check cache
set(value "${UPX_CACHE_VALUE_${var_name}}")
elseif(DEFINED ${var_name}) # defined via "cmake -DXXX=YYY"
set(value "${${var_name}}")
elseif(DEFINED ENV{${var_name}}) # check environment
if("$ENV{${var_name}}" MATCHES "^(0|1|OFF|ON|FALSE|TRUE|off|on|false|true)$")
set(value "$ENV{${var_name}}")
set(UPX_CACHE_ORIGIN_FROM_ENV_${var_name} TRUE CACHE INTERNAL "" FORCE) # for status message below
endif()
endif()
# convert to bool
if(value)
set(value ON)
else()
set(value OFF)
endif()
# store result
if(UPX_CACHE_ORIGIN_FROM_ENV_${var_name})
message(STATUS "setting from environment: ${var_name} = ${value}")
endif()
set(${var_name} "${value}" PARENT_SCOPE) # store result
set(UPX_CACHE_VALUE_${var_name} "${value}" CACHE INTERNAL "" FORCE) # and store in cache
endforeach()
endfunction()
function(upx_platform_check_mismatch var_name_1 var_name_2)
if(DEFINED ${var_name_1} OR DEFINED ${var_name_2})
if(NOT ",${${var_name_1}}," STREQUAL ",${${var_name_2}},")
if(UPX_CONFIG_DISABLE_WERROR)
message(WARNING "WARNING: '${var_name_1}' '${var_name_2}' mismatch")
else()
message(FATAL_ERROR "FATAL ERROR: '${var_name_1}' '${var_name_2}' mismatch")
endif()
endif()
endif()
endfunction()
# check for incompatible C vs CXX settings
function(upx_platform_check_c_cxx_mismatch)
upx_platform_check_mismatch(CMAKE_C_PLATFORM_ID CMAKE_CXX_PLATFORM_ID)
upx_platform_check_mismatch(CMAKE_C_SIMULATE_ID CMAKE_CXX_SIMULATE_ID)
upx_platform_check_mismatch(CMAKE_C_COMPILER_ABI CMAKE_CXX_COMPILER_ABI)
upx_platform_check_mismatch(CMAKE_C_COMPILER_FRONTEND_VARIANT CMAKE_CXX_COMPILER_FRONTEND_VARIANT)
endfunction()
#***********************************************************************
# compilation flags
#***********************************************************************
function(upx_internal_add_definitions_with_prefix) # ARGV; needs include(CheckCCompilerFlag)
set(flag_prefix "${ARGV0}")
if("${flag_prefix}" MATCHES "^empty$") # need "empty" to work around bug in old CMake versions
set(flag_prefix "")
endif()
list(REMOVE_AT ARGV 0)
set(failed "")
foreach(f ${ARGV})
set(flag "${flag_prefix}${f}")
string(REGEX REPLACE "[^0-9a-zA-Z_]" "_" cache_var_name "HAVE_CFLAG_${flag}")
check_c_compiler_flag("${flag}" ${cache_var_name})
if(${cache_var_name})
#message(STATUS "add_definitions: ${flag}")
add_definitions("${flag}")
else()
list(APPEND failed "${f}")
endif()
endforeach()
set(failed_flags "${failed}" PARENT_SCOPE) # return value
endfunction()
function(upx_add_definitions) # ARGV; needs include(CheckCCompilerFlag)
set(failed_flags "")
if(MSVC_FRONTEND AND CMAKE_C_COMPILER_ID MATCHES "Clang")
# for clang-cl try "-clang:" flag prefix first
upx_internal_add_definitions_with_prefix("-clang:" ${ARGV})
upx_internal_add_definitions_with_prefix("empty" ${failed_flags})
else()
upx_internal_add_definitions_with_prefix("empty" ${ARGV})
endif()
endfunction()
# useful for CI jobs: allow target extra compile options
function(upx_add_target_extra_compile_options) # ARGV
set(t "${ARGV0}")
list(REMOVE_AT ARGV 0)
foreach(var_name ${ARGV})
if(NOT DEFINED ${var_name})
elseif(",${${var_name}}," STREQUAL ",,")
else()
set(flags "${${var_name}}")
if(NOT flags MATCHES ";") # NOTE: split into list from string only if not already a list
if(${CMAKE_VERSION} VERSION_GREATER "3.8.99")
separate_arguments(flags NATIVE_COMMAND "${flags}")
else()
separate_arguments(flags)
endif()
endif()
target_compile_options(${t} PRIVATE "${flags}")
endif()
endforeach()
endfunction()
# compile a target with -O2 optimization even in Debug build
function(upx_compile_target_debug_with_O2) # ARGV
foreach(t ${ARGV})
if(MSVC_FRONTEND)
# MSVC uses some Debug compilation options like -RTC1 that are incompatible with -O2
else()
target_compile_options(${t} PRIVATE $<$<CONFIG:Debug>:-O2>)
endif()
endforeach()
endfunction()
# compile a source file with -O2 optimization even in Debug build; messy because of CMake limitations
function(upx_compile_source_debug_with_O2) # ARGV
set(flags "$<$<CONFIG:Debug>:-O2>")
if(${CMAKE_VERSION} VERSION_LESS "3.8")
# 3.8: The COMPILE_FLAGS source file property learned to support generator expressions
if(upx_global_is_multi_config OR NOT CMAKE_BUILD_TYPE MATCHES "^Debug$")
return()
endif()
set(flags "-O2")
endif()
if(CMAKE_GENERATOR MATCHES "Xcode") # multi-config
# NOTE: Xcode does not support per-config per-source COMPILE_FLAGS (as of CMake 3.27.7)
return()
endif()
foreach(source ${ARGV})
if(MSVC_FRONTEND)
# MSVC uses some Debug compilation options like -RTC1 that are incompatible with -O2
else()
get_source_file_property(prop "${source}" COMPILE_FLAGS)
if("${prop}" MATCHES "^(NOTFOUND)?$")
set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${flags}")
else()
set_source_files_properties("${source}" PROPERTIES COMPILE_FLAGS "${prop} ${flags}")
endif()
endif()
endforeach()
endfunction()
# sanitize a target; note that this may require special run-time support libs from your toolchain
function(upx_sanitize_target) # ARGV
if(NOT DEFINED UPX_CONFIG_SANITIZE_FLAGS_DEBUG)
# default sanitizer for Debug builds
set(UPX_CONFIG_SANITIZE_FLAGS_DEBUG -fsanitize=undefined -fsanitize-undefined-trap-on-error -fstack-protector-all)
endif()
if(NOT DEFINED UPX_CONFIG_SANITIZE_FLAGS_RELEASE)
# default sanitizer for Release builds
set(UPX_CONFIG_SANITIZE_FLAGS_RELEASE -fstack-protector)
endif()
foreach(t ${ARGV})
if(UPX_CONFIG_DISABLE_SANITIZE)
# no-op
elseif(MSVC_FRONTEND)
# MSVC uses -GS (similar to -fstack-protector) by default
elseif(NOT GNU_FRONTEND)
# unknown compiler
elseif(MINGW OR CYGWIN)
# avoid link errors with current MinGW-w64 versions
# see https://www.mingw-w64.org/contribute/#sanitizers-asan-tsan-usan
elseif(CMAKE_C_COMPILER_ID MATCHES "^Clang$" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "9.0")
# unreliable/broken sanitize implementation before clang-9 (Sep 2019)
message(WARNING "WARNING: ignoring SANITIZE for target '${t}'")
elseif(CMAKE_C_COMPILER_ID MATCHES "^GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "8.0")
# unsupported compiler; unreliable/broken sanitize implementation before gcc-8 (May 2018)
message(WARNING "WARNING: ignoring SANITIZE for target '${t}'")
else()
target_compile_options(${t} PRIVATE $<$<CONFIG:Debug>:${UPX_CONFIG_SANITIZE_FLAGS_DEBUG}>)
target_compile_options(${t} PRIVATE $<$<CONFIG:MinSizeRel>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
target_compile_options(${t} PRIVATE $<$<CONFIG:Release>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
target_compile_options(${t} PRIVATE $<$<CONFIG:RelWithDebInfo>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
get_target_property(target_type ${t} TYPE)
if(NOT ",${target_type}," STREQUAL ",STATIC_LIBRARY,")
if(${CMAKE_VERSION} VERSION_GREATER "3.12.99")
target_link_options(${t} PRIVATE $<$<CONFIG:Debug>:${UPX_CONFIG_SANITIZE_FLAGS_DEBUG}>)
target_link_options(${t} PRIVATE $<$<CONFIG:MinSizeRel>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
target_link_options(${t} PRIVATE $<$<CONFIG:Release>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
target_link_options(${t} PRIVATE $<$<CONFIG:RelWithDebInfo>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
endif() # CMAKE_VERSION
endif() # target_type
endif()
endforeach()
endfunction()
#***********************************************************************
# test
#***********************************************************************
function(upx_add_test) # ARGV
set(name "${ARGV0}")
list(REMOVE_AT ARGV 0)
set(wd "${CMAKE_CURRENT_BINARY_DIR}/XTesting/$<CONFIG>")
add_test(NAME "${name}" WORKING_DIRECTORY "${wd}" COMMAND ${ARGV})
endfunction()
function(upx_test_depends) # ARGV
set(name "${ARGV0}")
list(REMOVE_AT ARGV 0)
get_property(prop TEST "${name}" PROPERTY DEPENDS)
if("${prop}" MATCHES "^(NOTFOUND)?$")
set_tests_properties("${name}" PROPERTIES DEPENDS "${ARGV}")
else()
set_tests_properties("${name}" PROPERTIES DEPENDS "${prop};${ARGV}")
endif()
endfunction()
# vim:set ft=cmake ts=4 sw=4 tw=0 et:
+62
View File
@@ -0,0 +1,62 @@
#
# UPX "CMake" build file; see https://cmake.org/
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
#***********************************************************************
# summary section
# print some info about the build configuration
#***********************************************************************
function(upx_print_info)
get_property(PROPERTY_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
get_property(PROPERTY_TARGET_SUPPORTS_SHARED_LIBS GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
# generator
upx_print_var(CMAKE_GENERATOR_TOOLSET CMAKE_GENERATOR_PLATFORM)
upx_print_var(PROPERTY_GENERATOR_IS_MULTI_CONFIG)
# directories
if(NOT ",${CMAKE_BINARY_DIR}," STREQUAL ",${CMAKE_CURRENT_BINARY_DIR}," OR NOT ",${CMAKE_SOURCE_DIR}," STREQUAL ",${CMAKE_CURRENT_SOURCE_DIR},")
upx_print_var(CMAKE_BINARY_DIR CMAKE_SOURCE_DIR CMAKE_CURRENT_BINARY_DIR CMAKE_CURRENT_SOURCE_DIR)
endif()
# system
upx_print_var(CMAKE_HOST_SYSTEM_NAME CMAKE_HOST_SYSTEM_VERSION CMAKE_HOST_SYSTEM_PROCESSOR)
upx_print_var(CMAKE_SYSTEM_NAME CMAKE_SYSTEM_VERSION CMAKE_SYSTEM_PROCESSOR)
upx_print_var(CMAKE_ANDROID_NDK CMAKE_ANDROID_NDK_VERSION CMAKE_ANDROID_STANDALONE_TOOLCHAIN)
upx_print_var(CMAKE_APPLE_SILICON_PROCESSOR CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_SYSROOT)
upx_print_var(CMAKE_VS_PLATFORM_TOOLSET CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE CMAKE_VS_PLATFORM_TOOLSET_VERSION)
upx_print_var(CMAKE_CROSSCOMPILING CMAKE_CROSSCOMPILING_EMULATOR)
upx_print_var(CMAKE_SIZEOF_VOID_P)
# binutils
upx_print_var(CMAKE_EXECUTABLE_FORMAT CMAKE_EXECUTABLE_SUFFIX UPX_CONFIG_CMAKE_EXECUTABLE_SUFFIX)
upx_print_var(CMAKE_AR CMAKE_RANLIB)
# compilers
foreach(lang IN ITEMS ASM C CXX)
upx_print_var(CMAKE_${lang}_COMPILER_LAUNCHER)
upx_print_var(CMAKE_${lang}_COMPILER)
upx_print_var(CMAKE_${lang}_COMPILER_ARG1)
upx_print_var(CMAKE_${lang}_COMPILER_ID)
upx_print_var(CMAKE_${lang}_SIMULATE_ID)
upx_print_var(CMAKE_${lang}_COMPILER_VERSION)
upx_print_var(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT)
upx_print_var(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID)
upx_print_var(CMAKE_${lang}_PLATFORM_ID)
upx_print_var(CMAKE_${lang}_COMPILER_ABI)
upx_print_var(CMAKE_${lang}_COMPILER_TARGET)
endforeach()
# misc
upx_print_var(CMAKE_BUILD_WITH_INSTALL_RPATH CMAKE_SKIP_RPATH CMAKE_SKIP_BUILD_RPATH CMAKE_SKIP_INSTALL_RPATH)
upx_print_var(CMAKE_INTERPROCEDURAL_OPTIMIZATION CMAKE_POSITION_INDEPENDENT_CODE)
upx_print_var(PROPERTY_TARGET_SUPPORTS_SHARED_LIBS)
upx_print_var(UPX_CONFIG_SANITIZE_FLAGS_DEBUG UPX_CONFIG_SANITIZE_FLAGS_RELEASE)
# shortcuts
upx_print_var(AIX APPLE CLANG CYGWIN GNU_FRONTEND GNUC MINGW MSVC MSVC_FRONTEND MSVC_IDE MSVC_SIMULATE MSVC_TOOLSET_VERSION MSVC_VERSION MSYS UNIX WIN32 WIN64)
endfunction()
# vim:set ft=cmake ts=4 sw=4 tw=0 et:
+157
View File
@@ -0,0 +1,157 @@
#
# UPX "CMake" build file; see https://cmake.org/
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
#***********************************************************************
# test section: self-pack tests
#
# IMPORTANT NOTE: these tests can only work if the host executable format
# is supported by UPX!
#***********************************************************************
function(upx_self_pack_test)
set(emu "")
if(DEFINED CMAKE_CROSSCOMPILING_EMULATOR)
set(emu "${CMAKE_CROSSCOMPILING_EMULATOR}")
endif()
set(exe "${CMAKE_EXECUTABLE_SUFFIX}")
set(upx_self_exe "$<TARGET_FILE:upx>")
set(fo "--force-overwrite")
#
# basic tests
#
upx_add_test(upx-self-pack upx -3 "${upx_self_exe}" ${fo} -o upx-packed${exe})
upx_add_test(upx-self-pack-fa upx -3 --all-filters "${upx_self_exe}" ${fo} -o upx-packed-fa${exe})
upx_add_test(upx-self-pack-fn upx -3 --no-filter "${upx_self_exe}" ${fo} -o upx-packed-fn${exe})
upx_add_test(upx-self-pack-fr upx -3 --all-filters --debug-use-random-filter "${upx_self_exe}" ${fo} -o upx-packed-fr${exe})
upx_add_test(upx-self-pack-nrv2b upx -3 --nrv2b "${upx_self_exe}" ${fo} -o upx-packed-nrv2b${exe})
upx_add_test(upx-self-pack-nrv2d upx -3 --nrv2d "${upx_self_exe}" ${fo} -o upx-packed-nrv2d${exe})
upx_add_test(upx-self-pack-nrv2e upx -3 --nrv2e "${upx_self_exe}" ${fo} -o upx-packed-nrv2e${exe})
upx_add_test(upx-self-pack-lzma upx -1 --lzma "${upx_self_exe}" ${fo} -o upx-packed-lzma${exe})
upx_add_test(upx-list upx -l upx-packed${exe} upx-packed-fa${exe} upx-packed-fn${exe} upx-packed-fr${exe} upx-packed-nrv2b${exe} upx-packed-nrv2d${exe} upx-packed-nrv2e${exe} upx-packed-lzma${exe})
upx_add_test(upx-fileinfo upx --fileinfo upx-packed${exe} upx-packed-fa${exe} upx-packed-fn${exe} upx-packed-fr${exe} upx-packed-nrv2b${exe} upx-packed-nrv2d${exe} upx-packed-nrv2e${exe} upx-packed-lzma${exe})
upx_add_test(upx-test upx -t upx-packed${exe} upx-packed-fa${exe} upx-packed-fn${exe} upx-packed-fr${exe} upx-packed-nrv2b${exe} upx-packed-nrv2d${exe} upx-packed-nrv2e${exe} upx-packed-lzma${exe})
upx_add_test(upx-unpack upx -d upx-packed${exe} ${fo} -o upx-unpacked${exe})
upx_add_test(upx-unpack-fa upx -d upx-packed-fa${exe} ${fo} -o upx-unpacked-fa${exe})
upx_add_test(upx-unpack-fn upx -d upx-packed-fn${exe} ${fo} -o upx-unpacked-fn${exe})
upx_add_test(upx-unpack-fr upx -d upx-packed-fr${exe} ${fo} -o upx-unpacked-fr${exe})
upx_add_test(upx-unpack-nrv2b upx -d upx-packed-nrv2b${exe} ${fo} -o upx-unpacked-nrv2b${exe})
upx_add_test(upx-unpack-nrv2d upx -d upx-packed-nrv2d${exe} ${fo} -o upx-unpacked-nrv2d${exe})
upx_add_test(upx-unpack-nrv2e upx -d upx-packed-nrv2e${exe} ${fo} -o upx-unpacked-nrv2e${exe})
upx_add_test(upx-unpack-lzma upx -d upx-packed-lzma${exe} ${fo} -o upx-unpacked-lzma${exe})
# all unpacked files must be identical
upx_add_test(upx-compare-fa "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-fa${exe})
upx_add_test(upx-compare-fn "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-fn${exe})
upx_add_test(upx-compare-fr "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-fr${exe})
upx_add_test(upx-compare-nrv2b "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-nrv2b${exe})
upx_add_test(upx-compare-nrv2d "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-nrv2d${exe})
upx_add_test(upx-compare-nrv2e "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-nrv2e${exe})
upx_add_test(upx-compare-lzma "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-lzma${exe})
# test dependencies
upx_test_depends(upx-list "upx-self-pack;upx-self-pack-fa;upx-self-pack-fn;upx-self-pack-fr;upx-self-pack-nrv2b;upx-self-pack-nrv2d;upx-self-pack-nrv2e;upx-self-pack-lzma")
upx_test_depends(upx-fileinfo "upx-self-pack;upx-self-pack-fa;upx-self-pack-fn;upx-self-pack-fr;upx-self-pack-nrv2b;upx-self-pack-nrv2d;upx-self-pack-nrv2e;upx-self-pack-lzma")
upx_test_depends(upx-test "upx-self-pack;upx-self-pack-fa;upx-self-pack-fn;upx-self-pack-fr;upx-self-pack-nrv2b;upx-self-pack-nrv2d;upx-self-pack-nrv2e;upx-self-pack-lzma")
upx_test_depends(upx-unpack upx-self-pack)
upx_test_depends(upx-unpack-fa upx-self-pack-fa)
upx_test_depends(upx-unpack-fn upx-self-pack-fn)
upx_test_depends(upx-unpack-fr upx-self-pack-fr)
upx_test_depends(upx-unpack-nrv2b upx-self-pack-nrv2b)
upx_test_depends(upx-unpack-nrv2d upx-self-pack-nrv2d)
upx_test_depends(upx-unpack-nrv2e upx-self-pack-nrv2e)
upx_test_depends(upx-unpack-lzma upx-self-pack-lzma)
upx_test_depends(upx-compare-fa "upx-unpack;upx-unpack-fa")
upx_test_depends(upx-compare-fn "upx-unpack;upx-unpack-fn")
upx_test_depends(upx-compare-fr "upx-unpack;upx-unpack-fr")
upx_test_depends(upx-compare-nrv2b "upx-unpack;upx-unpack-nrv2b")
upx_test_depends(upx-compare-nrv2d "upx-unpack;upx-unpack-nrv2d")
upx_test_depends(upx-compare-nrv2e "upx-unpack;upx-unpack-nrv2e")
upx_test_depends(upx-compare-lzma "upx-unpack;upx-unpack-lzma")
# tests with higher COST values will run first
set_tests_properties(upx-self-pack PROPERTIES COST 90)
set_tests_properties(upx-self-pack-fa PROPERTIES COST 20)
set_tests_properties(upx-self-pack-fn PROPERTIES COST 20)
set_tests_properties(upx-self-pack-fr PROPERTIES COST 20)
set_tests_properties(upx-self-pack-nrv2b PROPERTIES COST 20)
set_tests_properties(upx-self-pack-nrv2d PROPERTIES COST 20)
set_tests_properties(upx-self-pack-nrv2e PROPERTIES COST 20)
set_tests_properties(upx-self-pack-lzma PROPERTIES COST 30)
set_tests_properties(upx-unpack PROPERTIES COST 10)
if(NOT UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST)
upx_add_test(upx-run-unpacked ${emu} ./upx-unpacked${exe} --version-short)
upx_test_depends(upx-run-unpacked upx-unpack)
endif()
if(NOT UPX_CONFIG_DISABLE_RUN_PACKED_TEST)
upx_add_test(upx-run-packed ${emu} ./upx-packed${exe} --version-short)
upx_add_test(upx-run-packed-fa ${emu} ./upx-packed-fa${exe} --version-short)
upx_add_test(upx-run-packed-fn ${emu} ./upx-packed-fn${exe} --version-short)
upx_add_test(upx-run-packed-fr ${emu} ./upx-packed-fr${exe} --version-short)
upx_add_test(upx-run-packed-nrv2b ${emu} ./upx-packed-nrv2b${exe} --version-short)
upx_add_test(upx-run-packed-nrv2d ${emu} ./upx-packed-nrv2d${exe} --version-short)
upx_add_test(upx-run-packed-nrv2e ${emu} ./upx-packed-nrv2e${exe} --version-short)
upx_add_test(upx-run-packed-lzma ${emu} ./upx-packed-lzma${exe} --version-short)
upx_test_depends(upx-run-packed upx-self-pack)
upx_test_depends(upx-run-packed-fa upx-self-pack-fa)
upx_test_depends(upx-run-packed-fn upx-self-pack-fn)
upx_test_depends(upx-run-packed-fr upx-self-pack-fr)
upx_test_depends(upx-run-packed-nrv2b upx-self-pack-nrv2b)
upx_test_depends(upx-run-packed-nrv2d upx-self-pack-nrv2d)
upx_test_depends(upx-run-packed-nrv2e upx-self-pack-nrv2e)
upx_test_depends(upx-run-packed-lzma upx-self-pack-lzma)
endif()
#
# exhaustive tests
#
if(NOT UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS)
foreach(method IN ITEMS nrv2b nrv2d nrv2e lzma)
foreach(level IN ITEMS 1 2 3 4 5 6 7)
foreach(small IN ITEMS normal small)
set(s "${method}-${level}")
set(ss "")
if(small MATCHES "small")
set(s "${method}-${level}-${small}")
set(ss "--small")
endif()
upx_add_test(upx-self-pack-${s} upx --${method} -${level} ${ss} --all-filters --debug-use-random-filter "${upx_self_exe}" ${fo} -o upx-packed-${s}${exe})
upx_add_test(upx-list-${s} upx -l upx-packed-${s}${exe})
upx_add_test(upx-fileinfo-${s} upx --fileinfo upx-packed-${s}${exe})
upx_add_test(upx-test-${s} upx -t upx-packed-${s}${exe})
upx_add_test(upx-unpack-${s} upx -d upx-packed-${s}${exe} ${fo} -o upx-unpacked-${s}${exe})
upx_add_test(upx-compare-${s} "${CMAKE_COMMAND}" -E compare_files upx-unpacked${exe} upx-unpacked-${s}${exe})
upx_test_depends(upx-list-${s} upx-self-pack-${s})
upx_test_depends(upx-fileinfo-${s} upx-self-pack-${s})
upx_test_depends(upx-test-${s} upx-self-pack-${s})
upx_test_depends(upx-unpack-${s} upx-self-pack-${s})
upx_test_depends(upx-compare-${s} "upx-unpack;upx-unpack-${s}")
if(method MATCHES "lzma")
set_tests_properties(upx-self-pack-${s} PROPERTIES COST "3${level}")
else()
set_tests_properties(upx-self-pack-${s} PROPERTIES COST "2${level}")
endif()
if(NOT UPX_CONFIG_DISABLE_RUN_PACKED_TEST)
set(i 0)
while(${i} LESS 20)
math(EXPR i "${i} + 1")
upx_add_test(upx-run-packed-${s}-${i} ${emu} ./upx-packed-${s}${exe} --version-short)
upx_test_depends(upx-run-packed-${s}-${i} upx-self-pack-${s})
endwhile()
endif()
endforeach()
endforeach()
endforeach()
endif() # UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS
endfunction()
# vim:set ft=cmake ts=4 sw=4 tw=0 et:
+10
View File
@@ -0,0 +1,10 @@
// Copyright (C) Markus Franz Xaver Johannes Oberhumer
#include <mutex>
static std::mutex lock_mutex;
int main() {
std::lock_guard<std::mutex> lock(lock_mutex);
return 0;
}
+22
View File
@@ -0,0 +1,22 @@
// Copyright (C) Markus Franz Xaver Johannes Oberhumer
#include <stddef.h>
#include <stdint.h>
// check ABI - require proper alignment of fundamental types for use in atomics
static_assert(alignof(char) == sizeof(char), "");
static_assert(alignof(signed char) == sizeof(signed char), "");
static_assert(alignof(unsigned char) == sizeof(unsigned char), "");
static_assert(alignof(short) == sizeof(short), "");
static_assert(alignof(unsigned short) == sizeof(unsigned short), "");
static_assert(alignof(int) == sizeof(int), "");
static_assert(alignof(unsigned int) == sizeof(unsigned int), "");
static_assert(alignof(long) == sizeof(long), "");
static_assert(alignof(unsigned long) == sizeof(unsigned long), "");
static_assert(alignof(ptrdiff_t) == sizeof(ptrdiff_t), "");
static_assert(alignof(size_t) == sizeof(size_t), "");
static_assert(alignof(intptr_t) == sizeof(intptr_t), "");
static_assert(alignof(uintptr_t) == sizeof(uintptr_t), "");
static_assert(alignof(void *) == sizeof(void *), "");
int main() { return 0; }
+11
View File
@@ -0,0 +1,11 @@
#
# UPX "CMake" build file; see https://cmake.org/
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
if(NOT DEFINED USE_STRICT_DEFAULTS)
# use strict config defaults for Git developer builds
set(USE_STRICT_DEFAULTS TRUE CACHE INTERNAL "" FORCE)
endif()
# vim:set ft=cmake ts=4 sw=4 tw=0 et:
+385
View File
@@ -0,0 +1,385 @@
#
# UPX top-level Makefile - needs GNU make and CMake >= 3.13
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
ifeq ($(UPX_MAKEFILE_EXTRA_MK_INCLUDED),)
override UPX_MAKEFILE_EXTRA_MK_INCLUDED := 1
#***********************************************************************
# support functions
#***********************************************************************
override check_defined = $(foreach 1,$1,$(if $(filter undefined,$(origin $1)),$(error ERROR: variable '$1' is not defined),))
override check_undefined = $(foreach 1,$1,$(if $(filter undefined,$(origin $1)),,$(error ERROR: variable '$1' is already defined)))
# return "1" or empty-string
override eq = $(if $(subst x$1,,x$2)$(subst x$2,,x$1),,1)
override ne = $(if $(subst x$1,,x$2)$(subst x$2,,x$1),1,)
override tolower = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
override toupper = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1))))))))))))))))))))))))))
# canonicalize the case of CMAKE_BUILD_TYPE to "Debug" and "Release"
override cm_build_type = $(if $(call eq,$1,),$(error EMPTY-build-type),$(if $(call eq,$(call tolower,$1),debug),Debug,$(if $(call eq,$(call tolower,$1),release),Release,$(if $(call eq,$(call tolower,$1),none),None,$1))))
#***********************************************************************
# extra builds: some pre-defined build configurations
#***********************************************************************
$(call check_defined,run_config run_build)
$(call check_undefined,run_config_and_build)
define run_config_and_build
$(call run_config,$1,$2)
$(call run_build,$1,$2)
endef
# force building with clang/clang++
build/extra/clang/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang/%: export CC = clang
build/extra/clang/%: export CXX = clang++
# force building with clang/clang++ -m32
build/extra/clang-m32/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-m32/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-m32/%: export CC = clang -m32
build/extra/clang-m32/%: export CXX = clang++ -m32
# force building with clang/clang++ -mx32
build/extra/clang-mx32/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-mx32/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-mx32/%: export CC = clang -mx32
build/extra/clang-mx32/%: export CXX = clang++ -mx32
# force building with clang/clang++ -m64
build/extra/clang-m64/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-m64/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-m64/%: export CC = clang -m64
build/extra/clang-m64/%: export CXX = clang++ -m64
# force building with clang/clang++ -flto=auto
build/extra/clang-lto-auto/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-lto-auto/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-lto-auto/%: export CC = clang -flto=auto
build/extra/clang-lto-auto/%: export CXX = clang++ -flto=auto
# force building with clang/clang++ -pie
build/extra/clang-pie/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-pie/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-pie/%: export CC = clang -pie -fPIE -Wno-unused-command-line-argument
build/extra/clang-pie/%: export CXX = clang++ -pie -fPIE -Wno-unused-command-line-argument
build/extra/clang-pie/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with clang/clang++ -static
build/extra/clang-static/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-static/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-static/%: export CC = clang -static
build/extra/clang-static/%: export CXX = clang++ -static
build/extra/clang-static/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with clang/clang++ -static-pie
build/extra/clang-static-pie/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-static-pie/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-static-pie/%: export CC = clang -static-pie -fPIE -Wno-unused-command-line-argument
build/extra/clang-static-pie/%: export CXX = clang++ -static-pie -fPIE -Wno-unused-command-line-argument
build/extra/clang-static-pie/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with clang/clang++ -static -flto
build/extra/clang-static-lto/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-static-lto/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-static-lto/%: export CC = clang -static -flto
build/extra/clang-static-lto/%: export CXX = clang++ -static -flto
build/extra/clang-static-lto/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with clang/clang++ C++20 (and C17)
build/extra/clang-std-cxx20/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-std-cxx20/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-std-cxx20/%: export CC = clang -std=gnu17
build/extra/clang-std-cxx20/%: export CXX = clang++ -std=gnu++20
build/extra/clang-std-cxx20/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
build/extra/clang-std-cxx20/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
# force building with clang/clang++ C++23 (and C23)
build/extra/clang-std-cxx23/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-std-cxx23/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-std-cxx23/%: export CC = clang -std=gnu2x -Wno-constant-logical-operand
build/extra/clang-std-cxx23/%: export CXX = clang++ -std=gnu++2b
build/extra/clang-std-cxx23/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
build/extra/clang-std-cxx23/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
# force building with clang/clang++ C++26 (and C23)
build/extra/clang-std-cxx26/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/clang-std-cxx26/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/clang-std-cxx26/%: export CC = clang -std=gnu2x -Wno-constant-logical-operand
build/extra/clang-std-cxx26/%: export CXX = clang++ -std=gnu++2c
build/extra/clang-std-cxx26/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
build/extra/clang-std-cxx26/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
# force building with gcc/g++
build/extra/gcc/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc/%: export CC = gcc
build/extra/gcc/%: export CXX = g++
# force building with gcc/g++ -m32
build/extra/gcc-m32/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-m32/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-m32/%: export CC = gcc -m32
build/extra/gcc-m32/%: export CXX = g++ -m32
# force building with gcc/g++ -mx32
build/extra/gcc-mx32/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-mx32/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-mx32/%: export CC = gcc -mx32
build/extra/gcc-mx32/%: export CXX = g++ -mx32
# force building with gcc/g++ -m64
build/extra/gcc-m64/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-m64/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-m64/%: export CC = gcc -m64
build/extra/gcc-m64/%: export CXX = g++ -m64
# force building with gcc/g++ -flto=auto
build/extra/gcc-lto-auto/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-lto-auto/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-lto-auto/%: export CC = gcc -flto=auto
build/extra/gcc-lto-auto/%: export CXX = g++ -flto=auto
# force building with gcc/g++ -pie
build/extra/gcc-pie/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-pie/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-pie/%: export CC = gcc -pie -fPIE
build/extra/gcc-pie/%: export CXX = g++ -pie -fPIE
build/extra/gcc-pie/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with gcc/g++ -static
build/extra/gcc-static/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-static/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-static/%: export CC = gcc -static
build/extra/gcc-static/%: export CXX = g++ -static
build/extra/gcc-static/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with gcc/g++ -static-pie
build/extra/gcc-static-pie/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-static-pie/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-static-pie/%: export CC = gcc -static-pie -fPIE
build/extra/gcc-static-pie/%: export CXX = g++ -static-pie -fPIE
build/extra/gcc-static-pie/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with gcc/g++ -static -flto
build/extra/gcc-static-lto/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-static-lto/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-static-lto/%: export CC = gcc -static -flto
build/extra/gcc-static-lto/%: export CXX = g++ -static -flto
build/extra/gcc-static-lto/%: export UPX_CONFIG_DISABLE_SHARED_LIBS = ON
# force building with gcc/g++ C++20 (and C17)
build/extra/gcc-std-cxx20/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-std-cxx20/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-std-cxx20/%: export CC = gcc -std=gnu17
build/extra/gcc-std-cxx20/%: export CXX = g++ -std=gnu++20
build/extra/gcc-std-cxx20/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
build/extra/gcc-std-cxx20/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
# force building with gcc/g++ C++23 (and C23)
build/extra/gcc-std-cxx23/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-std-cxx23/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-std-cxx23/%: export CC = gcc -std=gnu2x
build/extra/gcc-std-cxx23/%: export CXX = g++ -std=gnu++2b
build/extra/gcc-std-cxx23/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
build/extra/gcc-std-cxx23/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
# force building with gcc/g++ C++26 (and C23)
build/extra/gcc-std-cxx26/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/gcc-std-cxx26/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/gcc-std-cxx26/%: export CC = gcc -std=gnu23
build/extra/gcc-std-cxx26/%: export CXX = g++ -std=gnu++26
build/extra/gcc-std-cxx26/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
build/extra/gcc-std-cxx26/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
# cross compiler: Linux glibc aarch64-linux-gnu (arm64)
build/extra/cross-linux-gnu-aarch64/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/cross-linux-gnu-aarch64/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/cross-linux-gnu-aarch64/%: export CC = aarch64-linux-gnu-gcc
build/extra/cross-linux-gnu-aarch64/%: export CXX = aarch64-linux-gnu-g++
build/extra/cross-linux-gnu-aarch64/%: CMAKE_SYSTEM_NAME ?= Linux
build/extra/cross-linux-gnu-aarch64/%: CMAKE_CROSSCOMPILING_EMULATOR ?= qemu-aarch64
# cross compiler: Linux glibc arm-linux-gnueabihf
build/extra/cross-linux-gnu-arm-eabihf/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/cross-linux-gnu-arm-eabihf/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/cross-linux-gnu-arm-eabihf/%: export CC = arm-linux-gnueabihf-gcc
build/extra/cross-linux-gnu-arm-eabihf/%: export CXX = arm-linux-gnueabihf-g++ -Wno-psabi
build/extra/cross-linux-gnu-arm-eabihf/%: CMAKE_SYSTEM_NAME ?= Linux
build/extra/cross-linux-gnu-arm-eabihf/%: CMAKE_CROSSCOMPILING_EMULATOR ?= qemu-arm
# cross compiler: Windows x86 win32 MinGW (i386)
build/extra/cross-windows-mingw32/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/cross-windows-mingw32/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/cross-windows-mingw32/%: export CC = i686-w64-mingw32-gcc -static -D_WIN32_WINNT=0x0501
build/extra/cross-windows-mingw32/%: export CXX = i686-w64-mingw32-g++ -static -D_WIN32_WINNT=0x0501
build/extra/cross-windows-mingw32/%: CMAKE_SYSTEM_NAME ?= Windows
build/extra/cross-windows-mingw32/%: CMAKE_SYSTEM_PROCESSOR ?= X86
build/extra/cross-windows-mingw32/%: CMAKE_CROSSCOMPILING_EMULATOR ?= wine
# cross compiler: Windows x64 win64 MinGW (amd64)
build/extra/cross-windows-mingw64/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/cross-windows-mingw64/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/cross-windows-mingw64/%: export CC = x86_64-w64-mingw32-gcc -static -D_WIN32_WINNT=0x0501
build/extra/cross-windows-mingw64/%: export CXX = x86_64-w64-mingw32-g++ -static -D_WIN32_WINNT=0x0501
build/extra/cross-windows-mingw64/%: CMAKE_SYSTEM_NAME ?= Windows
build/extra/cross-windows-mingw64/%: CMAKE_SYSTEM_PROCESSOR ?= AMD64
build/extra/cross-windows-mingw64/%: CMAKE_CROSSCOMPILING_EMULATOR ?= wine
# cross compiler: macOS arm64 (aarch64)
build/extra/cross-darwin-arm64/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/cross-darwin-arm64/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/cross-darwin-arm64/%: export CC = clang -target arm64-apple-darwin
build/extra/cross-darwin-arm64/%: export CXX = clang++ -target arm64-apple-darwin
build/extra/cross-darwin-arm64/%: CMAKE_SYSTEM_NAME ?= Darwin
build/extra/cross-darwin-arm64/%: CMAKE_SYSTEM_PROCESSOR ?= arm64
# cross compiler: macOS x86_64 (amd64)
build/extra/cross-darwin-x86_64/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/extra/cross-darwin-x86_64/release: PHONY; $(call run_config_and_build,$@,Release)
build/extra/cross-darwin-x86_64/%: export CC = clang -target x86_64-apple-darwin
build/extra/cross-darwin-x86_64/%: export CXX = clang++ -target x86_64-apple-darwin
build/extra/cross-darwin-x86_64/%: CMAKE_SYSTEM_NAME ?= Darwin
build/extra/cross-darwin-x86_64/%: CMAKE_SYSTEM_PROCESSOR ?= x86_64
#***********************************************************************
# C/C++ static analyzers
#***********************************************************************
# force building with clang Static Analyzer (scan-build)
SCAN_BUILD = scan-build
build/analyze/clang-analyzer/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/analyze/clang-analyzer/release: PHONY; $(call run_config_and_build,$@,Release)
build/analyze/clang-analyzer/%: override CMAKE := $(SCAN_BUILD) $(CMAKE)
build/analyze/clang-analyzer/%: export CCC_CC ?= clang
build/analyze/clang-analyzer/%: export CCC_CXX ?= clang++
# run clang-tidy: uses file compile_commands.json from an existing clang build;
# does not create any actual files, so purely PHONY
CLANG_TIDY_BUILD_BASE = build/extra/clang
RUN_CLANG_TIDY = time python3 ./misc/analyze/clang-tidy/run-clang-tidy.py -p "$<"
RUN_CLANG_TIDY_WERROR = $(RUN_CLANG_TIDY) '-warnings-as-errors=*'
build/analyze/clang-tidy-upx/debug build/analyze/clang-tidy-upx/release: $$(CLANG_TIDY_BUILD_BASE)/$$(notdir $$@) PHONY
$(RUN_CLANG_TIDY_WERROR) -config-file ./.clang-tidy '/src/.*\.cpp'
build/analyze/clang-tidy-bzip2/debug build/analyze/clang-tidy-bzip2/release: $$(CLANG_TIDY_BUILD_BASE)/$$(notdir $$@) PHONY
$(RUN_CLANG_TIDY) -config-file ./misc/analyze/clang-tidy/clang-tidy-bzip2.yml /vendor/bzip2/
build/analyze/clang-tidy-ucl/debug build/analyze/clang-tidy-ucl/release: $$(CLANG_TIDY_BUILD_BASE)/$$(notdir $$@) PHONY
$(RUN_CLANG_TIDY_WERROR) -config-file ./misc/analyze/clang-tidy/clang-tidy-ucl.yml /vendor/ucl/
build/analyze/clang-tidy-zlib/debug build/analyze/clang-tidy-zlib/release: $$(CLANG_TIDY_BUILD_BASE)/$$(notdir $$@) PHONY
$(RUN_CLANG_TIDY) -config-file ./misc/analyze/clang-tidy/clang-tidy-zlib.yml /vendor/zlib/
build/analyze/clang-tidy-zstd/debug build/analyze/clang-tidy-zstd/release: $$(CLANG_TIDY_BUILD_BASE)/$$(notdir $$@) PHONY
$(RUN_CLANG_TIDY) -config-file ./misc/analyze/clang-tidy/clang-tidy-zstd.yml /vendor/zstd/
build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-upx/$$(notdir $$@)
build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-bzip2/$$(notdir $$@)
build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-ucl/$$(notdir $$@)
build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-zlib/$$(notdir $$@)
build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-zstd/$$(notdir $$@)
build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: PHONY
# OLD names [deprecated]
build/extra/scan-build/debug: build/analyze/clang-analyzer/debug PHONY
build/extra/scan-build/release: build/analyze/clang-analyzer/release PHONY
#***********************************************************************
# advanced: generic eXtra target
#***********************************************************************
# usage:
# make UPX_XTARGET=my-target CC="my-cc -flags" CXX="my-cxx -flags"
# make UPX_XTARGET=my-target CC="my-cc -flags" CXX="my-cxx -flags" xtarget/debug
ifneq ($(UPX_XTARGET),)
ifneq ($(CC),)
ifneq ($(CXX),)
UPX_XTARGET := $(UPX_XTARGET)
build/$(UPX_XTARGET)/debug: PHONY; $(call run_config_and_build,$@,Debug)
build/$(UPX_XTARGET)/release: PHONY; $(call run_config_and_build,$@,Release)
build/$(UPX_XTARGET)/%: export CC := $(CC)
build/$(UPX_XTARGET)/%: export CXX := $(CXX)
# shortcuts
xtarget/debug: build/$(UPX_XTARGET)/debug PHONY
xtarget/release: build/$(UPX_XTARGET)/release PHONY
xtarget/all: xtarget/debug xtarget/release PHONY
xtarget/debug+test: build/$(UPX_XTARGET)/debug+test PHONY
xtarget/release+test: build/$(UPX_XTARGET)/release+test PHONY
xtarget/all+test: xtarget/debug+test xtarget/release+test PHONY
# set new default
.DEFAULT_GOAL := build/$(UPX_XTARGET)/release
endif
endif
endif
#***********************************************************************
# assemble cmake config flags; useful for CI jobs
#
# info: by default CMake only honors the CC and CXX environment variables; make
# it easy to set other variables like CMAKE_AR or CMAKE_RANLIB
#***********************************************************************
UPX_CMAKE_CONFIG_FLAGS += $(UPX_CMAKE_CONFIG_FLAGS_GENERATOR)
UPX_CMAKE_CONFIG_FLAGS += $(UPX_CMAKE_CONFIG_FLAGS_TOOLSET)
UPX_CMAKE_CONFIG_FLAGS += $(UPX_CMAKE_CONFIG_FLAGS_PLATFORM)
$(call check_undefined,__add_cmake_config)
# promote an environment or Make variable to a CMake cache entry:
__add_cmake_config = $(and $($1),-D$1="$($1)")
# pass common CMake settings
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_INSTALL_PREFIX)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_VERBOSE_MAKEFILE)
# pass common CMake toolchain settings
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_ADDR2LINE)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_AR)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_DLLTOOL)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_LINKER)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_NM)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_OBJCOPY)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_OBJDUMP)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_RANLIB)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_READELF)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_STRIP)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_TAPI)
# pass common CMake LTO toolchain settings
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_C_COMPILER_AR)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_C_COMPILER_RANLIB)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_CXX_COMPILER_AR)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_CXX_COMPILER_RANLIB)
# pass common CMake cross compilation settings
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_SYSTEM_NAME)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_SYSTEM_PROCESSOR)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_CROSSCOMPILING_EMULATOR)
# pass UPX config options; see CMakeLists.txt
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_DISABLE_GITREV)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_DISABLE_SANITIZE)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_DISABLE_WERROR)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_DISABLE_WSTRICT)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_DISABLE_SELF_PACK_TEST)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS)
# pass UPX extra compile options; see CMakeLists.txt
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_EXTRA_COMPILE_OPTIONS_BZIP2)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_EXTRA_COMPILE_OPTIONS_UCL)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_EXTRA_COMPILE_OPTIONS_UPX)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZLIB)
UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZSTD)
#***********************************************************************
# check git submodules
#***********************************************************************
SUBMODULES = doctest lzma-sdk ucl valgrind zlib
$(foreach 1,$(SUBMODULES),$(if $(wildcard vendor/$1/[CL]*),,\
$(error ERROR: missing git submodule '$1'; run 'git submodule update --init')))
endif # UPX_MAKEFILE_EXTRA_MK_INCLUDED
# vim:set ts=8 sw=8 noet:
+30
View File
@@ -0,0 +1,30 @@
From 741b9d2f24b5796fc499a411f632820ab4f889e5 Mon Sep 17 00:00:00 2001
From: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
Date: Wed, 9 Apr 2025 20:00:24 +0200
Subject: [PATCH] x
---
lib/libcxx/include/__config | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/libcxx/include/__config b/lib/libcxx/include/__config
index fec323f..a16d145 100644
--- a/lib/libcxx/include/__config
+++ b/lib/libcxx/include/__config
@@ -637,9 +637,12 @@ typedef __char32_t char32_t;
# define _DECLARE_C99_LDBL_MATH 1
# endif
+# if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
+# define _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION 0
+# elif defined(_LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION)
// If we are getting operator new from the MSVC CRT, then allocation overloads
// for align_val_t were added in 19.12, aka VS 2017 version 15.3.
-# if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912
+# elif defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912
# define _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION 0
# elif defined(_LIBCPP_ABI_VCRUNTIME) && !defined(__cpp_aligned_new)
// We're deferring to Microsoft's STL to provide aligned new et al. We don't
--
2.49.0
+17
View File
@@ -0,0 +1,17 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
# create the image from Dockerfile
# using a rootless Podman container
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
image=upx-stubtools-20240405-v1
[[ $1 == --print-image ]] && echo "$image" && exit 0
podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir"
podman image list "$image"
echo
podman image tree "$image"
+41
View File
@@ -0,0 +1,41 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
# list all system packages that are installed in the image
# using a rootless Podman container
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
image="$("$argv0dir/10-create-image.sh" --print-image)"
podman image list "$image"
echo
podman image tree "$image"
echo 'Packages:'
flags=( --read-only --rm --pull=never )
flags+=( --cap-drop=all ) # drop all capabilities
flags+=( --network=none ) # no network needed
podman run "${flags[@]}" "$image" bash -c $'dpkg -l | sed \'s/ *$//\' | LC_ALL=C sort'
echo
echo 'Packages sorted by Installed-Size:'
podman run "${flags[@]}" "$image" bash -c $'awk \'
BEGIN {
arch = "UNKNOWN"; size = 0; package = "UNKNOWN";
}
{
if ($1 == "Architecture:") arch = $2;
if ($1 == "Installed-Size:") size = $2;
if ($1 == "Package:") package = $2;
if ($1 == "") {
printf("%9d %-40s %s\\n", size, package, arch);
count += 1; total += size;
arch = "UNKNOWN"; size = 0; package = "UNKNOWN";
}
}
END {
printf("%9d ===== TOTAL (%d packages)\\n", total, count);
}
\' /var/lib/dpkg/status | LC_ALL=C sort -rn'
+84
View File
@@ -0,0 +1,84 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
# run an interactive shell in the image
# using a rootless Podman container
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
image="$("$argv0dir/10-create-image.sh" --print-image)"
flags=( --read-only --rm --pull=never )
flags+=( --cap-drop=all ) # drop all capabilities
flags+=( --network=none ) # no network needed
flags+=( -ti -e TERM="$TERM" ) # allocate an interactive pseudo-tty and pass $TERM
if [[ 1 == 1 ]]; then
# run as user upx 2000:2000
flags+=( --user 2000 )
# map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user
flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 )
# map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx
# INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs!
flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" )
flags+=( -w /home/upx/src/upx ) # set working directory
flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.config:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs
else
# run as user root 0:0
# ONLY FOR DEBUGGING THE IMAGE
# map container user/group 0 to current host user/group
flags+=( --user 0 )
fi
if [[ $# == 0 ]]; then
podman run "${flags[@]}" "$image" bash -l
else
podman run "${flags[@]}" "$image" "$@"
fi
# now we can rebuild the UPX stubs:
# cd /home/upx/src/upx/src/stub
# # make sure that git is clean:
# git status .
# # remove stub files and make sure that they got deleted:
# make maintainer-clean extra-clean
# git status .
# # rebuild
# make extra-all all
# # make sure that the stub files did rebuild correctly:
# git status .
# git diff .
# we can also build UPX in the container:
# cd /home/upx/src/upx
# rm -rf ./build/extra/gcc/release
# make build/extra/gcc/release
# # run tests
# ./build/extra/gcc/release/upx --version
# make -C build/extra/gcc/release test
# and we can also build UPX with -m32:
# cd /home/upx/src/upx
# rm -rf ./build/extra/gcc-m32/release
# make build/extra/gcc-m32/release
# # run tests
# ./build/extra/gcc-m32/release/upx --version
# make -C build/extra/gcc-m32/release test
# and we can also build UPX with -mx32: (NOTE: needs CONFIG_X86_X32_ABI on host kernel!)
# cd /home/upx/src/upx
# rm -rf ./build/extra/gcc-mx32/release
# make build/extra/gcc-mx32/release
# # run tests (needs CONFIG_X86_X32_ABI on host kernel)
# ./build/extra/gcc-mx32/release/upx --version
# make -C build/extra/gcc-mx32/release test
# and we can also rebuild the UPX docs the container:
# cd /home/upx/src/upx/doc
# make clean all
# git status .
# git diff .
+42
View File
@@ -0,0 +1,42 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
# rebuild stubs from source code
# (also see 20-image-run-shell.sh for more container usage examples)
# using a rootless Podman container
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
image="$("$argv0dir/10-create-image.sh" --print-image)"
flags=( --read-only --rm --pull=never )
flags+=( --cap-drop=all ) # drop all capabilities
flags+=( --network=none ) # no network needed
if [[ 1 == 1 ]]; then
# run as user upx 2000:2000
flags+=( --user 2000 )
# map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user
flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 )
# map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx
# INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs!
flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" )
fi
podman run "${flags[@]}" "$image" bash -c $'
set -ex; set -o pipefail
cd /home/upx/src/upx
# check whitespace
[[ -d .git ]] && bash ./misc/scripts/check_whitespace_git.sh
# rebuild docs
make -C doc clean all
# rebuild stubs
cd /home/upx/src/upx/src/stub
make maintainer-clean extra-clean
git status . || true # make sure the stub files got deleted
make extra-all all
echo "===== Rebuilt stubs. All done. ====="
exit 0
'
+104
View File
@@ -0,0 +1,104 @@
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
FROM docker.io/library/ubuntu:24.04
ENV UPX_CONTAINER_IMAGE_NAME=upx-stubtools-20240405-v1
ARG DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
# install system packages
RUN dpkg --add-architecture i386 \
&& apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
aria2 bash bash-completion ca-certificates coreutils curl diffutils findutils git grep gzip \
less libmpc3 make ncurses-term perl-base python3 sed sudo tar time util-linux wget xz-utils \
libc6:i386 zlib1g:i386 \
# the following packages are not required for rebuilding the stubs, but
# they do make the image *much* more convenient and also allow building
# the full UPX binary inside the container via CMake:
7zip bat bfs btop bubblewrap busybox bzip2 bzip3 cabextract ccache chrpath cmake cpio \
dash diffstat direnv dmidecode elfutils execstack eza fd-find file fish fzf \
g++ gawk gdb gh gojq ht htop hyperfine jq just ksh \
lftp libzstd-dev lsb-release lsd lz4 lzip lzop minify mksh moreutils musl neovim ninja-build \
p7zip parallel patch patchelf patchutils pax-utils proot \
python3-pyasn1 python3-pycryptodome python3-pycurl python3-tomli python3-tomli-w \
python3-yaml python3-zstd \
re2c ripgrep rsync screen socat strace universal-ctags unzip valgrind yash yq \
zip zlib1g-dev zoxide zsh zstd \
# extra packages for compiling with "gcc -m32" and "gcc -mx32":
g++-multilib gcc-multilib \
&& apt-get install -y \
gcc-riscv64-linux-gnu \
&& true
# install python2-minimal packages from Debian-11; REQUIRED
RUN cd /root \
&& aria2c --checksum=sha-256=85833c92314011b89bbead6f9a5a7a360b5ee4f9b95e001225afead4ebf9f7d3 \
'https://ftp.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_amd64.deb' \
&& aria2c --checksum=sha-256=44f0cdc1a343303d31c55fcb3a6402cfe326adf749ec30e375e6e0c0c5f7c1f7 \
'https://ftp.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_amd64.deb' \
&& dpkg -i ./*.deb \
&& rm ./*.deb \
&& if ! test -f /usr/bin/python2; then ln -s -v python2.7 /usr/bin/python2; fi \
&& ldconfig \
&& true
# manually unpack and install compat libs from Ubuntu-16.04; REQUIRED
RUN cd /root \
&& aria2c --checksum=sha-256=de22baf3dd851a10e16fbf66a243e70149ca46e06b2939fdc79429196cefc090 \
'https://archive.kernel.org/ubuntu-archive/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.6-1_amd64.deb' \
&& mkdir packages \
&& for f in ./*.deb; do dpkg -x $f ./packages; done \
&& mv -v -n ./packages/usr/lib/x86_64-linux-gnu/lib* /usr/lib/x86_64-linux-gnu/ \
&& rm -rf ./*.deb ./packages \
&& ldconfig \
&& true
# install upx-stubtools into /usr/local/bin/bin-upx-20221212; REQUIRED
RUN cd /root \
&& aria2c --checksum=sha-256=509e06639118a79d8e79489a400e134c6d3ca36bad2c6ec29648d7c1e5b81afa \
'https://github.com/upx/upx-stubtools/releases/download/v20221212/bin-upx-20221212.tar.xz' \
&& cd /usr/local/bin \
&& tar -xoaf /root/bin-upx-20221212.tar.xz \
&& rm /root/bin-upx-20221212.tar.xz \
&& true
# install official UPX release binaries into /usr/local/bin; not required but convenient for testing
RUN cd /root \
&& curl -sS -L -O https://github.com/upx/upx/releases/download/v3.91/upx-3.91-amd64_linux.tar.bz2 \
&& xzversions="3.92 3.93 3.94 3.95 3.96 4.0.0 4.0.1 4.0.2 4.1.0 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 5.0.0 5.0.1 5.0.2" \
&& for v in $xzversions; do curl -sS -L -O https://github.com/upx/upx/releases/download/v${v}/upx-${v}-amd64_linux.tar.xz; done \
&& for f in ./upx-*.tar.*; do tar -xoaf $f; done \
&& for v in 3.91 $xzversions; do d=upx-${v}-amd64_linux; ./$d/upx -qq -d $d/upx -o /usr/local/bin/upx-${v}; done \
&& rm -r ./upx-*.tar.* ./upx-*linux \
&& true
# create default container user upx:upx 2000:2000
RUN useradd upx -U --uid 2000 --shell /bin/bash -m \
&& cd /home/upx && chmod 00700 . \
# prepare ~/.cache, ~/.config and ~/.local for possible tmpfs mounts
&& mkdir -p .cache/tmp .local/bin src/upx \
&& for d in ccache fontconfig go-build mesa_shader_cache parallel tmp wine zig; do mkdir -p .cache/$d; done \
&& for d in fish git helix kak nvim; do mkdir -p .config/$d; done \
&& for d in bin include lib share state; do mkdir -p .local/$d; done \
&& ln -s .cache/wine .wine && ln -s .cache/tmp tmp \
# symlink upx-stubtools
&& ln -s /usr/local/bin/bin-upx-20221212 .local/bin/bin-upx \
# some convenience settings according to upx developer preferences
&& echo "alias path='echo PATH=\"\$PATH\"'" >> .bashrc \
&& echo "alias md=mkdir" >> .bashrc \
&& echo "alias rd=rmdir" >> .bashrc \
&& echo 'mdd() { mkdir "$1" && cd "$1"; }' >> .bashrc \
&& echo 'm() { make "$@"; }' >> .bashrc \
&& echo 'mm() { make -j8 "$@"; }' >> .bashrc \
&& echo 'tn() { time nice "$@"; }' >> .bashrc \
&& echo 'tnm() { time nice make "$@"; }' >> .bashrc \
&& echo 'tnmm() { time nice make -j8 "$@"; }' >> .bashrc \
&& echo 'source /usr/share/bash-completion/completions/make' >> .bashrc \
&& echo 'complete -F _make m mm tnm tnmm' >> .bashrc \
&& echo 'eval "$(zoxide init bash)"' >> .bashrc \
&& echo "alias zz=zi\nalias y=z\nalias yy=zi" >> .bashrc \
&& echo "alias cd..='cd ..'" >> .bashrc \
&& echo "alias ..='cd ..'" >> .bashrc \
&& echo "alias .='cd ..'" >> .bashrc \
&& chown -R upx:upx . \
&& true
USER upx
+804
View File
@@ -0,0 +1,804 @@
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/upx-stubtools-20240405-v1 latest e35ec64e37eb 3 minutes ago 1.62 GB
Image ID: e35ec64e37eb
Tags: [localhost/upx-stubtools-20240405-v1:latest]
Size: 1.616GB
Image Layers
├── ID: 073ec47a8c22 Size: 80.63MB Top Layer of: [docker.io/library/ubuntu:24.04]
├── ID: cc32efc504cb Size: 1.168GB
├── ID: 0ad248142047 Size: 9.477MB
├── ID: 1b5f23a7b45a Size: 457.2kB
├── ID: fde08588dc3b Size: 320.1MB
├── ID: 028612b01bc7 Size: 37.45MB
└── ID: a8359823a285 Size: 44.03kB Top Layer of: [localhost/upx-stubtools-20240405-v1:latest]
Packages:
+++-===================================-=================================-============-================================================================================
Desired=Unknown/Install/Remove/Purge/Hold
ii 7zip 23.01+dfsg-11 amd64 7-Zip file archiver with a high compression ratio
ii apt 2.8.3 amd64 commandline package manager
ii aria2 1.37.0+debian-1build3 amd64 High speed download utility
ii base-files 13ubuntu10.3 amd64 Debian base system miscellaneous files
ii base-passwd 3.6.3build1 amd64 Debian base system master password and group files
ii bash 5.2.21-2ubuntu4 amd64 GNU Bourne Again SHell
ii bash-completion 1:2.11-8 all programmable completion for the bash shell
ii bat 0.24.0-1build1 amd64 cat(1) clone with syntax highlighting and git integration
ii bfs 3.1.2-1build1 amd64 Breadth-first version of find(1)
ii binutils 2.42-4ubuntu2.6 amd64 GNU assembler, linker and binary utilities
ii binutils-common:amd64 2.42-4ubuntu2.6 amd64 Common files for the GNU assembler, linker and binary utilities
ii binutils-riscv64-linux-gnu 2.42-4ubuntu2.6 amd64 GNU binary utilities, for riscv64-linux-gnu target
ii binutils-x86-64-linux-gnu 2.42-4ubuntu2.6 amd64 GNU binary utilities, for x86-64-linux-gnu target
ii bsdextrautils 2.39.3-9ubuntu6.3 amd64 extra utilities from 4.4BSD-Lite
ii bsdutils 1:2.39.3-9ubuntu6.3 amd64 basic utilities from 4.4BSD-Lite
ii btop 1.3.0-1 amd64 Modern and colorful command line resource monitor that shows usage and stats
ii bubblewrap 0.9.0-1ubuntu0.1 amd64 utility for unprivileged chroot and namespace manipulation
ii busybox 1:1.36.1-6ubuntu3.1 amd64 Tiny utilities for small and embedded systems
ii bzip2 1.0.8-5.1build0.1 amd64 high-quality block-sorting file compressor - utilities
ii bzip3 1.4.0-1 amd64 better, faster and stronger spiritual successor to bzip2 - utilities
ii ca-certificates 20240203 all Common CA certificates
ii cabextract 1.11-2 amd64 Microsoft Cabinet file unpacker
ii ccache 4.9.1-1 amd64 Compiler cache for fast recompilation of C/C++ code
ii chrpath 0.16-2build1 amd64 Tool to edit the rpath in ELF binaries
ii cmake 3.28.3-1build7 amd64 cross-platform, open-source make system
ii cmake-data 3.28.3-1build7 all CMake data files (modules, templates and documentation)
ii coreutils 9.4-3ubuntu6.1 amd64 GNU core utilities
ii cpio 2.15+dfsg-1ubuntu2 amd64 GNU cpio -- a program to manage archives of files
ii cpp 4:13.2.0-7ubuntu1 amd64 GNU C preprocessor (cpp)
ii cpp-13 13.3.0-6ubuntu2~24.04 amd64 GNU C preprocessor
ii cpp-13-riscv64-linux-gnu 13.3.0-6ubuntu2~24.04cross1 amd64 GNU C preprocessor for riscv64-linux-gnu
ii cpp-13-x86-64-linux-gnu 13.3.0-6ubuntu2~24.04 amd64 GNU C preprocessor for x86_64-linux-gnu
ii cpp-riscv64-linux-gnu 4:13.2.0-7ubuntu1 amd64 GNU C preprocessor (cpp) for the riscv64 architecture
ii cpp-x86-64-linux-gnu 4:13.2.0-7ubuntu1 amd64 GNU C preprocessor (cpp) for the amd64 architecture
ii curl 8.5.0-2ubuntu10.6 amd64 command line tool for transferring data with URL syntax
ii dash 0.5.12-6ubuntu5 amd64 POSIX-compliant shell
ii debconf 1.5.86ubuntu1 all Debian configuration management system
ii debianutils 5.17build1 amd64 Miscellaneous utilities specific to Debian
ii diffstat 1.66-1build1 amd64 produces graph of changes introduced by a diff file
ii diffutils 1:3.10-1build1 amd64 File comparison utilities
ii direnv 2.32.1-2ubuntu0.24.04.3 amd64 Utility to set directory specific environment variables
ii dmidecode 3.5-3ubuntu0.1 amd64 SMBIOS/DMI table decoder
ii dpkg 1.22.6ubuntu6.5 amd64 Debian package management system
ii e2fsprogs 1.47.0-2.4~exp1ubuntu4.1 amd64 ext2/ext3/ext4 file system utilities
ii elfutils 0.190-1.1ubuntu0.1 amd64 collection of utilities to handle ELF objects
ii execstack 0.0.20131005-1.1ubuntu1 amd64 ELF GNU_STACK program header editing utility
ii eza 0.18.2-1 amd64 Modern replacement for ls
ii fd-find 9.0.0-1 amd64 Simple, fast and user-friendly alternative to find
ii file 1:5.45-3build1 amd64 Recognize the type of data in a file using "magic" numbers
ii findutils 4.9.0-5build1 amd64 utilities for finding files--find, xargs
ii fish 3.7.0-1 amd64 friendly interactive shell
ii fish-common 3.7.0-1 all friendly interactive shell (architecture-independent files)
ii fzf 0.44.1-1ubuntu0.3 amd64 general-purpose command-line fuzzy finder
ii g++ 4:13.2.0-7ubuntu1 amd64 GNU C++ compiler
ii g++-13 13.3.0-6ubuntu2~24.04 amd64 GNU C++ compiler
ii g++-13-multilib 13.3.0-6ubuntu2~24.04 amd64 GNU C++ compiler (multilib support)
ii g++-13-x86-64-linux-gnu 13.3.0-6ubuntu2~24.04 amd64 GNU C++ compiler for x86_64-linux-gnu architecture
ii g++-x86-64-linux-gnu 4:13.2.0-7ubuntu1 amd64 GNU C++ compiler for the amd64 architecture
ii gawk 1:5.2.1-2build3 amd64 GNU awk, a pattern scanning and processing language
ii gcc 4:13.2.0-7ubuntu1 amd64 GNU C compiler
ii gcc-13 13.3.0-6ubuntu2~24.04 amd64 GNU C compiler
ii gcc-13-base:amd64 13.3.0-6ubuntu2~24.04 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-13-cross-base 13.3.0-6ubuntu2~24.04cross1 all GCC, the GNU Compiler Collection (library base package)
ii gcc-13-multilib 13.3.0-6ubuntu2~24.04 amd64 GNU C compiler (multilib support)
ii gcc-13-riscv64-linux-gnu 13.3.0-6ubuntu2~24.04cross1 amd64 GNU C compiler for the riscv64-linux-gnu architecture
ii gcc-13-riscv64-linux-gnu-base:amd64 13.3.0-6ubuntu2~24.04cross1 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-13-x86-64-linux-gnu 13.3.0-6ubuntu2~24.04 amd64 GNU C compiler for the x86_64-linux-gnu architecture
ii gcc-14-base:amd64 14.2.0-4ubuntu2~24.04 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-14-base:i386 14.2.0-4ubuntu2~24.04 i386 GCC, the GNU Compiler Collection (base package)
ii gcc-14-cross-base 14.2.0-4ubuntu2~24.04cross1 all GCC, the GNU Compiler Collection (library base package)
ii gcc-riscv64-linux-gnu 4:13.2.0-7ubuntu1 amd64 GNU C compiler for the riscv64 architecture
ii gcc-x86-64-linux-gnu 4:13.2.0-7ubuntu1 amd64 GNU C compiler for the amd64 architecture
ii gdb 15.0.50.20240403-0ubuntu1 amd64 GNU Debugger
ii gh 2.45.0-1ubuntu0.3 amd64 GitHub CLI, GitHubs official command line tool
ii git 1:2.43.0-1ubuntu7.3 amd64 fast, scalable, distributed revision control system
ii git-man 1:2.43.0-1ubuntu7.3 all fast, scalable, distributed revision control system (manual pages)
ii gojq 0.12.13-1ubuntu0.24.04.3 amd64 pure Go implementation of jq (program)
ii gpgv 2.4.4-2ubuntu17.3 amd64 GNU privacy guard - signature verification tool
ii grep 3.11-4build1 amd64 GNU grep, egrep and fgrep
ii groff-base 1.23.0-3build2 amd64 GNU troff text-formatting system (base system components)
ii gzip 1.12-1ubuntu3.1 amd64 GNU compression utilities
ii hostname 3.23+nmu2ubuntu2 amd64 utility to set/show the host name or domain name
ii ht 2.1.0+repack1-5 amd64 Viewer/editor/analyser (mostly) for executables
ii htop 3.3.0-4build1 amd64 interactive processes viewer
ii hyperfine 1.18.0-2build1 amd64 Command-line benchmarking tool
ii init-system-helpers 1.66ubuntu1 all helper tools for all init systems
ii jq 1.7.1-3ubuntu0.24.04.1 amd64 lightweight and flexible command-line JSON processor
ii just 1.21.0-1 amd64 Save and run project-specific commands
ii ksh 20240113 all transitional package
ii ksh93u+m 1.0.8-1 amd64 AT&T KornShell
ii less 590-2ubuntu2.1 amd64 pager program similar to more
ii lftp 4.9.2-2ubuntu1.1 amd64 Sophisticated command-line FTP/HTTP/BitTorrent client programs
ii lib32asan8 14.2.0-4ubuntu2~24.04 amd64 AddressSanitizer -- a fast memory error detector (32bit)
ii lib32atomic1 14.2.0-4ubuntu2~24.04 amd64 support library providing __atomic built-in functions (32bit)
ii lib32gcc-13-dev 13.3.0-6ubuntu2~24.04 amd64 GCC support library (32 bit development files)
ii lib32gcc-s1 14.2.0-4ubuntu2~24.04 amd64 GCC support library (32 bit Version)
ii lib32gomp1 14.2.0-4ubuntu2~24.04 amd64 GCC OpenMP (GOMP) support library (32bit)
ii lib32itm1 14.2.0-4ubuntu2~24.04 amd64 GNU Transactional Memory Library (32bit)
ii lib32quadmath0 14.2.0-4ubuntu2~24.04 amd64 GCC Quad-Precision Math Library (32bit)
ii lib32stdc++-13-dev 13.3.0-6ubuntu2~24.04 amd64 GNU Standard C++ Library v3 (development files)
ii lib32stdc++6 14.2.0-4ubuntu2~24.04 amd64 GNU Standard C++ Library v3 (32 bit Version)
ii lib32ubsan1 14.2.0-4ubuntu2~24.04 amd64 UBSan -- undefined behaviour sanitizer (32bit)
ii libacl1:amd64 2.3.2-1build1.1 amd64 access control list - shared library
ii libapparmor1:amd64 4.0.1really4.0.1-0ubuntu0.24.04.4 amd64 changehat AppArmor library
ii libapt-pkg6.0t64:amd64 2.8.3 amd64 package management runtime library
ii libarchive13t64:amd64 3.7.2-2ubuntu0.5 amd64 Multi-format archive and compression library (shared library)
ii libaria2-0:amd64 1.37.0+debian-1build3 amd64 C++ library interface to aria2
ii libasan8-riscv64-cross 14.2.0-4ubuntu2~24.04cross1 all AddressSanitizer -- a fast memory error detector
ii libasan8:amd64 14.2.0-4ubuntu2~24.04 amd64 AddressSanitizer -- a fast memory error detector
ii libasm1t64:amd64 0.190-1.1ubuntu0.1 amd64 library with a programmable assembler interface
ii libassuan0:amd64 2.5.6-1build1 amd64 IPC library for the GnuPG components
ii libatomic1-riscv64-cross 14.2.0-4ubuntu2~24.04cross1 all support library providing __atomic built-in functions
ii libatomic1:amd64 14.2.0-4ubuntu2~24.04 amd64 support library providing __atomic built-in functions
ii libattr1:amd64 1:2.5.2-1build1.1 amd64 extended attribute handling - shared library
ii libaudit-common 1:3.1.2-2.1build1.1 all Dynamic library for security auditing - common files
ii libaudit1:amd64 1:3.1.2-2.1build1.1 amd64 Dynamic library for security auditing
ii libbabeltrace1:amd64 1.5.11-3build3 amd64 Babeltrace conversion libraries
ii libbinutils:amd64 2.42-4ubuntu2.6 amd64 GNU binary utilities (private shared library)
ii libblkid1:amd64 2.39.3-9ubuntu6.3 amd64 block device ID library
ii libbrotli1:amd64 1.1.0-2build2 amd64 library implementing brotli encoder and decoder (shared libraries)
ii libbsd0:amd64 0.12.1-1build1.1 amd64 utility functions from BSD systems - shared library
ii libbz2-1.0:amd64 1.0.8-5.1build0.1 amd64 high-quality block-sorting file compressor library - runtime
ii libbzip3-0:amd64 1.4.0-1 amd64 better, faster and stronger spiritual successor to bzip2 - runtime
ii libc-bin 2.39-0ubuntu8.6 amd64 GNU C Library: Binaries
ii libc-dev-bin 2.39-0ubuntu8.6 amd64 GNU C Library: Development binaries
ii libc6-dbg:amd64 2.39-0ubuntu8.6 amd64 GNU C Library: detached debugging symbols
ii libc6-dev-i386 2.39-0ubuntu8.6 amd64 GNU C Library: 32-bit development libraries for AMD64
ii libc6-dev-riscv64-cross 2.39-0ubuntu8cross1 all GNU C Library: Development Libraries and Header Files (for cross-compiling)
ii libc6-dev-x32 2.39-0ubuntu8.6 amd64 GNU C Library: X32 ABI Development Libraries for AMD64
ii libc6-dev:amd64 2.39-0ubuntu8.6 amd64 GNU C Library: Development Libraries and Header Files
ii libc6-i386 2.39-0ubuntu8.6 amd64 GNU C Library: 32-bit shared libraries for AMD64
ii libc6-riscv64-cross 2.39-0ubuntu8cross1 all GNU C Library: Shared libraries (for cross-compiling)
ii libc6-x32 2.39-0ubuntu8.6 amd64 GNU C Library: X32 ABI Shared libraries for AMD64
ii libc6:amd64 2.39-0ubuntu8.6 amd64 GNU C Library: Shared libraries
ii libc6:i386 2.39-0ubuntu8.6 i386 GNU C Library: Shared libraries
ii libcap-ng0:amd64 0.8.4-2build2 amd64 alternate POSIX capabilities library
ii libcap2:amd64 1:2.66-5ubuntu2.2 amd64 POSIX 1003.1e capabilities (library)
ii libcares2:amd64 1.27.0-1.0ubuntu1 amd64 asynchronous name resolver
ii libcc1-0:amd64 14.2.0-4ubuntu2~24.04 amd64 GCC cc1 plugin for GDB
ii libcom-err2:amd64 1.47.0-2.4~exp1ubuntu4.1 amd64 common error description library
ii libcrypt-dev:amd64 1:4.4.36-4build1 amd64 libcrypt development files
ii libcrypt1:amd64 1:4.4.36-4build1 amd64 libcrypt shared library
ii libctf-nobfd0:amd64 2.42-4ubuntu2.6 amd64 Compact C Type Format library (runtime, no BFD dependency)
ii libctf0:amd64 2.42-4ubuntu2.6 amd64 Compact C Type Format library (runtime, BFD dependency)
ii libcurl3t64-gnutls:amd64 8.5.0-2ubuntu10.6 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour)
ii libcurl4t64:amd64 8.5.0-2ubuntu10.6 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour)
ii libdb5.3t64:amd64 5.3.28+dfsg2-7 amd64 Berkeley v5.3 Database Libraries [runtime]
ii libdebconfclient0:amd64 0.271ubuntu3 amd64 Debian Configuration Management System (C-implementation library)
ii libdebuginfod-common 0.190-1.1ubuntu0.1 all configuration to enable the Debian debug info server
ii libdebuginfod1t64:amd64 0.190-1.1ubuntu0.1 amd64 library to interact with debuginfod (development files)
ii libdw1t64:amd64 0.190-1.1ubuntu0.1 amd64 library that provides access to the DWARF debug information
ii libelf1t64:amd64 0.190-1.1ubuntu0.1 amd64 library to read and write ELF files
ii liberror-perl 0.17029-2 all Perl module for error/exception handling in an OO-ish way
ii libexpat1:amd64 2.6.1-2ubuntu0.3 amd64 XML parsing C library - runtime library
ii libext2fs2t64:amd64 1.47.0-2.4~exp1ubuntu4.1 amd64 ext2/ext3/ext4 file system libraries
ii libffi8:amd64 3.4.6-1build1 amd64 Foreign Function Interface library runtime
ii libgcc-13-dev-riscv64-cross 13.3.0-6ubuntu2~24.04cross1 all GCC support library (development files)
ii libgcc-13-dev:amd64 13.3.0-6ubuntu2~24.04 amd64 GCC support library (development files)
ii libgcc-s1-riscv64-cross 14.2.0-4ubuntu2~24.04cross1 all GCC support library (riscv64)
ii libgcc-s1:amd64 14.2.0-4ubuntu2~24.04 amd64 GCC support library
ii libgcc-s1:i386 14.2.0-4ubuntu2~24.04 i386 GCC support library
ii libgcrypt20:amd64 1.10.3-2build1 amd64 LGPL Crypto library - runtime library
ii libgdbm-compat4t64:amd64 1.23-5.1build1 amd64 GNU dbm database routines (legacy support runtime version)
ii libgdbm6t64:amd64 1.23-5.1build1 amd64 GNU dbm database routines (runtime version)
ii libgit2-1.7:amd64 1.7.2+ds-1ubuntu3 amd64 low-level Git library
ii libglib2.0-0t64:amd64 2.80.0-6ubuntu3.4 amd64 GLib library of C routines
ii libgmp10:amd64 2:6.3.0+dfsg-2ubuntu6.1 amd64 Multiprecision arithmetic library
ii libgnutls30t64:amd64 3.8.3-1.1ubuntu3.4 amd64 GNU TLS library - main runtime library
ii libgomp1-riscv64-cross 14.2.0-4ubuntu2~24.04cross1 all GCC OpenMP (GOMP) support library
ii libgomp1:amd64 14.2.0-4ubuntu2~24.04 amd64 GCC OpenMP (GOMP) support library
ii libgpg-error0:amd64 1.47-3build2.1 amd64 GnuPG development runtime library
ii libgprofng0:amd64 2.42-4ubuntu2.6 amd64 GNU Next Generation profiler (runtime library)
ii libgssapi-krb5-2:amd64 1.20.1-6ubuntu2.6 amd64 MIT Kerberos runtime libraries - krb5 GSS-API Mechanism
ii libhiredis1.1.0:amd64 1.2.0-6ubuntu3 amd64 minimalistic C client library for Redis
ii libhogweed6t64:amd64 3.9.1-2.2build1.1 amd64 low level cryptographic library (public-key cryptos)
ii libhttp-parser2.9:amd64 2.9.4-6build1 amd64 parser for HTTP messages written in C
ii libhwasan0:amd64 14.2.0-4ubuntu2~24.04 amd64 AddressSanitizer -- a fast memory error detector
ii libicu74:amd64 74.2-1ubuntu3.1 amd64 International Components for Unicode
ii libidn2-0:amd64 2.3.7-2build1.1 amd64 Internationalized domain names (IDNA2008/TR46) library
ii libio-pty-perl 1:1.20-1build2 amd64 Perl module for pseudo tty IO
ii libipc-run-perl 20231003.0-1 all Perl module for running processes
ii libipt2 2.0.6-1build1 amd64 Intel Processor Trace Decoder Library
ii libisl23:amd64 0.26-3build1.1 amd64 manipulating sets and relations of integer points bounded by linear constraints
ii libitm1-riscv64-cross 14.2.0-4ubuntu2~24.04cross1 all GNU Transactional Memory Library
ii libitm1:amd64 14.2.0-4ubuntu2~24.04 amd64 GNU Transactional Memory Library
ii libjansson4:amd64 2.14-2build2 amd64 C library for encoding, decoding and manipulating JSON data
ii libjq1:amd64 1.7.1-3ubuntu0.24.04.1 amd64 lightweight and flexible command-line JSON processor - shared library
ii libjsoncpp25:amd64 1.9.5-6build1 amd64 library for reading and writing JSON for C++
ii libk5crypto3:amd64 1.20.1-6ubuntu2.6 amd64 MIT Kerberos runtime libraries - Crypto Library
ii libkeyutils1:amd64 1.6.3-3build1 amd64 Linux Key Management Utilities (library)
ii libkrb5-3:amd64 1.20.1-6ubuntu2.6 amd64 MIT Kerberos runtime libraries
ii libkrb5support0:amd64 1.20.1-6ubuntu2.6 amd64 MIT Kerberos runtime libraries - Support library
ii libldap2:amd64 2.6.7+dfsg-1~exp1ubuntu8.2 amd64 OpenLDAP libraries
ii liblsan0:amd64 14.2.0-4ubuntu2~24.04 amd64 LeakSanitizer -- a memory leak detector (runtime)
ii libluajit-5.1-2:amd64 2.1.0+git20231223.c525bcb+dfsg-1 amd64 Just in time compiler for Lua - library version
ii libluajit-5.1-common 2.1.0+git20231223.c525bcb+dfsg-1 all Just in time compiler for Lua - common files
ii liblz4-1:amd64 1.9.4-1build1.1 amd64 Fast LZ compression algorithm library - runtime
ii liblzma5:amd64 5.6.1+really5.4.5-1ubuntu0.2 amd64 XZ-format compression library
ii liblzo2-2:amd64 2.10-2build4 amd64 data compression library
ii libmagic-mgc 1:5.45-3build1 amd64 File type determination library using "magic" numbers (compiled magic file)
ii libmagic1t64:amd64 1:5.45-3build1 amd64 Recognize the type of data in a file using "magic" numbers - library
ii libmd0:amd64 1.1.0-2build1.1 amd64 message digest functions from BSD systems - shared library
ii libmount1:amd64 2.39.3-9ubuntu6.3 amd64 device mounting library
ii libmpc3:amd64 1.3.1-1build1.1 amd64 multiple precision complex floating-point library
ii libmpfr6:amd64 4.2.1-1build1.1 amd64 multiple precision floating-point computation
ii libmsgpackc2:amd64 4.0.0-3build1 amd64 binary-based efficient object serialization library
ii libmspack0t64:amd64 0.11-1.1build1 amd64 library for Microsoft compression formats (shared library)
ii libncurses6:amd64 6.4+20240113-1ubuntu2 amd64 shared libraries for terminal handling
ii libncursesw6:amd64 6.4+20240113-1ubuntu2 amd64 shared libraries for terminal handling (wide character support)
ii libnettle8t64:amd64 3.9.1-2.2build1.1 amd64 low level cryptographic library (symmetric and one-way cryptos)
ii libnghttp2-14:amd64 1.59.0-1ubuntu0.2 amd64 library implementing HTTP/2 protocol (shared library)
ii libnl-3-200:amd64 3.7.0-0.3build1.1 amd64 library for dealing with netlink sockets
ii libnl-genl-3-200:amd64 3.7.0-0.3build1.1 amd64 library for dealing with netlink sockets - generic netlink
ii libnpth0t64:amd64 1.6-3.1build1 amd64 replacement for GNU Pth using system threads
ii libonig5:amd64 6.9.9-1build1 amd64 regular expressions library
ii libp11-kit0:amd64 0.25.3-4ubuntu2.1 amd64 library for loading and coordinating access to PKCS#11 modules - runtime
ii libpam-modules-bin 1.5.3-5ubuntu5.5 amd64 Pluggable Authentication Modules for PAM - helper binaries
ii libpam-modules:amd64 1.5.3-5ubuntu5.5 amd64 Pluggable Authentication Modules for PAM
ii libpam-runtime 1.5.3-5ubuntu5.5 all Runtime support for the PAM library
ii libpam0g:amd64 1.5.3-5ubuntu5.5 amd64 Pluggable Authentication Modules library
ii libpcre2-32-0:amd64 10.42-4ubuntu2.1 amd64 New Perl Compatible Regular Expression Library - 32 bit runtime files
ii libpcre2-8-0:amd64 10.42-4ubuntu2.1 amd64 New Perl Compatible Regular Expression Library- 8 bit runtime files
ii libperl5.38t64:amd64 5.38.2-3.2ubuntu0.2 amd64 shared Perl library
ii libpipeline1:amd64 1.5.7-2 amd64 Unix process pipeline manipulation library
ii libpopt0:amd64 1.19+dfsg-1build1 amd64 lib for parsing cmdline parameters
ii libproc2-0:amd64 2:4.0.4-4ubuntu3.2 amd64 library for accessing process information from /proc
ii libpsl5t64:amd64 0.21.2-1.1build1 amd64 Library for Public Suffix List (shared libraries)
ii libpython2.7-minimal:amd64 2.7.18-8+deb11u1 amd64 Minimal subset of the Python language (version 2.7)
ii libpython3-stdlib:amd64 3.12.3-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version)
ii libpython3.12-minimal:amd64 3.12.3-1ubuntu0.8 amd64 Minimal subset of the Python language (version 3.12)
ii libpython3.12-stdlib:amd64 3.12.3-1ubuntu0.8 amd64 Interactive high-level object-oriented language (standard library, version 3.12)
ii libpython3.12t64:amd64 3.12.3-1ubuntu0.8 amd64 Shared Python runtime library (version 3.12)
ii libquadmath0:amd64 14.2.0-4ubuntu2~24.04 amd64 GCC Quad-Precision Math Library
ii libreadline8t64:amd64 8.2-4build1 amd64 GNU readline and history libraries, run-time libraries
ii librhash0:amd64 1.4.3-3build1 amd64 shared library for hash functions computing
ii librtmp1:amd64 2.4+20151223.gitfa8646d.1-2build7 amd64 toolkit for RTMP streams (shared library)
ii libsasl2-2:amd64 2.1.28+dfsg1-5ubuntu3.1 amd64 Cyrus SASL - authentication abstraction library
ii libsasl2-modules-db:amd64 2.1.28+dfsg1-5ubuntu3.1 amd64 Cyrus SASL - pluggable authentication modules (DB)
ii libseccomp2:amd64 2.5.5-1ubuntu3.1 amd64 high level interface to Linux seccomp filter
ii libselinux1:amd64 3.5-2ubuntu2.1 amd64 SELinux runtime shared libraries
ii libsemanage-common 3.5-1build5 all Common files for SELinux policy management libraries
ii libsemanage2:amd64 3.5-1build5 amd64 SELinux policy management library
ii libsensors-config 1:3.6.0-9build1 all lm-sensors configuration files
ii libsensors5:amd64 1:3.6.0-9build1 amd64 library to read temperature/voltage/fan sensors
ii libsepol2:amd64 3.5-2build1 amd64 SELinux library for manipulating binary security policies
ii libsframe1:amd64 2.42-4ubuntu2.6 amd64 Library to handle the SFrame format (runtime library)
ii libsigsegv2:amd64 2.14-1ubuntu2 amd64 Library for handling page faults in a portable way
ii libsmartcols1:amd64 2.39.3-9ubuntu6.3 amd64 smart column output alignment library
ii libsource-highlight-common 3.1.9-4.3build1 all architecture-independent files for source highlighting library
ii libsource-highlight4t64:amd64 3.1.9-4.3build1 amd64 source highlighting library
ii libsqlite3-0:amd64 3.45.1-1ubuntu2.5 amd64 SQLite 3 shared library
ii libss2:amd64 1.47.0-2.4~exp1ubuntu4.1 amd64 command-line interface parsing library
ii libssh-4:amd64 0.10.6-2ubuntu0.2 amd64 tiny C SSH library (OpenSSL flavor)
ii libssh2-1t64:amd64 1.11.0-4.1build2 amd64 SSH2 client-side library
ii libssl3t64:amd64 3.0.13-0ubuntu3.6 amd64 Secure Sockets Layer toolkit - shared libraries
ii libstdc++-13-dev:amd64 13.3.0-6ubuntu2~24.04 amd64 GNU Standard C++ Library v3 (development files)
ii libstdc++6-riscv64-cross 14.2.0-4ubuntu2~24.04cross1 all GNU Standard C++ Library v3 (riscv64)
ii libstdc++6:amd64 14.2.0-4ubuntu2~24.04 amd64 GNU Standard C++ Library v3
ii libsystemd0:amd64 255.4-1ubuntu8.11 amd64 systemd utility library
ii libtalloc2:amd64 2.4.2-1build2 amd64 hierarchical pool based memory allocator
ii libtasn1-6:amd64 4.19.0-3ubuntu0.24.04.1 amd64 Manage ASN.1 structures (runtime)
ii libtermkey1:amd64 0.22-1 amd64 library for processing keyboard input
ii libtime-duration-perl 1.21-2 all module for rounded or exact English expression of durations
ii libtimedate-perl 2.3300-2 all collection of modules to manipulate date/time information
ii libtinfo6:amd64 6.4+20240113-1ubuntu2 amd64 shared low-level terminfo library for terminal handling
ii libtree-sitter0:amd64 0.20.8-2 amd64 incremental parsing system for programming tools
ii libtsan2:amd64 14.2.0-4ubuntu2~24.04 amd64 ThreadSanitizer -- a Valgrind-based detector of data races (runtime)
ii libubsan1-riscv64-cross 14.2.0-4ubuntu2~24.04cross1 all UBSan -- undefined behaviour sanitizer (runtime)
ii libubsan1:amd64 14.2.0-4ubuntu2~24.04 amd64 UBSan -- undefined behaviour sanitizer (runtime)
ii libuchardet0:amd64 0.0.8-1build1 amd64 universal charset detection library - shared library
ii libudev1:amd64 255.4-1ubuntu8.11 amd64 libudev shared library
ii libunibilium4:amd64 2.1.0-3 amd64 simple, self-contained terminfo library
ii libunistring5:amd64 1.1-2build1.1 amd64 Unicode string library for C
ii libunwind8:amd64 1.6.2-3build1.1 amd64 library to determine the call-chain of a program - runtime
ii liburing2:amd64 2.5-1build1 amd64 Linux kernel io_uring access library - shared library
ii libutempter0:amd64 1.2.1-3build1 amd64 privileged helper for utmp/wtmp updates (runtime)
ii libuuid1:amd64 2.39.3-9ubuntu6.3 amd64 Universally Unique ID library
ii libuv1t64:amd64 1.48.0-1.1build1 amd64 asynchronous event notification library - runtime library
ii libvterm0:amd64 0.3.3-2build1 amd64 abstract terminal library
ii libwrap0:amd64 7.6.q-33 amd64 Wietse Venema's TCP wrappers library
ii libx11-6:amd64 2:1.8.7-1build1 amd64 X11 client-side library
ii libx11-data 2:1.8.7-1build1 all X11 client-side library
ii libx32asan8 14.2.0-4ubuntu2~24.04 amd64 AddressSanitizer -- a fast memory error detector (x32)
ii libx32atomic1 14.2.0-4ubuntu2~24.04 amd64 support library providing __atomic built-in functions (x32)
ii libx32gcc-13-dev 13.3.0-6ubuntu2~24.04 amd64 GCC support library (x32 development files)
ii libx32gcc-s1 14.2.0-4ubuntu2~24.04 amd64 GCC support library (x32)
ii libx32gomp1 14.2.0-4ubuntu2~24.04 amd64 GCC OpenMP (GOMP) support library (x32)
ii libx32itm1 14.2.0-4ubuntu2~24.04 amd64 GNU Transactional Memory Library (x32)
ii libx32quadmath0 14.2.0-4ubuntu2~24.04 amd64 GCC Quad-Precision Math Library (x32)
ii libx32stdc++-13-dev 13.3.0-6ubuntu2~24.04 amd64 GNU Standard C++ Library v3 (development files)
ii libx32stdc++6 14.2.0-4ubuntu2~24.04 amd64 GNU Standard C++ Library v3 (x32)
ii libx32ubsan1 14.2.0-4ubuntu2~24.04 amd64 UBSan -- undefined behaviour sanitizer (x32)
ii libxau6:amd64 1:1.0.9-1build6 amd64 X11 authorisation library
ii libxcb1:amd64 1.15-1ubuntu2 amd64 X C Binding
ii libxdmcp6:amd64 1:1.1.3-0ubuntu6 amd64 X11 Display Manager Control Protocol library
ii libxml2:amd64 2.9.14+dfsg-1.3ubuntu3.6 amd64 GNOME XML library
ii libxxhash0:amd64 0.8.2-2build1 amd64 shared library for xxhash
ii libyaml-0-2:amd64 0.2.5-1build1 amd64 Fast YAML 1.1 parser and emitter library
ii libzstd-dev:amd64 1.5.5+dfsg2-2build1.1 amd64 fast lossless compression algorithm -- development files
ii libzstd1:amd64 1.5.5+dfsg2-2build1.1 amd64 fast lossless compression algorithm
ii linux-libc-dev-riscv64-cross 6.8.0-25.25cross1 all Linux Kernel Headers for development (for cross-compiling)
ii linux-libc-dev:amd64 6.8.0-87.88 amd64 Linux Kernel Headers for development
ii login 1:4.13+dfsg1-4ubuntu3.2 amd64 system login tools
ii logsave 1.47.0-2.4~exp1ubuntu4.1 amd64 save the output of a command in a log file
ii lsb-release 12.0-2 all Linux Standard Base version reporting utility (minimal implementation)
ii lsd 1.0.0-2 amd64 ls command with a lot of pretty colors and some other stuff
ii lua-luv:amd64 1.48.0-2-2build1 amd64 libuv bindings for Lua
ii lz4 1.9.4-1build1.1 amd64 Fast LZ compression algorithm library - tool
ii lzip 1.24.1-1build1 amd64 lossless data compressor based on the LZMA algorithm
ii lzop 1.04-2build3 amd64 fast compression program
ii make 4.3-4.1build2 amd64 utility for directing compilation
ii man-db 2.12.0-4build2 amd64 tools for reading manual pages
ii mawk 1.3.4.20240123-1build1 amd64 Pattern scanning and text processing language
ii media-types 10.1.0 all List of standard media types and their usual file extension
ii minify 2.20.17-1 amd64 CLI implementation of the Go minify library package
ii mksh 59c-37 amd64 MirBSD Korn Shell
ii moreutils 0.69-1 amd64 additional Unix utilities
ii mount 2.39.3-9ubuntu6.3 amd64 tools for mounting and manipulating filesystems
ii musl:amd64 1.2.4-2 amd64 standard C library
ii ncurses-base 6.4+20240113-1ubuntu2 all basic terminal type definitions
ii ncurses-bin 6.4+20240113-1ubuntu2 amd64 terminal-related programs and man pages
ii ncurses-term 6.4+20240113-1ubuntu2 all additional terminal type definitions
ii neovim 0.9.5-6ubuntu2 amd64 heavily refactored vim fork
ii neovim-runtime 0.9.5-6ubuntu2 all heavily refactored vim fork (runtime files)
ii netbase 6.4 all Basic TCP/IP networking system
ii ninja-build 1.11.1-2 amd64 small build system closest in spirit to Make
ii openssl 3.0.13-0ubuntu3.6 amd64 Secure Sockets Layer toolkit - cryptographic utility
ii p7zip 16.02+transitional.1 all transitional package
ii parallel 20231122+ds-1 all build and execute command lines from standard input in parallel
ii passwd 1:4.13+dfsg1-4ubuntu3.2 amd64 change and administer password and group data
ii patch 2.7.6-7build3 amd64 Apply a diff file to an original
ii patchelf 0.18.0-1.1build1 amd64 modify properties of ELF executables
ii patchutils 0.4.2-1build3 amd64 Utilities to work with patches
ii pax-utils 1.3.7-1 amd64 Security-focused ELF files checking tool
ii perl 5.38.2-3.2ubuntu0.2 amd64 Larry Wall's Practical Extraction and Report Language
ii perl-base 5.38.2-3.2ubuntu0.2 amd64 minimal Perl system
ii perl-modules-5.38 5.38.2-3.2ubuntu0.2 all Core Perl modules
ii procps 2:4.0.4-4ubuntu3.2 amd64 /proc file system utilities
ii proot 5.1.0-1.3 amd64 emulate chroot, bind mount and binfmt_misc for non-root users
ii python2.7-minimal 2.7.18-8+deb11u1 amd64 Minimal subset of the Python language (version 2.7)
ii python3 3.12.3-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version)
ii python3-argcomplete 3.1.4-1ubuntu0.1 all bash tab completion for argparse (for Python 3)
ii python3-minimal 3.12.3-0ubuntu2 amd64 minimal subset of the Python language (default python3 version)
ii python3-pyasn1 0.4.8-4 all ASN.1 library for Python (Python 3 module)
ii python3-pycryptodome 3.20.0+dfsg-1 amd64 cryptographic Python library (Python 3)
ii python3-pycurl 7.45.3-1build2 amd64 Python bindings to libcurl (Python 3)
ii python3-pyelftools 0.30-1 all pure-python3 library for parsing ELF and DWARF
ii python3-toml 0.10.2-1 all library for Tom's Obvious, Minimal Language - Python 3.x
ii python3-tomli 2.0.1-2 all lil' TOML parser for Python
ii python3-tomli-w 1.0.0-2 all lil' TOML writer for Python
ii python3-xmltodict 0.13.0-1ubuntu0.24.04.1 all Makes working with XML feel like you are working with JSON (Python 3)
ii python3-yaml 6.0.1-2build2 amd64 YAML parser and emitter for Python3
ii python3-zstd 1.5.5.1-1build1 amd64 python bindings to Yann Collet ZSTD compression library
ii python3.12 3.12.3-1ubuntu0.8 amd64 Interactive high-level object-oriented language (version 3.12)
ii python3.12-minimal 3.12.3-1ubuntu0.8 amd64 Minimal subset of the Python language (version 3.12)
ii re2c 3.1-1build1 amd64 lexer generator for C, C++, Go and Rust
ii readline-common 8.2-4build1 all GNU readline and history libraries, common files
ii ripgrep 14.1.0-1 amd64 Recursively searches directories for a regex pattern
ii rpcsvc-proto 1.4.2-0ubuntu7 amd64 RPC protocol compiler and definitions
ii rsync 3.2.7-1ubuntu1.2 amd64 fast, versatile, remote (and local) file-copying tool
ii screen 4.9.1-1build1 amd64 terminal multiplexer with VT100/ANSI terminal emulation
ii sed 4.9-2build1 amd64 GNU stream editor for filtering/transforming text
ii sensible-utils 0.0.22 all Utilities for sensible alternative selection
ii socat 1.8.0.0-4build3 amd64 multipurpose relay for bidirectional data transfer
ii strace 6.8-0ubuntu2 amd64 System call tracer
ii sudo 1.9.15p5-3ubuntu5.24.04.1 amd64 Provide limited super user privileges to specific users
ii sysstat 12.6.1-2 amd64 system performance tools for Linux
ii sysvinit-utils 3.08-6ubuntu3 amd64 System-V-like utilities
ii tar 1.35+dfsg-3build1 amd64 GNU version of the tar archiving utility
ii time 1.9-0.2build1 amd64 GNU time program for measuring CPU resource usage
ii tzdata 2025b-0ubuntu0.24.04.1 all time zone and daylight-saving time data
ii ubuntu-keyring 2023.11.28.1 all GnuPG keys of the Ubuntu archive
ii ucf 3.0043+nmu1 all Update Configuration File(s): preserve user changes to config files
ii universal-ctags 5.9.20210829.0-1 amd64 build tag file indexes of source code definitions
ii unminimize 0.2.1 amd64 Un-minimize your minimial images or setup
ii unzip 6.0-28ubuntu4.1 amd64 De-archiver for .zip files
ii util-linux 2.39.3-9ubuntu6.3 amd64 miscellaneous system utilities
ii valgrind 1:3.22.0-0ubuntu3 amd64 instrumentation framework for building dynamic analysis tools
ii wget 1.21.4-1ubuntu4.1 amd64 retrieves files from the web
ii xz-utils 5.6.1+really5.4.5-1ubuntu0.2 amd64 XZ-format compression utilities
ii yash 2.55-2 amd64 yet another shell
ii yq 3.1.0-3 all Command-line YAML processor - jq wrapper for YAML documents
ii zip 3.0-13ubuntu0.2 amd64 Archiver for .zip files
ii zlib1g-dev:amd64 1:1.3.dfsg-3.1ubuntu2.1 amd64 compression library - development
ii zlib1g:amd64 1:1.3.dfsg-3.1ubuntu2.1 amd64 compression library - runtime
ii zlib1g:i386 1:1.3.dfsg-3.1ubuntu2.1 i386 compression library - runtime
ii zoxide 0.9.3-1 amd64 Smarter cd command for your terminal
ii zsh 5.9-6ubuntu2 amd64 shell with lots of features
ii zsh-common 5.9-6ubuntu2 all architecture independent files for Zsh
ii zstd 1.5.5+dfsg2-2build1.1 amd64 fast lossless compression algorithm -- CLI tool
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
Packages sorted by Installed-Size:
1156978 ===== TOTAL (390 packages)
76943 valgrind amd64
61804 gcc-13-riscv64-linux-gnu amd64
61333 gcc-13-x86-64-linux-gnu amd64
44381 gh amd64
36493 cmake amd64
35919 libicu74 amd64
33545 g++-13-x86-64-linux-gnu amd64
30811 cpp-13-x86-64-linux-gnu amd64
29774 cpp-13-riscv64-linux-gnu amd64
29333 libperl5.38t64 amd64
21815 neovim-runtime all
21692 git amd64
21662 libstdc++-13-dev amd64
19159 perl-modules-5.38 all
18028 libgcc-13-dev-riscv64-cross all
16248 zsh-common all
16082 libgcc-13-dev amd64
13431 libc6 amd64
13112 libc6-dev amd64
12519 gdb amd64
12321 fish-common all
12297 libc6 i386
12004 libc6-x32 amd64
11989 libc6-i386 amd64
11549 binutils-x86-64-linux-gnu amd64
11179 libc6-dbg amd64
10984 cmake-data all
10791 libasan8 amd64
9704 libx32asan8 amd64
9539 lib32asan8 amd64
9420 binutils-riscv64-linux-gnu amd64
9023 libpython3.12-stdlib amd64
8924 libpython3.12t64 amd64
8902 libtsan2 amd64
8335 libmagic-mgc amd64
8296 lib32gcc-13-dev amd64
8119 libc6-dev-x32 amd64
7927 python3.12-minimal amd64
7913 perl-base amd64
7531 libx32gcc-13-dev amd64
7493 linux-libc-dev amd64
7226 lib32stdc++-13-dev amd64
7059 libx32stdc++-13-dev amd64
7025 linux-libc-dev-riscv64-cross all
7024 direnv amd64
6947 libc6-dev-i386 amd64
6944 coreutils amd64
6775 neovim amd64
6608 libssl3t64 amd64
6237 dpkg amd64
6158 7zip amd64
5219 bat amd64
5210 ripgrep amd64
5181 libpython3.12-minimal amd64
4897 libhwasan0 amd64
4341 ncurses-term all
4244 minify amd64
4193 libglib2.0-0t64 amd64
4108 apt amd64
4074 gojq amd64
3956 python3-pycryptodome amd64
3833 libgprofng0 amd64
3828 liblsan0 amd64
3738 fzf amd64
3721 groff-base amd64
3605 python2.7-minimal amd64
3568 just amd64
3468 sudo amd64
3443 fish amd64
3441 re2c amd64
3438 util-linux amd64
3408 lsd amd64
3403 libaria2-0 amd64
3382 fd-find amd64
3364 libubsan1 amd64
3249 libapt-pkg6.0t64 amd64
3181 libx32ubsan1 amd64
3181 libstdc++6-riscv64-cross all
3111 ksh93u+m amd64
3110 libstdc++6 amd64
3104 lib32ubsan1 amd64
2995 parallel all
2958 elfutils amd64
2928 man-db amd64
2894 lib32stdc++6 amd64
2810 libx32stdc++6 amd64
2785 libpython2.7-minimal amd64
2642 libasan8-riscv64-cross all
2431 zsh amd64
2419 passwd amd64
2352 libgnutls30t64 amd64
2350 libbinutils amd64
2191 ht amd64
2183 libc-bin amd64
2162 git-man all
2103 strace amd64
2079 libxml2 amd64
2032 libisl23 amd64
2009 universal-ctags amd64
1980 aria2 amd64
1900 bash amd64
1885 openssl amd64
1848 lftp amd64
1802 zstd amd64
1800 procps amd64
1761 libdb5.3t64 amd64
1757 libunistring5 amd64
1736 gawk amd64
1731 libsqlite3-0 amd64
1712 libp11-kit0 amd64
1634 mksh amd64
1610 socat amd64
1582 btop amd64
1579 ccache amd64
1504 e2fsprogs amd64
1454 bash-completion all
1452 sysstat amd64
1448 yash amd64
1396 libgcrypt20 amd64
1387 tzdata all
1362 libx11-6 amd64
1342 libx11-data all
1322 zlib1g-dev amd64
1314 hyperfine amd64
1237 libzstd-dev amd64
1237 libgit2-1.7 amd64
1186 libmpfr6 amd64
1150 libpam-modules amd64
1142 eza amd64
1136 zoxide amd64
1026 libsystemd0 amd64
1015 libkrb5-3 amd64
996 screen amd64
925 libcurl4t64 amd64
916 wget amd64
906 libcurl3t64-gnutls amd64
905 libarchive13t64 amd64
884 login amd64
852 busybox amd64
851 libubsan1-riscv64-cross all
843 libbrotli1 amd64
812 lua-luv amd64
785 musl amd64
781 rsync amd64
766 libdw1t64 amd64
761 libzstd1 amd64
751 libsepol2 amd64
745 libsource-highlight4t64 amd64
737 python3.12 amd64
732 xz-utils amd64
708 tar amd64
672 perl amd64
647 ncurses-bin amd64
635 libpcre2-8-0 amd64
629 libonig5 amd64
624 python3-pyelftools all
614 lib32quadmath0 amd64
602 libluajit-5.1-2 amd64
564 binutils-common amd64
556 libtinfo6 amd64
554 libpcre2-32-0 amd64
553 gcc-13 amd64
552 findutils amd64
543 libgmp10 amd64
540 libldap2 amd64
538 libext2fs2t64 amd64
536 zip amd64
521 curl amd64
512 python3-yaml amd64
508 libbabeltrace1 amd64
497 libssh-4 amd64
493 debconf all
467 libreadline8t64 amd64
452 diffutils amd64
426 libgssapi-krb5-2 amd64
426 base-files amd64
424 libnettle8t64 amd64
424 htop amd64
422 libncursesw6 amd64
415 libssh2-1t64 amd64
404 make amd64
389 python3-pyasn1 all
388 libexpat1 amd64
386 ca-certificates all
384 ncurses-base all
379 liblzma5 amd64
375 unzip amd64
373 libgomp1 amd64
367 libmount1 amd64
362 libgomp1-riscv64-cross all
358 libjq1 amd64
357 bfs amd64
355 ninja-build amd64
351 libx32gomp1 amd64
348 mount amd64
346 lib32gomp1 amd64
344 libcrypt-dev amd64
344 grep amd64
340 sed amd64
337 libhogweed6t64 amd64
337 gpgv amd64
336 libncurses6 amd64
328 cpio amd64
315 libudev1 amd64
311 libx32quadmath0 amd64
309 less amd64
307 libctf-nobfd0 amd64
305 libsource-highlight-common all
300 libquadmath0 amd64
289 libblkid1 amd64
288 libsemanage2 amd64
288 bsdutils amd64
287 bsdextrautils amd64
276 libpam-runtime all
273 patchelf amd64
273 mawk amd64
270 pax-utils amd64
270 libpam-modules-bin amd64
264 libuv1t64 amd64
258 libk5crypto3 amd64
255 libipc-run-perl all
254 base-passwd amd64
245 rpcsvc-proto amd64
244 gzip amd64
237 libjsoncpp25 amd64
235 libproc2-0 amd64
235 libgcc-s1 i386
232 lz4 amd64
232 libctf0 amd64
231 moreutils amd64
230 librhash0 amd64
228 dmidecode amd64
226 libcrypt1 amd64
224 libidn2-0 amd64
224 debianutils amd64
223 lib32gcc-s1 amd64
218 patch amd64
218 libluajit-5.1-common all
215 patchutils amd64
214 ucf all
211 libmagic1t64 amd64
209 libpam0g amd64
207 libuchardet0 amd64
206 proot amd64
204 libelf1t64 amd64
202 python3-pycurl amd64
200 libselinux1 amd64
200 libnghttp2-14 amd64
199 execstack amd64
198 libtree-sitter0 amd64
197 libgcc-s1 amd64
196 libxcb1 amd64
188 libx32gcc-s1 amd64
187 libunwind8 amd64
187 dash amd64
185 libgpg-error0 amd64
176 libcares2 amd64
172 libnl-3-200 amd64
171 libsmartcols1 amd64
163 zlib1g amd64
163 lzip amd64
160 binutils amd64
158 zlib1g i386
157 lzop amd64
157 liblzo2-2 amd64
155 liblz4-1 amd64
151 libaudit1 amd64
150 python3-argcomplete all
149 libmpc3 amd64
149 libitm1-riscv64-cross all
148 libsasl2-2 amd64
148 libcc1-0 amd64
143 libyaml-0-2 amd64
143 libseccomp2 amd64
137 librtmp1 amd64
136 libhiredis1.1.0 amd64
133 libkrb5support0 amd64
133 libgcc-s1-riscv64-cross all
131 libipt2 amd64
130 init-system-helpers all
130 bubblewrap amd64
127 libsframe1 amd64
127 libbsd0 amd64
126 time amd64
123 libtimedate-perl all
122 libtasn1-6 amd64
120 libpopt0 amd64
115 libitm1 amd64
115 libapparmor1 amd64
113 gcc-13-riscv64-linux-gnu-base amd64
113 gcc-13-base amd64
112 jq amd64
112 gcc-14-base i386
112 gcc-14-base amd64
111 python3-minimal amd64
109 libx32itm1 amd64
109 bzip2 amd64
107 sysvinit-utils amd64
107 libwrap0 amd64
106 libc-dev-bin amd64
106 gcc-13-cross-base all
105 lib32itm1 amd64
105 gcc-14-cross-base all
103 libio-pty-perl amd64
100 libassuan0 amd64
99 libpsl5t64 amd64
98 libmspack0t64 amd64
98 libcap2 amd64
96 liburing2 amd64
95 libunibilium4 amd64
95 libjansson4 amd64
95 libbz2-1.0 amd64
93 media-types all
93 libvterm0 amd64
93 libgdbm6t64 amd64
90 libxxhash0 amd64
84 libuuid1 amd64
83 libtalloc2 amd64
82 cabextract amd64
81 python3 amd64
81 libbzip3-0 amd64
79 libsensors5 amd64
79 libmd0 amd64
77 readline-common all
77 python3-toml all
75 libsasl2-modules-db amd64
75 libasm1t64 amd64
74 libacl1 amd64
72 libffi8 amd64
72 diffstat amd64
70 libdebuginfod1t64 amd64
69 yq all
69 libss2 amd64
69 liberror-perl all
67 libpipeline1 amd64
66 libhttp-parser2.9 amd64
66 bzip3 amd64
63 sensible-utils all
63 libtermkey1 amd64
63 file amd64
61 ksh all
60 python3-tomli all
60 libcap-ng0 amd64
60 libattr1 amd64
57 libcom-err2 amd64
53 libnl-genl-3-200 amd64
51 logsave amd64
51 libutempter0 amd64
51 libdebuginfod-common all
49 python3-xmltodict all
49 libatomic1 amd64
48 libmsgpackc2 amd64
47 libx32atomic1 amd64
47 libsigsegv2 amd64
46 hostname amd64
44 python3-zstd amd64
42 libnpth0t64 amd64
41 libxdmcp6 amd64
41 libkeyutils1 amd64
40 libatomic1-riscv64-cross all
39 lib32atomic1 amd64
38 libdebconfclient0 amd64
37 gcc amd64
37 cpp amd64
36 netbase all
36 chrpath amd64
34 libtime-duration-perl all
34 libgdbm-compat4t64 amd64
33 libxau6 amd64
31 python3-tomli-w all
29 ubuntu-keyring all
29 g++-13 amd64
27 libpython3-stdlib amd64
26 libsemanage-common all
25 libsensors-config all
25 gcc-x86-64-linux-gnu amd64
25 gcc-riscv64-linux-gnu amd64
20 cpp-x86-64-linux-gnu amd64
20 cpp-riscv64-linux-gnu amd64
17 lsb-release all
17 libaudit-common all
16 unminimize amd64
13 g++ amd64
11 g++-x86-64-linux-gnu amd64
11 cpp-13 amd64
8 p7zip all
6 gcc-13-multilib amd64
6 g++-13-multilib amd64
0 libc6-riscv64-cross all
0 libc6-dev-riscv64-cross all
+39
View File
@@ -0,0 +1,39 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
[[ -z $1 ]] || cd "$1" || exit 1
find . \
-type d -name '.git' -prune -o \
-type d -name '.hg' -prune -o \
-type d -name 'build*' -prune -o \
-type d -name 'tmp*' -prune -o \
-type d -name 'vendor' -prune -o \
-type f -iname '*.bat' -prune -o \
-type f -iname '*.exe' -prune -o \
-type f -iname '*.o' -prune -o \
-type f -iname '*.obj' -prune -o \
-type f -iname '*.out' -prune -o \
-type f -iname '*.pdf' -prune -o \
-type f -iname '*.swp' -prune -o \
-type f -print0 | \
LC_ALL=C sort -z | xargs -0r perl -n -e '
#print("$ARGV\n");
if (m,[\x00\x01\x02\x7f\xfe\xff],) { print "ERROR: binary file detected $ARGV: $_"; exit(1); }
if (m,[\r\x1a],) { print "ERROR: DOS EOL detected $ARGV: $_"; exit(1); }
if (m,([ \t]+)$,) {
if ($ARGV =~ m,\.patch$,) { }
else { print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1); }
}
if (m,\t,) {
if ($ARGV =~ m,\.patch$,) { }
elsif ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { }
elsif ($ARGV =~ m,\.mk$,) { }
elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { }
elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { }
else { print "ERROR: hard TAB detected $ARGV: $_"; exit(1); }
}
' || exit 1
+33
View File
@@ -0,0 +1,33 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
[[ -z $1 ]] || cd "$1" || exit 1
[[ -d .git ]] || exit 1
git ls-files --full-name -z | perl -0 -n -e '
s,^,./,;
if (m,^\./src/lzma-sdk(\0|$),) { }
elsif (m,^\./vendor/,) { }
elsif (m,\.bat(\0|$),) { }
elsif (m,\.exe(\0|$),) { }
else { print; }
' | LC_ALL=C sort -z | xargs -0r perl -n -e '
#print("$ARGV\n");
if (m,[\x00\x01\x02\x7f\xfe\xff],) { print "ERROR: binary file detected $ARGV: $_"; exit(1); }
if (m,[\r\x1a],) { print "ERROR: DOS EOL detected $ARGV: $_"; exit(1); }
if (m,([ \t]+)$,) {
if ($ARGV =~ m,\.patch$,) { }
else { print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1); }
}
if (m,\t,) {
if ($ARGV =~ m,\.patch$,) { }
elsif ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { }
elsif ($ARGV =~ m,\.mk$,) { }
elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { }
elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { }
else { print "ERROR: hard TAB detected $ARGV: $_"; exit(1); }
}
' || exit 1
+17
View File
@@ -0,0 +1,17 @@
#! /usr/bin/env python3
## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*-
# simulate "readlink -en FILE"
# - result may differ from actual readlink(1) for edge cases
# - works with Python2 and Python3
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
import os, sys
if len(sys.argv) != 2:
sys.exit(1)
real_path = os.path.realpath(sys.argv[1])
if not os.path.exists(real_path):
sys.exit(1)
sys.stdout.write(real_path)
sys.stdout.flush()
+15
View File
@@ -0,0 +1,15 @@
#! /usr/bin/env python3
## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*-
# simulate "readlink -fn FILE" for systems that lack it (e.g. macOS-11)
# - result may differ from actual readlink(1) for edge cases
# - works with Python2 and Python3
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
import os, sys
if len(sys.argv) != 2:
sys.exit(1)
real_path = os.path.realpath(sys.argv[1])
sys.stdout.write(real_path)
sys.stdout.flush()
+42
View File
@@ -0,0 +1,42 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
# assemble cmake config flags; useful for CI jobs
# also see misc/make/Makefile-extra.mk
cmake_config_flags=()
# promote an environment variable to a CMake cache entry:
__add_cmake_config() {
[[ -z "${!1}" ]] || cmake_config_flags+=( -D$1="${!1}" )
}
# pass common CMake settings
for v in CMAKE_INSTALL_PREFIX CMAKE_VERBOSE_MAKEFILE; do
__add_cmake_config $v
done
# pass common CMake toolchain settings
for v in CMAKE_ADDR2LINE CMAKE_AR CMAKE_DLLTOOL CMAKE_LINKER CMAKE_NM CMAKE_OBJCOPY CMAKE_OBJDUMP CMAKE_RANLIB CMAKE_READELF CMAKE_STRIP CMAKE_TAPI; do
__add_cmake_config $v
done
# pass common CMake LTO toolchain settings
for v in CMAKE_C_COMPILER_AR CMAKE_C_COMPILER_RANLIB CMAKE_CXX_COMPILER_AR CMAKE_CXX_COMPILER_RANLIB; do
__add_cmake_config $v
done
# pass common CMake cross compilation settings
for v in CMAKE_SYSTEM_NAME CMAKE_SYSTEM_PROCESSOR CMAKE_CROSSCOMPILING_EMULATOR; do
__add_cmake_config $v
done
# pass UPX config options; see CMakeLists.txt
for v in UPX_CONFIG_DISABLE_GITREV UPX_CONFIG_DISABLE_SANITIZE UPX_CONFIG_DISABLE_WERROR UPX_CONFIG_DISABLE_WSTRICT UPX_CONFIG_DISABLE_SELF_PACK_TEST UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS; do
__add_cmake_config $v
done
# pass UPX extra compile options; see CMakeLists.txt
for v in UPX_CONFIG_EXTRA_COMPILE_OPTIONS_BZIP2 UPX_CONFIG_EXTRA_COMPILE_OPTIONS_UCL UPX_CONFIG_EXTRA_COMPILE_OPTIONS_UPX UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZLIB UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZSTD; do
__add_cmake_config $v
done
exec "${CMAKE:-cmake}" $UPX_CMAKE_CONFIG_FLAGS "${cmake_config_flags[@]}" "$@"
exit 99
+34
View File
@@ -0,0 +1,34 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike
#
# NOTE: we are using clang-format-15.0.6 from upx-stubtools
# see https://github.com/upx/upx-stubtools/releases
#
# NOTE: we use .clang-format config from upx.git/.clang-format
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
UPX_CLANG_FORMAT="$HOME/local/bin/bin-upx/clang-format-15.0.6"
fi
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
UPX_CLANG_FORMAT="$HOME/.local/bin/bin-upx/clang-format-15.0.6"
fi
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
UPX_CLANG_FORMAT="$HOME/bin/bin-upx/clang-format-15.0.6"
fi
if [[ ! -f $UPX_CLANG_FORMAT ]]; then
echo "ERROR: $0: cannot find clang-format-15.0.6"
echo "ERROR: $0: please visit https://github.com/upx/upx-stubtools"
exit 1
fi
# limit memory usage to 1 GiB (in case of clang-format problems with invalid files)
ulimit -v 1048576 || true
#echo "$UPX_CLANG_FORMAT"
exec "$UPX_CLANG_FORMAT" -style=file "$@"
exit 99
+184
View File
@@ -0,0 +1,184 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# mimic running "ctest", i.e. the "test" section of CMakeLists.txt
# - does not redirect stdout
# - allows freely setting $upx_exe_runner, while CMake is restricted to configure-time settings
#
# requires:
# $upx_exe (required, but with convenience fallback "./upx")
# optional settings:
# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Nehalem" or "valgrind")
#
# Debugging aid for locating failing commands. Depends on 'bash' shell.
# (BASH_LINENO is relative to current FUNCTION only; non-function ==> 0)
# Notice single-quoting of entire first argument.
trap 'echo ERROR: pwd=\"$PWD\" file=\"$BASH_SOURCE\" line=${BASH_LINENO[0]} cmd=\"$BASH_COMMAND\"' ERR
# Example: "false a b c" ==> ERROR: pwd="path/misc/testsuite" file="./mimic_ctest.sh" line=0 cmd="false a b c"
#***********************************************************************
# init & checks
#***********************************************************************
# upx_exe
[[ -z $upx_exe && -f ./upx && -x ./upx ]] && upx_exe=./upx # convenience fallback
if [[ -z $upx_exe ]]; then echo "UPX-ERROR: please set \$upx_exe"; exit 1; fi
if [[ ! -f $upx_exe ]]; then echo "UPX-ERROR: file '$upx_exe' does not exist"; exit 1; fi
upx_exe=$(readlink -fn "$upx_exe") # make absolute
[[ -f $upx_exe ]] || exit 1
# set emu and run_upx
emu=()
if [[ -n $upx_exe_runner ]]; then
# usage examples:
# export upx_exe_runner="qemu-x86_64 -cpu Nehalem"
# export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet"
# export upx_exe_runner="wine"
IFS=' ' read -r -a emu <<< "$upx_exe_runner" # split at spaces into array
elif [[ -n $CMAKE_CROSSCOMPILING_EMULATOR ]]; then
IFS=';' read -r -a emu <<< "$CMAKE_CROSSCOMPILING_EMULATOR" # split at semicolons into array
fi
run_upx=( "${emu[@]}" "$upx_exe" )
echo "run_upx='${run_upx[*]}'"
# run_upx sanity check
"${run_upx[@]}" --version-short || true
if ! "${run_upx[@]}" --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short FAILED"; exit 1; fi
if ! "${run_upx[@]}" -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi
if ! "${run_upx[@]}" --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi
#***********************************************************************
# see CMakeLists.txt
#
# IDEA: create a Makefile and use "make -j8" so that these tests can
# run in parallel much like "ctest --parallel 8"
#***********************************************************************
# similar to cmake function upx_cache_bool_vars()
set_cmake_bool_vars() {
local default_value="$1"; shift
local var_name
for var_name do
case "${!var_name}" in
0 | FALSE | OFF | false | off) eval "export $var_name=OFF" ;;
1 | TRUE | ON | true | on) eval "export $var_name=ON" ;;
*) eval "export $var_name=$default_value" ;;
esac
done
}
set -x
set_cmake_bool_vars OFF UPX_CONFIG_DISABLE_SELF_PACK_TEST
set_cmake_bool_vars OFF UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST
set_cmake_bool_vars OFF UPX_CONFIG_DISABLE_RUN_PACKED_TEST
if [[ "${emu[0]}" == *valgrind* ]]; then # valgrind is SLOW
set_cmake_bool_vars ON UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS
else
set_cmake_bool_vars OFF UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS
fi
export UPX="--prefer-ucl --no-color --no-progress"
export UPX_DEBUG_DISABLE_GITREV_WARNING=1
export UPX_DEBUG_DOCTEST_DISABLE=1 # already checked above
"${run_upx[@]}" --version
"${run_upx[@]}" --version-short
"${run_upx[@]}" --license
"${run_upx[@]}" --help
"${run_upx[@]}" --help-short
"${run_upx[@]}" --help-verbose
"${run_upx[@]}" --sysinfo
"${run_upx[@]}" --sysinfo -v
"${run_upx[@]}" --sysinfo -vv
if [[ $UPX_CONFIG_DISABLE_SELF_PACK_TEST == ON ]]; then
echo "Self-pack test disabled. All done."; exit 0
fi
exe=".out"
upx_self_exe=$upx_exe
fo="--force-overwrite"
"${run_upx[@]}" -3 "${upx_self_exe}" ${fo} -o upx-packed${exe}
"${run_upx[@]}" -3 --all-filters "${upx_self_exe}" ${fo} -o upx-packed-fa${exe}
"${run_upx[@]}" -3 --no-filter "${upx_self_exe}" ${fo} -o upx-packed-fn${exe}
"${run_upx[@]}" -3 --all-filters --debug-use-random-filter "${upx_self_exe}" ${fo} -o upx-packed-fr${exe}
"${run_upx[@]}" -3 --nrv2b "${upx_self_exe}" ${fo} -o upx-packed-nrv2b${exe}
"${run_upx[@]}" -3 --nrv2d "${upx_self_exe}" ${fo} -o upx-packed-nrv2d${exe}
"${run_upx[@]}" -3 --nrv2e "${upx_self_exe}" ${fo} -o upx-packed-nrv2e${exe}
"${run_upx[@]}" -1 --lzma "${upx_self_exe}" ${fo} -o upx-packed-lzma${exe}
"${run_upx[@]}" -l upx-packed${exe} upx-packed-fa${exe} upx-packed-fn${exe} upx-packed-fr${exe} upx-packed-nrv2b${exe} upx-packed-nrv2d${exe} upx-packed-nrv2e${exe} upx-packed-lzma${exe}
"${run_upx[@]}" --fileinfo upx-packed${exe} upx-packed-fa${exe} upx-packed-fn${exe} upx-packed-fr${exe} upx-packed-nrv2b${exe} upx-packed-nrv2d${exe} upx-packed-nrv2e${exe} upx-packed-lzma${exe}
"${run_upx[@]}" -t upx-packed${exe} upx-packed-fa${exe} upx-packed-fn${exe} upx-packed-fr${exe} upx-packed-nrv2b${exe} upx-packed-nrv2d${exe} upx-packed-nrv2e${exe} upx-packed-lzma${exe}
"${run_upx[@]}" -d upx-packed${exe} ${fo} -o upx-unpacked${exe}
"${run_upx[@]}" -d upx-packed-fa${exe} ${fo} -o upx-unpacked-fa${exe}
"${run_upx[@]}" -d upx-packed-fn${exe} ${fo} -o upx-unpacked-fn${exe}
"${run_upx[@]}" -d upx-packed-fr${exe} ${fo} -o upx-unpacked-fr${exe}
"${run_upx[@]}" -d upx-packed-nrv2b${exe} ${fo} -o upx-unpacked-nrv2b${exe}
"${run_upx[@]}" -d upx-packed-nrv2d${exe} ${fo} -o upx-unpacked-nrv2d${exe}
"${run_upx[@]}" -d upx-packed-nrv2e${exe} ${fo} -o upx-unpacked-nrv2e${exe}
"${run_upx[@]}" -d upx-packed-lzma${exe} ${fo} -o upx-unpacked-lzma${exe}
# all unpacked files must be identical
cmp -s upx-unpacked${exe} upx-unpacked-fa${exe}
cmp -s upx-unpacked${exe} upx-unpacked-fn${exe}
cmp -s upx-unpacked${exe} upx-unpacked-fr${exe}
cmp -s upx-unpacked${exe} upx-unpacked-nrv2b${exe}
cmp -s upx-unpacked${exe} upx-unpacked-nrv2d${exe}
cmp -s upx-unpacked${exe} upx-unpacked-nrv2e${exe}
cmp -s upx-unpacked${exe} upx-unpacked-lzma${exe}
if [[ $UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST != ON ]]; then
"${emu[@]}" ./upx-unpacked${exe} --version-short
fi
if [[ $UPX_CONFIG_DISABLE_RUN_PACKED_TEST != ON ]]; then
"${emu[@]}" ./upx-packed${exe} --version-short
"${emu[@]}" ./upx-packed-fa${exe} --version-short
"${emu[@]}" ./upx-packed-fn${exe} --version-short
"${emu[@]}" ./upx-packed-fr${exe} --version-short
"${emu[@]}" ./upx-packed-nrv2b${exe} --version-short
"${emu[@]}" ./upx-packed-nrv2d${exe} --version-short
"${emu[@]}" ./upx-packed-nrv2e${exe} --version-short
"${emu[@]}" ./upx-packed-lzma${exe} --version-short
fi
if [[ $UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS != ON ]]; then
set +x
for method in nrv2b nrv2d nrv2e lzma; do
for level in 1 2 3 4 5 6 7; do
for small in normal small; do
s="${method}-${level}"
ss=
if [[ $small == "small" ]]; then
s="${method}-${level}-${small}"
ss="--small"
fi
echo "========== $s =========="
"${run_upx[@]}" -qq --${method} -${level} ${ss} --all-filters --debug-use-random-filter "${upx_self_exe}" ${fo} -o upx-packed-${s}${exe}
"${run_upx[@]}" -qq -l upx-packed-${s}${exe}
"${run_upx[@]}" -qq --fileinfo upx-packed-${s}${exe}
"${run_upx[@]}" -qq -t upx-packed-${s}${exe}
"${run_upx[@]}" -qq -d upx-packed-${s}${exe} ${fo} -o upx-unpacked-${s}${exe}
cmp -s upx-unpacked${exe} upx-unpacked-${s}${exe}
if [[ $UPX_CONFIG_DISABLE_RUN_PACKED_TEST != ON ]]; then
: ${upx_run_packed_test_count:=20}
for ((i = 0; i < $upx_run_packed_test_count; i++)); do
"${emu[@]}" ./upx-packed-${s}${exe} --version-short
done
fi
done
done
done
fi
echo "run_upx='${run_upx[*]}'"
echo "All done."
+46
View File
@@ -0,0 +1,46 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# mimic running "ctest", i.e. the "test" section of CMakeLists.txt
# - does not redirect stdout
# - allows freely setting $upx_exe_runner, while CMake is restricted to configure-time settings
#
# requires:
# $upx_exe (required, but with convenience fallback "./upx")
# optional settings:
# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Nehalem" or "valgrind")
#
cat >catch-sigsegv.gdb <<'EOF'
catch signal SIGSEGV
commands
x/i $pc
info reg
x/32i $pc-0x20
quit 77
end
EOF
catcher=$(readlink -fn catch-sigsegv.gdb)
function emu_gdb() {
gdb -q -x "$catcher" <<EOF --args "$@"
run
EOF
}
if [[ -n $upx_exe_runner ]]; then
true
elif [[ -n $CMAKE_CROSSCOMPILING_EMULATOR ]]; then
true
else
upx_exe_runner=emu_gdb
: ${upx_run_packed_test_count:=20}
fi
source "$argv0dir/mimic_ctest.sh"
+425
View File
@@ -0,0 +1,425 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# test file system behaviour with symlinks; requires:
# $upx_exe (required, but with convenience fallback "./upx")
# optional settings:
# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Nehalem" or "valgrind")
# $upx_test_file
#
# IMPORTANT NOTE: this script only works on Unix
# IMPORTANT NOTE: do NOT run as user root!
umask 0022
# disable on macOS for now, see https://github.com/upx/upx/issues/612
if [[ "$(uname)" == Darwin ]]; then
case "$UPX_DEBUG_FORCE_PACK_MACOS" in
"" | "0") echo "$0: SKIPPED"; exit 0 ;;
esac
fi
id || true
echo "PWD='$PWD'"
if [[ $UID == 0 || $EUID == 0 ]]; then
echo "ERROR: do not run as root: UID=$UID EUID=$EUID"
exit 91
fi
#***********************************************************************
# init & checks
#***********************************************************************
# upx_exe
[[ -z $upx_exe && -f ./upx && -x ./upx ]] && upx_exe=./upx # convenience fallback
if [[ -z $upx_exe ]]; then echo "UPX-ERROR: please set \$upx_exe"; exit 1; fi
if [[ ! -f $upx_exe ]]; then echo "UPX-ERROR: file '$upx_exe' does not exist"; exit 1; fi
upx_exe=$(readlink -fn "$upx_exe") # make absolute
[[ -f $upx_exe ]] || exit 1
# set emu and run_upx
emu=()
if [[ -n $upx_exe_runner ]]; then
# usage examples:
# export upx_exe_runner="qemu-x86_64 -cpu Nehalem"
# export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet"
# export upx_exe_runner="wine"
IFS=' ' read -r -a emu <<< "$upx_exe_runner" # split at spaces into array
elif [[ -n $CMAKE_CROSSCOMPILING_EMULATOR ]]; then
IFS=';' read -r -a emu <<< "$CMAKE_CROSSCOMPILING_EMULATOR" # split at semicolons into array
fi
run_upx=( "${emu[@]}" "$upx_exe" )
echo "run_upx='${run_upx[*]}'"
# run_upx sanity check
if ! "${run_upx[@]}" --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short FAILED"; exit 1; fi
if ! "${run_upx[@]}" -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi
if ! "${run_upx[@]}" --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi
#***********************************************************************
# util functions
#***********************************************************************
exit_code=0
num_errors=0
all_errors=
failed() {
####exit $1
# log error and keep going
exit_code=1
local a="$(basename "$(dirname "$PWD")")"
local b="$(basename "$PWD")"
let num_errors+=1 || true
all_errors="${all_errors} $a/$b/$1"
echo " FAILED $b/$1"
}
assert_file() {
local f
for f in "$@"; do
[[ ! -L "$f" && -f "$f" ]] && continue
echo "failed '$f': not a regular file"
failed 21
done
}
assert_symlink_to_file() {
local f
for f in "$@"; do
[[ -L "$f" && -f "$f" ]] && continue
echo "failed '$f': not a symlink to file"
failed 22
done
}
assert_symlink_to_dir() {
local f
for f in "$@"; do
[[ -L "$f" && -d "$f" ]] && continue
echo "failed '$f': not a symlink to dir"
failed 23
done
}
assert_symlink_dangling() {
local f
for f in "$@"; do
[[ -L "$f" && ! -e "$f" ]] && continue
echo "failed '$f': not a dangling symlink"
failed 24
done
}
copy_directory() {
if command -v rsync >/dev/null; then
rsync -aH "$1/" "$2"
else
cp -ai "$1" "$2"
fi
}
create_files() {
# clean
local d
for d in z_dir_1 z_dir_2 z_dir_3 z_dir_4; do
if [[ -d $d ]]; then
chmod -R +rwx "./$d"
rm -rf "./$d"
fi
done
mkdir z_dir_1
cd z_dir_1
: > z_file
ln -s z_file z_symlink_file
: > z_file_link_1
ln z_file_link_1 z_file_link_2
ln -s z_file_link_1 z_symlink_file_link
mkdir z_dir
ln -s z_dir z_symlink_dir
ln -s z_file_missing z_symlink_dangling
assert_file z_file*
assert_symlink_to_file z_symlink_file
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
cd ..
# write-protect z_dir_2/z_file*
copy_directory z_dir_1 z_dir_2
chmod a-w z_dir_2/z_file*
# write-protect z_dir_3 itself
copy_directory z_dir_1 z_dir_3
chmod a-w z_dir_3
# write-protect everything in z_dir_4
copy_directory z_dir_1 z_dir_4
chmod -R a-w z_dir_4
}
print_header() {
local x='==========='; x="$x$x$x$x$x$x$x"
echo -e "\n${x}\n${1}\n${x}\n"
}
enter_dir() {
cd "$1" || exit 1
echo "===== $(basename "$PWD")"
}
leave_dir() {
echo "===== $(basename "$PWD") files"
ls -lA
cd ..
}
#***********************************************************************
# setup
#***********************************************************************
#set -x # debug
export UPX="--prefer-ucl --no-color --no-progress"
export UPX_DEBUG_DISABLE_GITREV_WARNING=1
export UPX_DEBUG_DOCTEST_DISABLE=1 # already checked above
# get $test_file
if [[ -f $upx_test_file ]]; then
test_file="$(readlink -fn "$upx_test_file")"
else
for test_file in /usr/bin/gmake /usr/bin/make /usr/bin/env /bin/ls; do
if [[ -f $test_file ]]; then
test_file="$(readlink -fn "$test_file")"
break
fi
done
fi
ls -l "$test_file"
file "$test_file" || true
# create and enter a tmpdir in the current directory
tmpdir="$(mktemp -d tmp-upx-test-XXXXXX)"
cd "./$tmpdir" || exit 1
#***********************************************************************
# default
#***********************************************************************
print_header "default"
flags="-qq -2 --no-filter"
mkdir default
cd default
create_files
enter_dir z_dir_1
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new || failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file && failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 && failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file && failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link && failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
enter_dir z_dir_2
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new || failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file && failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 && failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file && failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link && failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
enter_dir z_dir_3
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new && failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file && failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 && failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file && failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link && failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
enter_dir z_dir_4
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new && failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file && failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 && failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file && failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link && failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
cd ..
#***********************************************************************
# force-overwrite
#***********************************************************************
print_header "force-overwrite"
flags="-qq -2 --no-filter --force-overwrite"
mkdir force-overwrite
cd force-overwrite
create_files
enter_dir z_dir_1
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new || failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file || failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 || failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir || failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling || failed 18
assert_file z_symlink_file z_symlink_file_link
assert_file z_symlink_dir
assert_file z_symlink_dangling
leave_dir
enter_dir z_dir_2
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new || failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file || failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 || failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir || failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling || failed 18
assert_file z_symlink_file z_symlink_file_link
assert_file z_symlink_dir
assert_file z_symlink_dangling
leave_dir
enter_dir z_dir_3
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new && failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file || failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 || failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
enter_dir z_dir_4
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new && failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file || failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 || failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
cd ..
#***********************************************************************
# link
#***********************************************************************
print_header "link"
flags="-qq -2 --no-filter --link"
mkdir link
cd link
create_files
enter_dir z_dir_1
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new || failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file || failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 || failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir || failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling || failed 18
assert_file z_symlink_file z_symlink_file_link
assert_file z_symlink_dir
assert_file z_symlink_dangling
leave_dir
enter_dir z_dir_2
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new || failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file && failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 && failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir || failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling || failed 18
assert_file z_symlink_file z_symlink_file_link
assert_file z_symlink_dir
assert_file z_symlink_dangling
leave_dir
enter_dir z_dir_3
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new && failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file || failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 || failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
enter_dir z_dir_4
"${run_upx[@]}" $flags z_symlink_file && failed 10
"${run_upx[@]}" $flags "$test_file" -o z_file_new && failed 11
"${run_upx[@]}" $flags "$test_file" -o z_dir && failed 12
"${run_upx[@]}" $flags "$test_file" -o z_file && failed 13
"${run_upx[@]}" $flags "$test_file" -o z_file_link_1 && failed 14
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file || failed 15
"${run_upx[@]}" $flags "$test_file" -o z_symlink_file_link || failed 16
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dir && failed 17
"${run_upx[@]}" $flags "$test_file" -o z_symlink_dangling && failed 18
assert_symlink_to_file z_symlink_file z_symlink_file_link
assert_symlink_to_dir z_symlink_dir
assert_symlink_dangling z_symlink_dangling
leave_dir
cd ..
#***********************************************************************
# done
#***********************************************************************
# clean up
cd ..
chmod -R +rwx "./$tmpdir"
rm -rf "./$tmpdir"
if [[ $exit_code == 0 ]]; then
echo "UPX testsuite passed. All done."
else
echo "UPX-ERROR: UPX testsuite FAILED:${all_errors}"
echo "UPX-ERROR: UPX testsuite FAILED with $num_errors error(s). See log file."
fi
exit $exit_code
+209
View File
@@ -0,0 +1,209 @@
########## begin .sha256sums.recreate
expected_sha256sums__t010_decompressed="\
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
24808d572483f4cd713d66894b3da406755038737007a78b076528e6407e3132 *amd64-linux.elf/upx-3.95
d88eaad0528bcecec9f51cbe015a117c8cf350a3f6d8308f2b0517d4fd19d189 *amd64-win64.pe/upx-3.95.exe
f7279729eb975e4238f8b8ee56fefa41ccbeb35ef0ffe4c34f8047baab78fff5 *arm-linux.elf/upx-3.95
e09df2a69f88c692138447f274ba7f99cdd11f8696c71ac8d3761606c95ab5c5 *arm-wince.pe/upx-3.91.exe
ce81113f8a4ff1cd806811cb80ab8bea5c9c6fbced47451c7f07e50700f9817b *arm64-linux.elf/upx-3.95
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
84b90eb0d617571fe4885639925b35ca6a61060cb2616bb5bf729b4d701653e4 *armeb-linux.elf/upx-3.95
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
7d331e508449497f64cd47abdd3f00f70307f508ad3fd692d333feb97beccead *i386-dos32.djgpp2.coff/upx-3.95.exe
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
a1f3e5ffa7b2cfebe1e475ac1f4c7683b1b8b4e292aa0d04386cc0314dd162c9 *i386-linux.elf/upx-3.95
e90fb09a808334c2674996760d42c82f8352e3f671f6b66c11481e772785c4d2 *i386-win32.pe/upx-3.91.exe
07bd50c1d80f6ff651228e6fc0ba3a583a472915772244f232696b34156a9d27 *i386-win32.pe/upx-3.95.exe
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
8902f38ec3d95d8e077e3ab5fdbb5bad408859913a35deb87041f4f053cd6605 *mips-linux.elf/upx-3.95
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
dd1496bc4e9c32a5d5dd47e3eaabf7b134ca001d48807eebfd3d5e28c8a2ab58 *mipsel-linux.elf/upx-3.95
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
2bc00a51daa0bada19a8fa1bd2c227a8596844fa1b0aa3611087f195072700e2 *powerpc-linux.elf/upx-3.95
a0950546dc17fca9437219431d8ddb0249ce5b08e899e0c799a87ac982adee70 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t020_canonicalized="\
24158f78c34c4ef94bb7773a6dda7231d289be76c2f5f60e8b9ddb3f800c100e *amd64-linux.elf/upx-3.91
24808d572483f4cd713d66894b3da406755038737007a78b076528e6407e3132 *amd64-linux.elf/upx-3.95
d88eaad0528bcecec9f51cbe015a117c8cf350a3f6d8308f2b0517d4fd19d189 *amd64-win64.pe/upx-3.95.exe
f7279729eb975e4238f8b8ee56fefa41ccbeb35ef0ffe4c34f8047baab78fff5 *arm-linux.elf/upx-3.95
e09df2a69f88c692138447f274ba7f99cdd11f8696c71ac8d3761606c95ab5c5 *arm-wince.pe/upx-3.91.exe
ce81113f8a4ff1cd806811cb80ab8bea5c9c6fbced47451c7f07e50700f9817b *arm64-linux.elf/upx-3.95
b1c1c38d50007616aaf8e942839648c80a6111023e0b411e5fa7a06c543aeb4a *armeb-linux.elf/upx-3.91
84b90eb0d617571fe4885639925b35ca6a61060cb2616bb5bf729b4d701653e4 *armeb-linux.elf/upx-3.95
bcac77a287289301a45fde9a75e4e6c9ad7f8d57856bae6eafaae12ae4445a34 *i386-dos32.djgpp2.coff/upx-3.91.exe
7d331e508449497f64cd47abdd3f00f70307f508ad3fd692d333feb97beccead *i386-dos32.djgpp2.coff/upx-3.95.exe
730a513b72a094697f827e4ac1a4f8ef58a614fc7a7ad448fa58d60cd89af7ed *i386-linux.elf/upx-3.91
a1f3e5ffa7b2cfebe1e475ac1f4c7683b1b8b4e292aa0d04386cc0314dd162c9 *i386-linux.elf/upx-3.95
e90fb09a808334c2674996760d42c82f8352e3f671f6b66c11481e772785c4d2 *i386-win32.pe/upx-3.91.exe
07bd50c1d80f6ff651228e6fc0ba3a583a472915772244f232696b34156a9d27 *i386-win32.pe/upx-3.95.exe
8e5333ea040f5594d3e67d5b09e005d52b3a52ef55099a7c11d7e39ead38e66d *m68k-atari.tos/upx-3.91.ttp
8902f38ec3d95d8e077e3ab5fdbb5bad408859913a35deb87041f4f053cd6605 *mips-linux.elf/upx-3.95
c3f44b4d00a87384c03a6f9e7aec809c1addfe3e271244d38a474f296603088c *mipsel-linux.elf/upx-3.91
dd1496bc4e9c32a5d5dd47e3eaabf7b134ca001d48807eebfd3d5e28c8a2ab58 *mipsel-linux.elf/upx-3.95
b8c35fa2956da17ca505956e9f5017bb5f3a746322647e24ccb8ff28059cafa4 *powerpc-linux.elf/upx-3.91
2bc00a51daa0bada19a8fa1bd2c227a8596844fa1b0aa3611087f195072700e2 *powerpc-linux.elf/upx-3.95
a0950546dc17fca9437219431d8ddb0249ce5b08e899e0c799a87ac982adee70 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t110_compress_ucl_nrv2b_3_no_filter="\
836d9c5d9092421e49aeb573cde449ef740afbfea54d131ccbd88d8c7d87860d *amd64-linux.elf/upx-3.91
9776a2d030719f9d74413d17c1bb732aaabb610b341031facd2c1a75348fc661 *amd64-linux.elf/upx-3.95
822718cc0f6ac5e57bb23eeb65be6f3f7e73df8b062853abddcc924ec8207596 *amd64-win64.pe/upx-3.95.exe
40353c37020fd4bb713c5d54273b8dc07666e262b83a4f0652ccb8a236465f9c *arm-linux.elf/upx-3.95
1440d6b44968954baf56fbc2a0739a51873455876114d4445ae4b67cb5e7893b *arm-wince.pe/upx-3.91.exe
35c08bf5086fe21ff19e3512359e54ac97c6d4513e6bb9ef4a59294bebf18f6a *arm64-linux.elf/upx-3.95
0ca2dcd9e8b5c3f16dcb31e30b42ec57a70b8fe90281d412081095a3d7812f01 *armeb-linux.elf/upx-3.91
462a72efbb580a2e90564412737bb3c1db1d930cde5b4f2c94782df91c8e4f4b *armeb-linux.elf/upx-3.95
a7ee051c5f9dcf233e2ee248274121b99fb8f098eff95469bc0638a7423723f0 *i386-dos32.djgpp2.coff/upx-3.91.exe
85cf31be166cb59587a99419cdd0fc5a79825d7508ab2c9a4bc0d700d603354d *i386-dos32.djgpp2.coff/upx-3.95.exe
fc7656d9a877967be7e339bfc98a0c63ea7b5abc30b96fa9e5931c75ecbe9827 *i386-linux.elf/upx-3.91
d454a7639e96b986ad422b02045ecfefa3b9405901eaa32d92a2c489292b9600 *i386-linux.elf/upx-3.95
934dd17076c0298d35a738533ea668e1fcbf8fc85c6671fcdd3a12e7722502ce *i386-win32.pe/upx-3.91.exe
519a9f6b3de56f5f080151074b9d5d81e31c1961cd6e395f73d2d522b7f7f8e0 *i386-win32.pe/upx-3.95.exe
a7bd9f616231d883f6700b09e3c9a0af2880c6b5e5b0ce1cd8f06de43c48856c *m68k-atari.tos/upx-3.91.ttp
7a0479691e51ea4a8a0246a1f0ffa9694ee2f0e0cf3aa43dc0f1324c4d427ba3 *mips-linux.elf/upx-3.95
f60bab42fe3914109ab1b9f5d00a5be753cd0a2c1a79a3998d58800efedbfff7 *mipsel-linux.elf/upx-3.91
b6d8cc9e2023a3fc415166afc378ccf2eb505487df84c8d959ec74b3fb4f8256 *mipsel-linux.elf/upx-3.95
acd3dc5ed3e4c4eeaa42e7cca71a79d687dd844ce5f384666ed6e78327b5a8e3 *powerpc-linux.elf/upx-3.91
03600584c97fa466ef58239452baf9ec6ff2f06b79d97d45c8490953080de6e3 *powerpc-linux.elf/upx-3.95
3f02885d1e94e59062eb78c4c910cde042475a6cadb77a85a603de747a50f45c *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t120_compress_ucl_nrv2d_3_no_filter="\
8431343adec632690cec669038c246438c799e7dc1b8bc85586e0d2bcd2eebad *amd64-linux.elf/upx-3.91
1852bded40be6eb5ddb07a491476dcfcca69cadda45a5f128aa8f967d567fa0b *amd64-linux.elf/upx-3.95
5ab022e2c3ecb09931e2181fb5f7699f35e2b453b54c823e42653c84b0df5f2c *amd64-win64.pe/upx-3.95.exe
6de0cf1903760710a95cb5330d0ffb406a93f081dbe6806935f51b0c75e23f03 *arm-linux.elf/upx-3.95
53121baf42c85991900aa3947f3d817fe6e894bc6f325ab1d576de6fba5fbcbf *arm-wince.pe/upx-3.91.exe
3c9e49445280de6a771e77f6a88b3c3957815baa193e92a893d5defe6699f50a *arm64-linux.elf/upx-3.95
627a3c77adfcd4ef8c32f1638a6b99e20e79bb914cbcebed6fb9ad5f96936530 *armeb-linux.elf/upx-3.91
7faf9f0adf508cf29bf0ac2a62234df06d6c9153d6d59cf61019361db906daf8 *armeb-linux.elf/upx-3.95
51e4faea51e12c7442b27bb50150f532ac51d8102f77a669cbce82f2675a2ef2 *i386-dos32.djgpp2.coff/upx-3.91.exe
1196f578ab0b862bae8ac6b5166b770f072cf0ac521a2a23a6347c19ea82a0da *i386-dos32.djgpp2.coff/upx-3.95.exe
3015651261f28fb43ed43a8c1fa257bcfcdc788e6fd3f436f3de23733736c724 *i386-linux.elf/upx-3.91
8cca96ea354af889f5e9d3074b2c7005f982463a3f22e1cca2bc01aed9232de1 *i386-linux.elf/upx-3.95
3edf364443a3cd56efd04e95cc7d7c1846bf76addedd7263cfe8330771f19509 *i386-win32.pe/upx-3.91.exe
48141fd66443f85ea867d7fa0bb3a50debb10f15bdb26c71888026e17c88d3a8 *i386-win32.pe/upx-3.95.exe
07e1c09a953a9c87afa33d1236f46244280161bf3802273a523d380318886177 *m68k-atari.tos/upx-3.91.ttp
39b3a5c780d9354714d5e2ed69068511422f8faf9ab660706adc8ad5ecdf3598 *mips-linux.elf/upx-3.95
123ce137e4cd555470fcf9fe67df75179b6f337fee66d075ddc06f9848817a37 *mipsel-linux.elf/upx-3.91
b78d8cd3a3402fed266c737cc34a32cc21b2b67b573e9e9071d4faf9fca89b89 *mipsel-linux.elf/upx-3.95
ea9cae1d1701db3a0c53e9a651766db5bdc30032f48913a4a9e99f193a800acc *powerpc-linux.elf/upx-3.91
aea86bf87870a1e48a454ac1ea9a80d90d8abe5113d418a71d8a9c4a74bb2d0a *powerpc-linux.elf/upx-3.95
62038c87489dc5cd3772e8e4051cf1d416edecf267d37f390a649f4ae657e0f9 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t130_compress_ucl_nrv2e_3_no_filter="\
f817034e8b7765d8b422dac9cb6f24f78ce5bfd7169cd3b33e8224e00b131eca *amd64-linux.elf/upx-3.91
d21441a05514c085c10e99b00d8cc4d45484297a8e4e8a246364ca4347d0ed56 *amd64-linux.elf/upx-3.95
7bd7cd37093200fa94d21dd7fdfef4d7fb9c3049fbf5f408f1f242cb8d9c6a55 *amd64-win64.pe/upx-3.95.exe
d328a89b333d0b36e96d0c61375bf686e8f3b73a188dd4d0df4d78e30af08632 *arm-linux.elf/upx-3.95
ad0a7a18e87657d28260b7c527d284863becd3c5f92259c570125465f88d4042 *arm-wince.pe/upx-3.91.exe
0b700f0f7dde3118694155e876e6c2003ef701fe94856d6562936ec081278747 *arm64-linux.elf/upx-3.95
53a1d04fa62e25e64e6f792b079e21b4c42676a73503ae6d9e67ae16c98e6d04 *armeb-linux.elf/upx-3.91
33ed1e3b84836d2af52295ba0b90343ac0b8d524539ce3b8d0aa9f19a51d70dd *armeb-linux.elf/upx-3.95
6fcdc8e34ce8b3501db2260c8a921c6e963954fdeffedfefca353a27bcc02d56 *i386-dos32.djgpp2.coff/upx-3.91.exe
6f4f901c1838252f9b3104060475a6f13a2ebec830096ff28d870148580e4287 *i386-dos32.djgpp2.coff/upx-3.95.exe
8127f8380300508e8062e9391e321abd0429a6a31fec41e769cc7fe80af27e27 *i386-linux.elf/upx-3.91
b0a7e6b822f038b7940a54ea160b045d2241e3dfa15a5081a23fbc4d42fb6773 *i386-linux.elf/upx-3.95
c78db15a8113b806e56812fd842fb467d2a9c9557fcdc0467dae3f4c33316630 *i386-win32.pe/upx-3.91.exe
89314e8621c4a00e1a65e045686245d3c1e2ba0a858f1dcc8f3cc2d0eedccfb5 *i386-win32.pe/upx-3.95.exe
710ad88b63cc7e0fa0b413ebdbcebf41140678f551b5dd883ed6220507be3601 *m68k-atari.tos/upx-3.91.ttp
c7e3478872650b7f4f8ccb4a0649944e62f44f5a9249cb9425210333e1f2fdf4 *mips-linux.elf/upx-3.95
cd9b3d3780a79cb416b261d622e8e86f2369fa8bb9bc49b529c50cac2980d528 *mipsel-linux.elf/upx-3.91
5baf7db9e4335c0227106262efc9d18ad23b88c6d6bb636656aea67bb063b6ec *mipsel-linux.elf/upx-3.95
aba8bd826ee52d533f9e1c4270d4f4194fe8d8747ea10a1d3ce59b6443f1a9f2 *powerpc-linux.elf/upx-3.91
6f737ccbf8c830476bed9c4dd33dd7757ea25bf2f8fb03b44d03e9b77ada0f1b *powerpc-linux.elf/upx-3.95
d313dd128a54189b9551a529b1ed21b222aa0394a30f9ba552cde96edcd4011e *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t140_compress_lzma_2_no_filter="\
fefac6fbd1e95479eb4066519f9bd801a30c29966685840b6a011e2911b984ca *amd64-linux.elf/upx-3.91
64487a0e0aade092a8ff7e6d8d9528ca550540cac8d432005ba610179782d042 *amd64-linux.elf/upx-3.95
a55ec5a7f2911f6da8b9336daf4f1051e753cfb7a4458c7f7baa6b63340c6daf *amd64-win64.pe/upx-3.95.exe
9f405739b904bb85053b75187c9175e4ac7f66a07ac5e320eaa4e9771e1ec79e *arm-linux.elf/upx-3.95
7a6c603eecf214e5d6742f1fce922223c97c8bd2527678a968640dd6c1bc0d71 *arm-wince.pe/upx-3.91.exe
c8435e2f82ba72a0b6abad4146539d40d495461c5e480af705b2bbd21d192128 *arm64-linux.elf/upx-3.95
21fc48eaaedc73fe9239159fb864c6149f729ef1661a8407b88ad9c9a19f9a54 *armeb-linux.elf/upx-3.91
742db587dc53f616c7b276a930c3f586da2b7c3ce6ccd523c041e88a9671b99b *armeb-linux.elf/upx-3.95
7a8eaa5139b95cc56591200fce62d3c9af163671467952cab6fcf487318107bb *i386-dos32.djgpp2.coff/upx-3.91.exe
9b5fc0f54a5f811bda190c36fb2fa5c5b03c6c3de0c62693e4191230b5a419b8 *i386-dos32.djgpp2.coff/upx-3.95.exe
68b4ce63cb0bd7dd5b287e1f9fa5d9bc234ac36359ce3ebff863984c503a698e *i386-linux.elf/upx-3.91
aa75cf22f0b59cc796de678198432a3dc2d40ab871e4989dd97ff1a6c148f294 *i386-linux.elf/upx-3.95
0e0780f5fccc52f6c78414f7279263b26e31de7c6ca1ec65a240e37cf0a4f5c9 *i386-win32.pe/upx-3.91.exe
3ddd6265d69e374f5f0f8c9f602e0e59c895da2f3fef611ef89f0ee4ae2c592b *i386-win32.pe/upx-3.95.exe
e268c98fdacfd04268d76644f2bb4746ae04b57801407aaa1867798840eeeea0 *m68k-atari.tos/upx-3.91.ttp
499e1d1486810cfa5b6662e30189183979e25f45d35654d8cd60fd793d0c07d8 *mips-linux.elf/upx-3.95
4a30189ad7312eafb2d47e1b526ec22eaf614a895f8dce96f3e1c7385438f44c *mipsel-linux.elf/upx-3.91
339d38602413d97d9bba113f39884815af10ebcdccf37e3f5e8d0879f262a048 *mipsel-linux.elf/upx-3.95
6d4f9d4383ebc9d8411d06a7c219dcf3e8513ea8c989f2d31ab382602f873ba5 *powerpc-linux.elf/upx-3.91
5dd727d8d5a35cc0ab86d629285d8ff450f52b538118679edaa886ce9c1fed7d *powerpc-linux.elf/upx-3.95
efec1e5bbb9bcf11dbc7081adfc2020de18fae326ad86194551c44fba0d2148d *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t150_compress_ucl_2_all_filters="\
05b29bde32af1e63e837e2be499567c4b10d7e692c88082f24e3417e0c7b9f40 *amd64-linux.elf/upx-3.91
65c142ee01af09fa8741932c1f21d466be971aad059cc5afddbb7ecdf142c1bb *amd64-linux.elf/upx-3.95
cbb5c90bd9195bd9e3acd931312a70deeccfab5540f398ceda8826f8d6b332bf *amd64-win64.pe/upx-3.95.exe
1ea1bb18c0ac85c07450f0a6704b84e58a1322556757e2943340ef381b2ce675 *arm-linux.elf/upx-3.95
76a5f0518fc797bd3f132ce6eb61ca187b5d463f191417883a73d4584716c23a *arm-wince.pe/upx-3.91.exe
4df30002376a4f18029ea9dd8260d395bec3a3fa11fbc5aa19859c2f0efdc2e6 *arm64-linux.elf/upx-3.95
ba03fd4889210435c9673f2dcbd2269162037090eccc79cf7d2b896e64a57e2e *armeb-linux.elf/upx-3.91
681f32d01c76ff31776b8d6f1556daa38eee297f675aa40ff1bb2e47e12adf15 *armeb-linux.elf/upx-3.95
aa05c3a2953f0f2d70842cba45786b707a79ffef22fd084f51e304762cc67765 *i386-dos32.djgpp2.coff/upx-3.91.exe
c677241e9a8753ba1332ac3875ab6398fb2d792d2627edd9e58f2535b3131abe *i386-dos32.djgpp2.coff/upx-3.95.exe
7bcd42f58dcc8ddb6cb1a4e33d56b584fe6d49b002b01a0859571d1324dd593a *i386-linux.elf/upx-3.91
b6fe6220c0b3f4df131da3aaae566810f2aa1f13b63d23de3ead9174d08d82e1 *i386-linux.elf/upx-3.95
8ec02f816f4727b519e8775edc1afb1df32991319a6c6f050ece416011925379 *i386-win32.pe/upx-3.91.exe
d5aeeedada49c0c2870ea450ed66b2cea31369bccfccf9407378ae0fb0736deb *i386-win32.pe/upx-3.95.exe
e414ad0aba43790d0498b26c23055fb051129b6cbe3e070a1406c91ac5b8032b *m68k-atari.tos/upx-3.91.ttp
c5107a84d32de820c81401259a7dd23435ea625588d56c6c75ad6fa14b0dbf8b *mips-linux.elf/upx-3.95
78473f7d7ddf56812b8dee087ca62517ecdbd10fa14972ba6670338fc19061d1 *mipsel-linux.elf/upx-3.91
fd9ea397a29b41a2143f9e02217e181d0075d7ad7d87bdbadc7fc94bfb1b0d76 *mipsel-linux.elf/upx-3.95
c47d1299f6ecf86e62528fc54979117b2b2ddbb6c80f553689402399fc7eab28 *powerpc-linux.elf/upx-3.91
77c3b4ba6909a4e20180bc13775e280086d67240519c323c2005f3fcee6e0b78 *powerpc-linux.elf/upx-3.95
e3ce51b863905a4831958c72541b04e9f893f0d9827f32e615822db7aebd56bc *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t160_compress_all_methods_1_no_filter="\
94c91b97fcce7402a4494b22699b2450e8e4e2a9f4ddd66e1133c76ce198c167 *amd64-linux.elf/upx-3.91
5b3e85adb37919d051c6eaff205b8e1d77a2dfde0d8e7dcdee7c22f8fd5dc8c7 *amd64-linux.elf/upx-3.95
5a0ecb45658904bcd0b823b77dba039c9814e2eff4ed429784c36b7074b9858c *amd64-win64.pe/upx-3.95.exe
de93a219ca3c4ea84bd9c1b5fb37ff4aaa0a08ea6eac18da6d7a5865e4dad19c *arm-linux.elf/upx-3.95
fdbe0395ac401285edb9c2f9bfbb0fbd3c0eaad5052a88d8369b1a66b35a8a3e *arm-wince.pe/upx-3.91.exe
acdb7ff90d7c6f403872ec333e2987ee74e99d6e1390863b321b528d312c1084 *arm64-linux.elf/upx-3.95
54860e61da36414dc105aafcdbb86c79b745913a7d0da911fa58a6941f111e2d *armeb-linux.elf/upx-3.91
7c36b75cc8a0712515e12a9e565df4ca43bff6cc0077afb282d367fcc2ee2acd *armeb-linux.elf/upx-3.95
0a0099246096d20ff6035a4df6566954b9d8aff9ed8fdbd35aa5ee4995b02bfe *i386-dos32.djgpp2.coff/upx-3.91.exe
5df7aa9f0896df87eb8798119ad16a9b89c87a7568a67339e33b5baa99ec361f *i386-dos32.djgpp2.coff/upx-3.95.exe
53e5aae9bc70f58e3dc2aef5a94f66df2517d547670e72ee2b3189b7da809f41 *i386-linux.elf/upx-3.91
adaa1e2f46f7a235ab838b15aa7e820057e5ed7011d9d07c67dc770a88e3dd62 *i386-linux.elf/upx-3.95
f3d33c5c9809943a902133490bcf0cfbe39a5ef1635a0c29b3bdc4f35dfffa50 *i386-win32.pe/upx-3.91.exe
474e68a2390cf0376f59402eaef4c902daa49428b628e025b1c8506428a37937 *i386-win32.pe/upx-3.95.exe
1561dd69f67e8705804dba41ebd876bce6a4ce8ed8b0bc0d0e7628697e7fee68 *m68k-atari.tos/upx-3.91.ttp
74f7f69b4a8b2b7c428fa55e3970ee767c1947f19ed1b0644870ecb6b3cb713d *mips-linux.elf/upx-3.95
12a42365234c001a52586b74a9597dc7d65184ddf1ee1d40734823a3443cd92a *mipsel-linux.elf/upx-3.91
68f674d081d87e86e54f0051eee9e2bc85b566051992774ab28ff3173cbcb75a *mipsel-linux.elf/upx-3.95
f569d8f49d7110bb8b262a48055b39d889e9977c40c5f1b21e74f8cbf93b27ae *powerpc-linux.elf/upx-3.91
d8227a8a88c083760889acaf259e7da59eab75a23e341289bc8e3c60563ae344 *powerpc-linux.elf/upx-3.95
e4b58ed65025b765953af02e80be9a171c49b6c707c835949b1c888fdbe8bba0 *powerpc64le-linux.elf/upx-3.95
"
expected_sha256sums__t170_compress_all_methods_no_lzma_5_no_filter="\
52a39c30b60abb82c1ec2826297eb46abdc29b5dd55d7a7a41dd2fc1c573f60a *amd64-linux.elf/upx-3.91
f0c728c42e8775767e0d963e1eef7ca78711f3f6dd180df980a1faef926d7cac *amd64-linux.elf/upx-3.95
e07e9babdeb12fddeebbfa1b0293163cc5e63017d6f0933d02587c8da1e90a82 *amd64-win64.pe/upx-3.95.exe
f0359efa2247e9ea756f54c85e7518d61f3b293e08f566c3812c64c7d5f0db0f *arm-linux.elf/upx-3.95
8d1706ab02013b536c3a4cec20d40a96591ffa45fdcb464ccd3f038567006d79 *arm-wince.pe/upx-3.91.exe
14932490ff17e27bb5bedde576b8683892c4720f4a0058f373aab9f8894fda09 *arm64-linux.elf/upx-3.95
64a73512e40c2fb49d8ae3a1d496b379c97b8724cf8ca4461a85825ff04366a0 *armeb-linux.elf/upx-3.91
078e7cd073ba071f17ad4292e2211b7d635f57e974546e7f156cc87f9aa716e2 *armeb-linux.elf/upx-3.95
dda2c348c43741a1bd65049a8e7b51be1ebf873d215370ec002185c85390c168 *i386-dos32.djgpp2.coff/upx-3.91.exe
560392427ded22f2f3fea59ef10e55d65cf841001e67b1e4558ef13514baa602 *i386-dos32.djgpp2.coff/upx-3.95.exe
f3f8feceebe8536633554b204df68c2e94e1d1a313fe7a576b7f5d404c916083 *i386-linux.elf/upx-3.91
e7f98419e346670f72d66ac25f3d6ad53201e768819980eecae24d801366be27 *i386-linux.elf/upx-3.95
3510bc5627237752bedd275e73c42bc02cd46145ff916e7bccbdec663f763ee4 *i386-win32.pe/upx-3.91.exe
ad47c7522167f6f7e47d495e1fa119431386ca5ea9bc16b6a4b9cb38cf9cd29f *i386-win32.pe/upx-3.95.exe
1c999e5c6cded8c99a7f6b4595879893ae63d2af1388dc61dd8b4e3106676480 *m68k-atari.tos/upx-3.91.ttp
55a098c2cdce1917b76ce0845f434fc23b0bd30b34e884b19401c51c8c7f4756 *mips-linux.elf/upx-3.95
4b6487d412f43acb8e41951a2135e56025139a9ad3e57102749df4d4bef934fa *mipsel-linux.elf/upx-3.91
1dcd626fc4566c608e987fd6999b695793c5cae7f78872e3d1a9a23942fea188 *mipsel-linux.elf/upx-3.95
2047a4a880322bf41e8afbb4787f6103364de4a299b543808251a4144c4d990b *powerpc-linux.elf/upx-3.91
63679bd238f30bfb14853246eb257536471fea10f942b2adfdd43cbef21dea30 *powerpc-linux.elf/upx-3.95
c75d1548db879ed589b55bc1319869b49d37595f4560a64b34016951dc02f997 *powerpc64le-linux.elf/upx-3.95
"
########## end .sha256sums.recreate
+336
View File
@@ -0,0 +1,336 @@
#! /usr/bin/env bash
## vim:set ts=4 sw=4 et:
set -e; set -o pipefail
argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs")
#
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# very first version of the upx-testsuite; requires:
# $upx_exe (required, but with convenience fallback "./upx")
# $upx_testsuite_SRCDIR (required, but with convenience fallback)
# $upx_testsuite_BUILDDIR (optional)
#
# optional settings:
# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Nehalem" or "valgrind")
# $UPX_TESTSUITE_VERBOSE
# $UPX_TESTSUITE_LEVEL
#
# see https://github.com/upx/upx-testsuite.git
#
#***********************************************************************
# init & checks
#***********************************************************************
# upx_exe
[[ -z $upx_exe && -f ./upx && -x ./upx ]] && upx_exe=./upx # convenience fallback
if [[ -z $upx_exe ]]; then echo "UPX-ERROR: please set \$upx_exe"; exit 1; fi
if [[ ! -f $upx_exe ]]; then echo "UPX-ERROR: file '$upx_exe' does not exist"; exit 1; fi
upx_exe=$(readlink -fn "$upx_exe") # make absolute
[[ -f $upx_exe ]] || exit 1
# set emu and run_upx
emu=()
if [[ -n $upx_exe_runner ]]; then
# usage examples:
# export upx_exe_runner="qemu-x86_64 -cpu Nehalem"
# export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet"
# export upx_exe_runner="wine"
IFS=' ' read -r -a emu <<< "$upx_exe_runner" # split at spaces into array
elif [[ -n $CMAKE_CROSSCOMPILING_EMULATOR ]]; then
IFS=';' read -r -a emu <<< "$CMAKE_CROSSCOMPILING_EMULATOR" # split at semicolons into array
fi
run_upx=( "${emu[@]}" "$upx_exe" )
echo "run_upx='${run_upx[*]}'"
# run_upx sanity check
if ! "${run_upx[@]}" --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short FAILED"; exit 1; fi
if ! "${run_upx[@]}" -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi
if ! "${run_upx[@]}" --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi
# upx_testsuite_SRCDIR
if [[ -z $upx_testsuite_SRCDIR ]]; then
# convenience fallback: search standard locations below upx top-level directory
if [[ -d "$argv0dir/../../../upx--upx-testsuite.git/files/packed" ]]; then
upx_testsuite_SRCDIR="$argv0dir/../../../upx--upx-testsuite.git"
elif [[ -d "$argv0dir/../../../upx-testsuite.git/files/packed" ]]; then
upx_testsuite_SRCDIR="$argv0dir/../../../upx-testsuite.git"
elif [[ -d "$argv0dir/../../../upx-testsuite/files/packed" ]]; then
upx_testsuite_SRCDIR="$argv0dir/../../../upx-testsuite"
fi
fi
if [[ ! -d "$upx_testsuite_SRCDIR/files/packed" ]]; then
echo "invalid or missing \$upx_testsuite_SRCDIR:"
echo " please git clone https://github.com/upx/upx-testsuite.git"
echo " and set (export) the envvar upx_testsuite_SRCDIR to the local file path"
exit 1
fi
upx_testsuite_SRCDIR=$(readlink -fn "$upx_testsuite_SRCDIR") # make absolute
[[ -d $upx_testsuite_SRCDIR ]] || exit 1
# upx_testsuite_BUILDDIR
if [[ -z $upx_testsuite_BUILDDIR ]]; then
upx_testsuite_BUILDDIR="./tmp-upx-testsuite"
fi
mkdir -p "$upx_testsuite_BUILDDIR" || exit 1
upx_testsuite_BUILDDIR=$(readlink -fn "$upx_testsuite_BUILDDIR") # make absolute
[[ -d $upx_testsuite_BUILDDIR ]] || exit 1
cd / && cd "$upx_testsuite_BUILDDIR" || exit 1
: > ./.mfxnobackup
# run_upx sanity check after "cd"
if ! "${run_upx[@]}" --version-short >/dev/null; then
echo "UPX-ERROR: FATAL: upx --version-short FAILED"
echo "please make sure that \$upx_exe contains ABSOLUTE file paths and can be run from any directory"
echo "INFO: run_upx='${run_upx[*]}'"
exit 1
fi
#***********************************************************************
# setup
#***********************************************************************
#set -x # debug
exit_code=0
num_errors=0
all_errors=
export UPX="--prefer-ucl --no-color --no-progress"
export UPX_DEBUG_DISABLE_GITREV_WARNING=1
export UPX_DEBUG_DOCTEST_DISABLE=1 # already checked above
case $UPX_TESTSUITE_LEVEL in
[0-8]) ;;
*) UPX_TESTSUITE_LEVEL=999 ;;
esac
if [[ $UPX_TESTSUITE_LEVEL == 0 ]]; then
echo "UPX testsuite SKIPPED."
exit 0
fi
rm -rf ./testsuite_1
mkdir testsuite_1 || exit 1
cd testsuite_1 || exit 1
#***********************************************************************
# support functions
#***********************************************************************
run_upx() {
local flags="--disable-random-id --fake-stub-version=5.01 --fake-stub-year=2025"
local ec=0
if [[ $UPX_TESTSUITE_VERBOSE == 1 ]]; then
echo "LOG: '${run_upx[*]}' $*"
fi
"${run_upx[@]}" $flags "$@" || ec=$?
if [[ $ec != 0 ]]; then
echo "FATAL: '${run_upx[*]}' $*"
echo " (exit code was $ec)"
exit 42
fi
}
testsuite_header() {
local x='==========='; x="$x$x$x$x$x$x$x"
echo -e "\n${x}\n${1}\n${x}\n"
}
testsuite_split_f() {
fd=$(dirname "$1")
fb=$(basename "$1")
fsubdir=$(basename "$fd")
# sanity checks
if [[ ! -f $1 || -z $fsubdir || -z $fb ]]; then
fd=''; fb=''; fsubdir=''
fi
}
testsuite_check_sha() {
(cd "$1" && sha256sum -b [0-9a-zA-Z]*/* | LC_ALL=C sort -k2) > $1/.sha256sums.current
echo
cat $1/.sha256sums.current
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
echo "UPX-ERROR: $1 FAILED: checksum mismatch"
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
exit_code=99
let num_errors+=1 || true
all_errors="${all_errors} $1"
#exit 99
fi
echo
}
testsuite_check_sha_decompressed() {
(cd "$1" && sha256sum -b [0-9a-zA-Z]*/* | LC_ALL=C sort -k2) > $1/.sha256sums.current
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
cat $1/.sha256sums.current
echo "UPX-ERROR: FATAL: $1 FAILED: decompressed checksum mismatch"
diff -u $1/.sha256sums.expected $1/.sha256sums.current || true
exit 98
fi
}
testsuite_use_canonicalized=1
testsuite_run_compress() {
testsuite_header $testdir
local files f
if [[ $testsuite_use_canonicalized == 1 ]]; then
files='t020_canonicalized/*/*'
else
files='t010_decompressed/*/*'
fi
for f in $files; do
testsuite_split_f "$f"
[[ -z $fb ]] && continue
echo "# $f"
mkdir -p "$testdir/$fsubdir" "$testdir/.decompressed/$fsubdir"
run_upx -qq --prefer-ucl "$@" "$f" -o "$testdir/$fsubdir/$fb"
run_upx -qq -d "$testdir/$fsubdir/$fb" -o "$testdir/.decompressed/$fsubdir/$fb"
done
testsuite_check_sha $testdir
run_upx -qq -l "$testdir"/*/*
run_upx -qq --file-info "$testdir"/*/*
run_upx -q -t "$testdir"/*/*
if [[ $testsuite_use_canonicalized == 1 ]]; then
# check that after decompression the file matches the canonicalized version
cp t020_canonicalized/.sha256sums.expected $testdir/.decompressed/
testsuite_check_sha_decompressed $testdir/.decompressed
rm -rf "./$testdir/.decompressed"
fi
}
#***********************************************************************
# expected checksums
#
# To ease maintenance of this script in case of updates this section
# can be automatically re-created from the current checksums -
# see call of function recreate_expected_sha256sums below.
#***********************************************************************
recreate_expected_sha256sums() {
local o="$1"
local files f d
echo "########## begin .sha256sums.recreate" > "$o"
files='*/.sha256sums.current'
for f in $files; do
d=$(dirname "$f")
echo "expected_sha256sums__${d}="'"\' >> "$o"
cat "$f" >> "$o"
echo '"' >> "$o"
done
echo "########## end .sha256sums.recreate" >> "$o"
}
source "$argv0dir/upx_testsuite_1-expected_sha256sums.sh" || exit 1
#***********************************************************************
# decompression tests
#***********************************************************************
testdir=t010_decompressed
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
testsuite_header $testdir
for f in "$upx_testsuite_SRCDIR"/files/packed/*/upx-3.9[15]*; do
testsuite_split_f "$f"
[[ -z $fb ]] && continue
echo "# $f"
mkdir -p "$testdir/$fsubdir"
run_upx -qq -d "$f" -o "$testdir/$fsubdir/$fb"
done
testsuite_check_sha $testdir
# run one pack+unpack step to canonicalize the files
testdir=t020_canonicalized
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
testsuite_header $testdir
for f in t010_decompressed/*/*; do
testsuite_split_f "$f"
[[ -z $fb ]] && continue
echo "# $f"
mkdir -p "$testdir/$fsubdir/.packed"
run_upx -qq --prefer-ucl -1 "$f" -o "$testdir/$fsubdir/.packed/$fb"
run_upx -qq -d "$testdir/$fsubdir/.packed/$fb" -o "$testdir/$fsubdir/$fb"
done
testsuite_check_sha $testdir
#***********************************************************************
# compression tests
# info: we use fast compression levels because we want to
# test UPX and not the compression libraries
#***********************************************************************
if [[ $UPX_TESTSUITE_LEVEL -ge 2 ]]; then
testdir=t110_compress_ucl_nrv2b_3_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --nrv2b -3 --no-filter
fi
if [[ $UPX_TESTSUITE_LEVEL -ge 3 ]]; then
testdir=t120_compress_ucl_nrv2d_3_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --nrv2d -3 --no-filter
fi
if [[ $UPX_TESTSUITE_LEVEL -ge 4 ]]; then
testdir=t130_compress_ucl_nrv2e_3_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --nrv2e -3 --no-filter
fi
if [[ $UPX_TESTSUITE_LEVEL -ge 5 ]]; then
testdir=t140_compress_lzma_2_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --lzma -2 --no-filter
fi
if [[ $UPX_TESTSUITE_LEVEL -ge 6 ]]; then
testdir=t150_compress_ucl_2_all_filters
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress -2 --all-filters
fi
if [[ $UPX_TESTSUITE_LEVEL -ge 7 ]]; then
testdir=t160_compress_all_methods_1_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --all-methods -1 --no-filter
fi
if [[ $UPX_TESTSUITE_LEVEL -ge 8 ]]; then
testdir=t170_compress_all_methods_no_lzma_5_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
fi
#***********************************************************************
# summary
#***********************************************************************
# recreate checksums from current version for an easy update in case of changes
recreate_expected_sha256sums .sha256sums.recreate
testsuite_header "UPX testsuite summary: level $UPX_TESTSUITE_LEVEL"
run_upx --version-short
echo
echo "upx_exe='$upx_exe'"
ls -l "$upx_exe"
if command -v file >/dev/null; then
file "$upx_exe" || true
fi
echo "run_upx='${run_upx[*]}'"
echo "upx_testsuite_SRCDIR='$upx_testsuite_SRCDIR'"
echo "upx_testsuite_BUILDDIR='$upx_testsuite_BUILDDIR'"
echo ".sha256sums.{expected,current} counts:"
cat ./*/.sha256sums.expected | LC_ALL=C sort | wc
cat ./*/.sha256sums.current | LC_ALL=C sort | wc
echo
if [[ $exit_code == 0 ]]; then
echo "UPX testsuite passed. All done."
else
echo "UPX-ERROR: UPX testsuite FAILED:${all_errors}"
echo "UPX-ERROR: UPX testsuite FAILED with $num_errors error(s). See log file."
fi
exit $exit_code
+47
View File
@@ -0,0 +1,47 @@
#
# valgrind suppressions for musl libc
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# musl malloc
{
musl-malloc-enframe
Memcheck:Cond
fun:enframe
}
{
musl-malloc-get_nominal_size
Memcheck:Cond
fun:get_nominal_size
fun:__libc_free
}
# these are only needed for older musl versions
{
musl-malloc-mal0_clear
Memcheck:Cond
fun:mal0_clear
fun:calloc
}
{
musl-string-memchr
Memcheck:Cond
fun:memchr
}
{
musl-string-stpcpy
Memcheck:Cond
fun:stpcpy
}
{
musl-string-strchrnul
Memcheck:Cond
fun:strchrnul
}
{
musl-string-strlen
Memcheck:Cond
fun:strlen
}
View File
-101
View File
@@ -1,101 +0,0 @@
The GNU bfd binary file descriptor package, part of the GNU binutils package,
contains code to recognize an Elf file by looking at fields in the file header.
Many programs (such as gdb, size, objdump, objcopy, strip and others) use bfd.
Unfortunately, bfd has been overly strict. In releases
binutils-2.9.1.0.4, binutils-2.9.1.0.23, binutils-2.9.5.0.0,
binutils-2.10.1,
gdb-4.17, gdb-5.0,
and probably others,
bfd does not recognize a file with zero in Elf32_Ehdr.e_shoff, .e_shentsize,
or .e_shnum, even though the operating system kernel does not care, and many
bfd clients would work just fine in these cases.
Because of its desire to create small size compressed executables, UPX
generates and uses Elf files with zero in .e_shoff, .e_shentsizes, and .e_shnum.
As a result, many widely-distributed instances of gdb, size, objdump, etc.,
refuse to work on UPX-packed executables.
Here is a patch to bfd/elfcode.h which enables many bfd clients to work
with UPX-packed executables. The last two lines of the patch are
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
return -1;
--- elfcode.h.orig Mon Jun 16 11:45:32 1997
+++ elfcode.h Sat Apr 22 10:18:56 2000
@@ -1,5 +1,5 @@
/* ELF executable support for BFD.
- Copyright 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -517,14 +517,14 @@
elf_debug_file (i_ehdrp);
#endif
- /* If there is no section header table, we're hosed. */
- if (i_ehdrp->e_shoff == 0)
+ /* If there is no section header table, and relocatable, then we're hosed. */
+ if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL)
goto got_wrong_format_error;
/* As a simple sanity check, verify that the what BFD thinks is the
size of each section header table entry actually matches the size
- recorded in the file. */
- if (i_ehdrp->e_shentsize != sizeof (x_shdr))
+ recorded in the file, but only if there are any sections. */
+ if (i_ehdrp->e_shentsize != sizeof (x_shdr) && i_ehdrp->e_shnum != 0)
goto got_wrong_format_error;
ebd = get_elf_backend_data (abfd);
@@ -579,6 +579,7 @@
/* Allocate space for a copy of the section header table in
internal form, seek to the section header table in the file,
read it in, and convert it to internal form. */
+ if (i_ehdrp->e_shnum!=0) {
i_shdrp = ((Elf_Internal_Shdr *)
bfd_alloc (abfd, sizeof (*i_shdrp) * i_ehdrp->e_shnum));
elf_elfsections (abfd) = ((Elf_Internal_Shdr **)
@@ -609,6 +610,7 @@
if (! bfd_section_from_shdr (abfd, i_ehdrp->e_shstrndx))
goto got_no_match;
}
+ }
/* Read in the program headers. */
if (i_ehdrp->e_phnum == 0)
@@ -644,6 +646,7 @@
bfd_section_from_shdr with it (since this particular strtab is
used to find all of the ELF section names.) */
+ if (i_ehdrp->e_shstrndx != 0) {
shstrtab = bfd_elf_get_str_section (abfd, i_ehdrp->e_shstrndx);
if (!shstrtab)
goto got_no_match;
@@ -657,6 +660,7 @@
if (! bfd_section_from_shdr (abfd, shindex))
goto got_no_match;
}
+ }
/* Let the backend double check the format and override global
information. */
@@ -930,7 +934,7 @@
{
Elf_Internal_Shdr *hdr;
Elf_Internal_Shdr *verhdr;
- long symcount; /* Number of external ELF symbols */
+ unsigned long symcount; /* Number of external ELF symbols */
elf_symbol_type *sym; /* Pointer to current bfd symbol */
elf_symbol_type *symbase; /* Buffer for generated bfd symbols */
Elf_Internal_Sym i_sym;
@@ -978,7 +982,7 @@
sym = symbase = NULL;
else
{
- long i;
+ unsigned long i;
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) == -1)
return -1;
View File
-3172
View File
File diff suppressed because it is too large Load Diff
-24
View File
@@ -1,24 +0,0 @@
GNUmakefile
*.0??
*.d
*.dat
*.idb
*.img
*.map
*.raw
*.rc
*.rel
*.res
*.pdb
*.upx
.gdbinit
.Attic
.deps
B
compress_nrv.*
upx
upx_nrv
upx_nrv.*
upx_ucl
upx_ucl.*
version1*.h
-42
View File
@@ -1,42 +0,0 @@
ifeq ($(DEPS_DONE),)
DEPS_DONE := 1
# /***********************************************************************
# // automated dependencies
# ************************************************************************/
ifeq ($(DEPMODE),gcc)
EXTRA_CFLAGS += -Wp,-MMD,.deps/$(*F).d
EXTRA_CXXFLAGS += -Wp,-MMD,.deps/$(*F).d
HAVE_DEPS := 1
endif
ifeq ($(DEPMODE),linux-intelc)
EXTRA_CFLAGS += -MMD -MF.deps/$(*F).d
EXTRA_CXXFLAGS += -MMD -MF.deps/$(*F).d
HAVE_DEPS := 1
endif
ifeq ($(DEPMODE),linux-pgi)
## NOTE: -MMD does not work...
EXTRA_CFLAGS += -MD.deps/$(*F).d
EXTRA_CXXFLAGS += -MD.deps/$(*F).d
HAVE_DEPS := 1
endif
ifeq ($(HAVE_DEPS),1)
ifeq ($(strip $(wildcard .deps)),)
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
else
DEPS_FILES := $(wildcard .deps/*.d)
ifneq ($(strip $(DEPS_FILES)),)
include $(DEPS_FILES)
endif
endif
endif
endif # DEPS_DONE
-71
View File
@@ -1,71 +0,0 @@
DEPMODE := gcc
# /***********************************************************************
# // defaults for gcc
# ************************************************************************/
CC = gcc
CXX = g++
CFLAGS_OUTPUT = -o $@
LINK_EXE_OUTPUT = -o $@
CFLAGS_W =
CFLAGS_M =
CFLAGS_O =
CXXFLAGS_W =
CXXFLAGS_M =
CXXFLAGS_O =
CFLAGS = $(call __mkflags,CFLAGS_W) $(call __mkflags,CFLAGS_M) $(call __mkflags,CFLAGS_O)
CXXFLAGS = $(call __mkflags,CXXFLAGS_W) $(call __mkflags,CXXFLAGS_M) $(call __mkflags,CXXFLAGS_O)
#
# cflags
#
##CFLAGS_WERROR = -Werror
CFLAGS_WERROR =
CFLAGS_W = $(CFLAGS_WERROR) -Wall -W -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wwrite-strings
CXXFLAGS_W = $(CFLAGS_WERROR) -Wall -W -Wcast-align -Wcast-qual -Winline -Woverloaded-virtual -Wpointer-arith -Wshadow -Wsign-promo -Wsynth -Wwrite-strings
##CFLAGS_M += -fno-builtin
##CFLAGS_M += -malign-functions=0 -malign-jumps=0 -malign-loops=0
CXXFLAGS_M = $(CFLAGS_M)
ifeq ($(DEBUG),1)
CFLAGS_O = -g -O0
else
##CFLAGS_O = -Os -fstrict-aliasing
CFLAGS_O = -O2 -fstrict-aliasing
##CFLAGS_O = -O2 -fno-strict-aliasing
endif
CXXFLAGS_O = $(CFLAGS_O) -fconserve-space
##CXXFLAGS += -fasynchronous-exceptions
#
# cxxflags for g++ 3.2 or better
##CXXFLAGS_W += -Wdisabled-optimization -Wpacked
#
# ldflags
#
ifeq ($(DEBUG),1)
LDFLAGS += -g
else
LDFLAGS += -s
endif
LDFLAGS += -Wl,-Map,$T.map
ifeq ($(WITH_ZLIB),1)
LDLIBS += -lz
endif
# vi:nowrap
-48
View File
@@ -1,48 +0,0 @@
UDIR := $($(U)DIR)
ifneq ($(strip $(wildcard $(UDIR)/include)),) # { include
DEFS += -DWITH_$(U)
INCLUDES += -I$(UDIR)/include
ifeq ($(DEBUG),1)
ifneq ($(strip $(wildcard $(UDIR)/build/debug/src/.libs)),)
LIBDIRS += $(UDIR)/build/debug/src/.libs
endif
endif
ifneq ($(strip $(wildcard $(UDIR)/build/$(release)/src/.libs)),)
LIBDIRS += $(UDIR)/build/$(release)/src/.libs
else
ifneq ($(strip $(wildcard $(UDIR)/build/$(target)/src/.libs)),)
LIBDIRS += $(UDIR)/build/$(target)/src/.libs
else
ifneq ($(strip $(wildcard $(UDIR)/src/.libs)),)
LIBDIRS += $(UDIR)/src/.libs
else
ifneq ($(strip $(wildcard $(UDIR)/build/release/src/.libs)),)
LIBDIRS += $(UDIR)/build/release/src/.libs
else
ifneq ($(strip $(wildcard $(UDIR)/build/src/.libs)),)
LIBDIRS += $(UDIR)/build/src/.libs
else
ifneq ($(strip $(wildcard $(UDIR))),)
LIBDIRS += $(UDIR)
DOS_LIBDIRS := $(DOS_LIBDIRS);$(UDIR)
endif
endif
endif
endif
endif
endif
LDLIBS += -l$(u)
DOS_LDLIBS += $(u).lib
DEFS := $(DEFS)
INCLUDES := $(INCLUDES)
LIBDIRS := $(LIBDIRS)
LDLIBS := $(LDLIBS)
DOS_LDLIBS := $(DOS_LDLIBS)
endif # } include
+86 -64
View File
@@ -1,86 +1,108 @@
#
# UPX Makefile (GNU make) - works with unix/win32/djgpp2
#
# usage:
# `make target=linux' # linux
# `make target=dos32-djggp2' # dos32 - djggp2
# `make target=win32-cygwin' # win32 - cygwin
# `make target=win32-mingw32' # win32 - mingw32
# `make target=win32-rsxnt' # win32 - rsxnt
# `make target=win32-bc' # win32 - Borland C++
# `make target=win32-dm' # win32 - Digital Mars C++
# `make target=win32-ic' # win32 - Intel C++
# `make target=win32-vc' # win32 - Visual C++
# `make target=win32-wc' # win32 - Watcom C++
# `make target=cross-amd64-linux' # x86_64-linux cross compiler
# `make target=cross-mingw32' # i586-mingw32msvc cross compiler
# `make target=cross-mint' # m68k-atari-mint cross compiler
# `make target=gcc' # generic gcc
#
# you can also set the `UPX_MAKE_TARGET' environment variable.
# UPX src Makefile - needs GNU make and CMake >= 3.13
# Copyright (C) Markus Franz Xaver Johannes Oberhumer
#
# NOTE: this Makefile is intended for developers - please use
# the top-level Makefile instead
# configuration section
ifeq ($(strip $(UCLDIR)),)
# change this to reflect where the UCL library is
UCLDIR = $(HOME)/local/src/ucl-1.02
ifndef srcdir
srcdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
endif
ifndef top_srcdir
top_srcdir := $(srcdir)/..
endif
## you can set the default target here
##target =
#***********************************************************************
# redirect to top-level Makefile
#***********************************************************************
DEBUG = 0
# NOTE that the top-level Makefile .DEFAULT_GOAL is build/release
.DEFAULT_GOAL = build/all
srcdir = .
top_srcdir = ..
.NOTPARALLEL: # because the actual builds use "cmake --parallel"
.PHONY: PHONY
.SECONDEXPANSION:
.SUFFIXES:
build/debug build/release build/all: PHONY; $(MAKE) -C "$(top_srcdir)" $@
build/debug+test build/release+test build/all+test: PHONY; $(MAKE) -C "$(top_srcdir)" $@
# shortcuts
debug release all: PHONY; $(MAKE) -C "$(top_srcdir)" $@
debug+test release+test all+test: PHONY; $(MAKE) -C "$(top_srcdir)" $@
##### You should not have to change anything below this line. #####
test: $$(patsubst %+test,%,$$(.DEFAULT_GOAL))+test PHONY
#***********************************************************************
# make run-testsuite
# git clone https://github.com/upx/upx-testsuite.git
#***********************************************************************
# /***********************************************************************
# // object files
# ************************************************************************/
# search for the UPX testsuite; you can override by setting "upx_testsuite_SRCDIR"
ifndef upx_testsuite_SRCDIR
# search standard locations below $(top_srcdir)
ifneq ($(wildcard $(top_srcdir)/../upx--upx-testsuite.git/files/packed/.),)
upx_testsuite_SRCDIR := $(top_srcdir)/../upx--upx-testsuite.git
else ifneq ($(wildcard $(top_srcdir)/../upx-testsuite.git/files/packed/.),)
upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuite.git
else ifneq ($(wildcard $(top_srcdir)/../upx-testsuite/files/packed/.),)
upx_testsuite_SRCDIR := $(top_srcdir)/../upx-testsuite
endif
endif
# these use exceptions & RTTI
OBJECTS1 = \
compress$o except$o file$o lefile$o \
filter$o linker$o mem$o msg$o stdcxx$o work$o ui$o \
packer$o packerf$o packhead$o packmast$o \
p_com$o p_djgpp2$o p_elks$o p_exe$o \
p_lx_elf$o p_lx_exc$o p_lx_sep$o p_lx_sh$o \
p_ps1$o p_sys$o p_tmt$o p_tos$o \
p_unix$o p_vmlinz$o p_vmlinx$o p_w16ne$o p_w32pe$o p_wcle$o
# run the UPX testsuite
# The expected (old) checksums are in $(top_srcdir)/misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
# The actual (new) checksums are in ./tmp-upx-testsuite-*/testsuite_1/.sha256sums.recreate
ifneq ($(wildcard $(upx_testsuite_SRCDIR)/files/packed/.),)
ifneq ($(wildcard $(top_srcdir)/misc/testsuite/upx_testsuite_1.sh),)
run-testsuite: run-testsuite-release PHONY
run-testsuite-all: run-testsuite-debug run-testsuite-release PHONY
run-testsuite-%: export upx_testsuite_SRCDIR := $(upx_testsuite_SRCDIR)
run-testsuite-debug: export upx_testsuite_BUILDDIR := ./tmp-upx-testsuite-debug
run-testsuite-debug: export upx_exe := $(top_srcdir)/build/debug/upx
run-testsuite-debug: build/debug PHONY
time -p bash "$(top_srcdir)/misc/testsuite/upx_testsuite_1.sh"
run-testsuite-release: export upx_testsuite_BUILDDIR := ./tmp-upx-testsuite-release
run-testsuite-release: export upx_exe := $(top_srcdir)/build/release/upx
run-testsuite-release: build/release PHONY
time -p bash "$(top_srcdir)/misc/testsuite/upx_testsuite_1.sh"
endif
endif
# no exceptions or RTTI
OBJECTS2 = \
filteri$o help$o main$o mygetopt$o snprintf$o util$o \
c_init$o c_file$o c_none$o c_screen$o \
s_object$o s_djgpp2$o s_vcsa$o s_win32$o
#***********************************************************************
# make check-whitespace
#***********************************************************************
# pure C sources
OBJECTS3 =
ifneq ($(wildcard /usr/bin/env),) # need Unix utils like bash, perl, sed, xargs, etc.
OBJECTS = $(OBJECTS1) $(OBJECTS2) $(OBJECTS3)
LIBS =
RESOURCES =
CHECK_WHITESPACE = bash "$(top_srcdir)/misc/scripts/check_whitespace.sh" "$(top_srcdir)"
ifneq ($(wildcard $(top_srcdir)/.git/.),)
CHECK_WHITESPACE = bash "$(top_srcdir)/misc/scripts/check_whitespace_git.sh" "$(top_srcdir)"
endif
check-whitespace: PHONY; $(CHECK_WHITESPACE)
endif # /usr/bin/env
# /***********************************************************************
# // main
# ************************************************************************/
#***********************************************************************
# make clang-format
#***********************************************************************
override WITH_ZLIB = 1
# automatically format most C++ source code files
ifneq ($(wildcard /usr/bin/env),)
ifeq ($(shell uname),Linux)
include $(srcdir)/Makefile.bld
# Markus loves clang-format, but John hates it; find a compromise
CLANG_FORMAT_EXCLUDE_FILES += stub/%.h util/miniacc.h
CLANG_FORMAT_EXCLUDE_FILES += p_lx_% p_mach% p_unix% p_vmlin%
CLANG_FORMAT_FILES := $(sort $(wildcard *.[ch]* ../maint/src/*.[ch]* */*.[ch]*))
CLANG_FORMAT_FILES += $(sort $(wildcard stub/tools/*/*.[ch]*))
CLANG_FORMAT_FILES += $(sort $(wildcard ../misc/cmake/try_compile/*.[ch]*))
CLANG_FORMAT_FILES := $(sort $(filter-out $(CLANG_FORMAT_EXCLUDE_FILES),$(CLANG_FORMAT_FILES)))
clang-format: $(CLANG_FORMAT_FILES) PHONY
@echo "running upx-clang-format"
@bash "$(top_srcdir)/misc/scripts/upx-clang-format.sh" -i $(CLANG_FORMAT_FILES)
endif # Linux
endif # /usr/bin/env
# /***********************************************************************
# // dependencies
# ************************************************************************/
include $(srcdir)/Makedefs.dep
# vi:nowrap
# vim:set ts=8 sw=8 noet:
-720
View File
@@ -1,720 +0,0 @@
# /***********************************************************************
# // perpare setup
# ************************************************************************/
SHELL = /bin/sh
.SUFFIXES:
.SUFFIXES: .a .c .cpp .exe .lib .o .obj .rc .res .ttp
ifeq ($(srcdir),)
srcdir = .
endif
VPATH = $(srcdir)
# auto-detect the target unless given on the commandline
ifeq ($(strip $(target)),)
# try environment variable UPX_MAKE_TARGET
target := $(UPX_MAKE_TARGET)
endif
ifeq ($(strip $(target)),)
ifneq ($(strip $(wildcard /usr/include/linux)),)
target = linux
endif
##ifneq ($(strip $(wildcard /platform/sun4?/kernel/unix)),)
##target = sparc-sun-solaris
##endif
endif
ifeq ($(strip $(target)),)
include please_specify_a_target
endif
# util var for use in the rules - basename of the current target
override T = $(basename $@)
# expand "VAR" into "$(VAR) $(EXTRA_VAR) $(UPX_EXTRA_VAR)"
override __mkflags = $(strip $($(1)) $(EXTRA_$(1)) $(UPX_EXTRA_$(1)))
# /***********************************************************************
# // compiler defaults
# ************************************************************************/
CC_SRC = $<
CXX_SRC = $<
CC_COMPILE = $(CC) $(CCARCH) $(call __mkflags,DEFS) $(call __mkflags,INCLUDES) $(call __mkflags,CFLAGS) $(CFLAGS_OUTPUT) -c $(CC_SRC)
CXX_COMPILE = $(CXX) $(CXXARCH) $(call __mkflags,DEFS) $(call __mkflags,INCLUDES) $(call __mkflags,CXXFLAGS) $(CXXFLAGS_OUTPUT) -c $(CXX_SRC)
CXX_LINK_EXE = $(CXXLD) $(CXXLDARCH) $(call __mkflags,LDFLAGS) $(LINK_EXE_OUTPUT) $^ $(call __mkflags,LDLIBS)
STUBEDIT_EXE =
STUBIFY_EXE =
CHMOD_EXE =
o = .o
a = .a
e =
DEFS =
INCLUDES =
LIBDIRS =
DOS_LDLIBS =
DOS_LIBDIRS =
# CC defaults
CC = INVALID_TARGET_CC
CCARCH =
CFLAGS =
CFLAGS_OUTPUT =
# CXX defaults
CXX = $(CC)
CXXARCH = $(CCARCH)
CXXFLAGS = $(CFLAGS)
CXXFLAGS_OUTPUT = $(CFLAGS_OUTPUT)
# CXXLD defaults
CXXLD = $(CXX)
CXXLDARCH = $(CXXARCH)
LDFLAGS =
LINK_EXE_OUTPUT =
LDLIBS =
LINK_EXE_LDFLAGS =
ifeq ($(DEBUG),1)
DEFS += -DDEBUG
## DEFS += -DTESTING
endif
# /***********************************************************************
# // compression libraries
# ************************************************************************/
ifeq ($(WITH_ZLIB),1)
DOS_LDLIBS += zlib.lib
ZLIBDIR:=$(strip $(subst \,/,$(ZLIBDIR)))
ifneq ($(strip $(wildcard $(ZLIBDIR))),)
ifneq ($(strip $(wildcard $(ZLIBDIR)/include/zlib.h)),)
INCLUDES += -I$(ZLIBDIR)/include
else
ifneq ($(strip $(wildcard $(ZLIBDIR)/src/zlib.h)),)
INCLUDES += -I$(ZLIBDIR)/src
else
ifneq ($(strip $(wildcard $(ZLIBDIR)/zlib.h)),)
INCLUDES += -I$(ZLIBDIR)
endif
endif
endif
endif
endif
UCLDIR:=$(strip $(subst \,/,$(UCLDIR)))
NRVDIR:=$(strip $(subst \,/,$(NRVDIR)))
u = ucl
U = UCL
upx_exe_tail =
include $(srcdir)/Makedefs.inc
ifneq ($(strip $(wildcard $(NRVDIR)/include/nrv)),)
u = nrv
U = NRV
upx_exe_tail := _$(u)
include $(srcdir)/Makedefs.inc
endif
upx_exe = upx$(upx_exe_tail)$(e)
override tmp := -Wl,--rpath,
LDRPATH := $(addprefix $(tmp),$(LIBDIRS))
LIBDIRS += .
LDLIBDIRS := $(addprefix -L,$(LIBDIRS))
##LDFLAGS += $(LDRPATH)
LDFLAGS += $(LDLIBDIRS)
# /***********************************************************************
# // compiler settings
# ************************************************************************/
###
### generic gcc
###
ifeq ($(target),gcc)
include $(srcdir)/Makedefs.gcc
endif
###
### linux - gcc
###
ifeq ($(target),linux)
include $(srcdir)/Makedefs.gcc
override arch := $(shell uname -m | sed -e 's/^i[3456789]86$$/i386/')
ifeq ($(arch),i386)
CCARCH += -march=i386 -mcpu=i686
endif
DEFS += -D_FILE_OFFSET_BITS=64
LDLIBS += -lmcheck
##CFLAGS_WERROR = -Werror
ifeq ($(DEBUG),1)
else
##LDFLAGS += -static
STUBEDIT_EXE = objcopy -S -R .comment -R .note $@
ifeq ($(arch),i386)
## STUBIFY_EXE = perl $(srcdir)/stub/scripts/brandelf.pl $@
endif
endif
CHMOD_EXE = chmod 755 $@
endif # linux
###
### linux/i386 - Borland C++ 5.7 (Kylix 3)
###
ifeq ($(target),linux-bc57)
##DEPMODE := linux-XXX ## FIXME
CC = bc++ -q -3
CFLAGS = -w '-w!'
CFLAGS_OUTPUT = -o$@
LDFLAGS += -ls
LINK_EXE_OUTPUT = -e$@
ifeq ($(WITH_ZLIB),1)
LDLIBS += -lz
endif
# warning: do not use option `-d' --> incorrect string merging will happen
ifeq ($(DEBUG),1)
CFLAGS += -Od -dc
else
CFLAGS += -O2 -dc
endif
# transform `-lxx -lyy' into `libxx.a libyy.a'
LDLIBS := $(shell echo "$(LDLIBS)" | perl -pe 's/-l(.+?)\b/lib\1.a/g')
endif
###
### linux/i386 - Intel C++
###
ifeq ($(target),linux-intelc)
DEPMODE := linux-intelc
CC = icc
CXX = icpc
CCARCH += -march=i386 -mcpu=i686 -nolib_inline
DEFS += -D_FILE_OFFSET_BITS=64
CFLAGS_OUTPUT = -o $@
LINK_EXE_OUTPUT = -o $@
ifeq ($(WITH_ZLIB),1)
LDLIBS += -lz
endif
CFLAGS = $(CFLAGS_WERROR)
ifeq ($(DEBUG),1)
CFLAGS += -g -O0
else
CFLAGS += -O2
endif
LDFLAGS += -Wl,-Map,$T.map
endif
###
### linux/i386 - Portland Group PGI C++ 5.x
###
ifeq ($(target),linux-pgi)
DEPMODE := linux-pgi
CC = pgcc
CXX = pgCC
CCARCH += -tp=p6
DEFS += -D_FILE_OFFSET_BITS=64
CFLAGS_OUTPUT = -o $@
LINK_EXE_OUTPUT = -o $@
ifeq ($(WITH_ZLIB),1)
LDLIBS += -lz
endif
##CFLAGS += -Minform=info
CXXFLAGS = $(CFLAGS) -tused
ifeq ($(DEBUG),1)
else
CFLAGS += -O2
endif
endif
###
### Linux cross compilers
###
ifeq ($(target),cross-amd64-linux)
include $(srcdir)/Makedefs.gcc
CC = x86_64-linux-gcc
CXX = x86_64-linux-g++
LDLIBS += -lmcheck
endif # cross-amd64-linux
ifeq ($(target),cross-m68k-linux)
include $(srcdir)/Makedefs.gcc
CC = m68k-linux-gcc
CXX = m68k-linux-g++
##LDLIBS += -lmcheck
endif # cross-m68k-linux
###
### sparc-sun-solaris2.8
###
ifeq ($(target),sparc-sun-solaris)
include $(srcdir)/Makedefs.gcc
endif
###
### Atari cross compilers
###
ifeq ($(target),cross-mint)
include $(srcdir)/Makedefs.gcc
e = .ttp
CC = m68k-atari-mint-gcc
CXX = m68k-atari-mint-g++
CCARCH += -m68000
endif
ifeq ($(target),cross-mint-m68040)
include $(srcdir)/Makedefs.gcc
e = .ttp
CC = m68k-atari-mint-gcc
CXX = m68k-atari-mint-g++
CCARCH += -m68040
endif
ifeq ($(target),cross-mint-m68020-60)
include $(srcdir)/Makedefs.gcc
e = .ttp
CC = m68k-atari-mint-gcc
CXX = m68k-atari-mint-g++
CCARCH += -m68020-60 -m68881
endif
###
### dos32 - djgpp2 / emx
###
ifeq ($(target),dos32-djgpp2)
include $(srcdir)/Makedefs.gcc
e = .exe
CXX = gxx
CCARCH += -march=i386 -mcpu=i686
CFLAGS_WERROR = -Werror
STUBEDIT_EXE = stubedit $@ bufsize=0xfc00
ifneq ($(strip $(wildcard $(DJDIR)/bin/mfxdjstubify.ex[eE])),)
ifneq ($(strip $(wildcard $(DJDIR)/bin/cwsdstub.ex[eE])),)
STUBIFY_EXE = mfxdjstubify -v -s $(DJDIR)/bin/cwsdstub.exe $@
endif
endif
endif
ifeq ($(target),dos32-emx)
include $(srcdir)/Makedefs.gcc
e = .exe
CXX = gcc
CFLAGS_O = -O2
CCARCH += -mno-probe
LDFLAGS = -L. -s
endif
###
### win32 - cygwin / mingw32 / rsxnt
###
ifeq ($(target),win32-cygwin)
include $(srcdir)/Makedefs.gcc
##CXX = g++-2
e = .exe
CCARCH += -march=i386 -mcpu=i686
LDLIBS += -lwinmm
endif
ifeq ($(target),win32-mingw32)
include $(srcdir)/Makedefs.gcc
e = .exe
CCARCH += -march=i386 -mcpu=i686
LDLIBS += -lwinmm
endif
# mingw32 cross compiler
ifeq ($(target),cross-mingw32)
include $(srcdir)/Makedefs.gcc
e = .exe
CC = i586-mingw32msvc-gcc
CXX = i586-mingw32msvc-g++
CCARCH += -march=i386 -mcpu=i686
LDLIBS += -lwinmm
endif
# rsxnt (g++ 2.8.1)
ifeq ($(target),win32-rsxnt)
include $(srcdir)/Makedefs.gcc
e = .exe
CXX = gcc
CFLAGS_O = -O2
CCARCH += -Zwin32 -Zsys -mno-probe
LDFLAGS = -L. -s
STUBEDIT_EXE = pestack -s1024 -c1024 $@
endif
###
### win32 - Borland C++
###
ifeq ($(target),win32-bc)
o = .obj
a = .lib
e = .exe
CC = bcc32 -3
ifeq ($(UPX_BROKEN_INCLUDES),1)
ifneq ($(srcdir),.)
INCLUDES += -I$(srcdir)
endif
INCLUDES += -I$(srcdir)/acc
ifneq ($(strip $(wildcard $(srcdir)/filter)),)
INCLUDES += -I$(srcdir)/filter
endif
endif
CFLAGS = -w -w-inl -g1
CFLAGS_OUTPUT = -o$@
LDFLAGS = -ls
LINK_EXE_OUTPUT = -e$@
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -Od -d
else
CFLAGS += -O2 -d
endif
endif # win32-bc
###
### win32 - Digital Mars C++
###
ifeq ($(target),win32-dm)
o = .obj
a = .lib
e = .exe
CC = dmc -mn
CFLAGS = -w- -wx
CXXFLAGS = $(CFLAGS) -Aa -Ab -Ae -Ar
CFLAGS_OUTPUT = -o$@
LDFLAGS = -L/map
LINK_EXE_OUTPUT = -o$@
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -o- -g -s
else
CFLAGS += -o
endif
endif # win32-dm
###
### win32 - Intel C++
###
ifeq ($(target),win32-ic)
o = .obj
a = .lib
e = .exe
CC = icl -nologo
CFLAGS = -W3 -WX
CXXFLAGS = $(CFLAGS) -EHac -GR
LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifeq (1,2)
# statically link libcmt.lib
CC += -MT
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
else
# link against msvcrt.dll
CC += -MD
endif
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -Od -ZI
LINK_EXE_LDFLAGS += /debug
else
CFLAGS += -O1 -GF
LINK_EXE_LDFLAGS += /release
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win32-ic
###
### win32 - Metrowerks C++
###
ifeq ($(target),win32-mwerks)
o = .obj
a = .lib
e = .exe
CC = mwcc -gccinc
CFLAGS = -w on
CXXFLAGS = $(CFLAGS)
CFLAGS_OUTPUT = -o $@
LDFLAGS = -lwinmm.lib -map $T.map
LINK_EXE_OUTPUT = -o $@
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -opt full
else
CFLAGS +=
endif
endif # win32-mwerks
###
### win32 - Symantec C++
###
ifeq ($(target),win32-sc)
o = .obj
a = .lib
e = .exe
CC = sc -mn
CFLAGS = -w- -wx
CXXFLAGS = $(CFLAGS) -EH -ER
CFLAGS_OUTPUT = -o$@
LDFLAGS = -L/map
LINK_EXE_OUTPUT = -o$@
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -o- -g -s
else
CFLAGS += -o
endif
endif # win32-sc
###
### win32 - Visual C++
###
ifeq ($(target),win32-vc)
o = .obj
a = .lib
e = .exe
CC = cl -nologo
CFLAGS = -W4 -WX
CXXFLAGS = $(CFLAGS) -EHac -GR
LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifeq (1,1)
# statically link libcmt.lib
CC += -MT
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
else
# link against msvcrt.dll
CC += -MD
endif
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -Od -ZI
LINK_EXE_LDFLAGS += /debug
else
CFLAGS += -O1 -GF
LINK_EXE_LDFLAGS += /release
##LINK_EXE_LDFLAGS += /opt:nowin98
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win32-vc
###
### win32 - Watcom C++
###
ifeq ($(target),win32-wc)
o = .obj
a = .lib
e = .exe
CC = wcl386 -zq -bt=nt -mf -5r
##CC = wcl386 -zq -bt=dos -l=CauseWay -mf -5r
CFLAGS = -zc -w5 -we
CXXFLAGS = $(CFLAGS) -xs -xr
CFLAGS_OUTPUT = -fo=$@
LDFLAGS = -k0x100000 -fm
LINK_EXE_OUTPUT = -fe=$@
LDLIBS = $(DOS_LDLIBS)
CC_SRC = $(subst /,\\,$<)
CXX_SRC = $(subst /,\\,$<)
INCLUDES := $(strip $(subst /,\\,$(INCLUDES)))
ifeq (1,2)
WCL386 := $(INCLUDES)
export WCL386
INCLUDES :=
endif
ifeq ($(DEBUG),1)
CFLAGS +=
else
# note: it seems that the optimizer is generating bad code with `-ox'
CFLAGS += -olr
endif
endif # win32-wc
###
### win64 - Intel C++ [Itanium]
###
ifeq ($(target),win64-ic)
o = .obj
a = .lib
e = .exe
CC = ecl -nologo
CFLAGS = -W3
CXXFLAGS = $(CFLAGS) -EHac -GR
LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifeq (1,2)
# statically link libcmt.lib
CC += -MT
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
else
# link against msvcrt.dll
CC += -MD
endif
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -Od -ZI
LINK_EXE_LDFLAGS += /debug
else
CFLAGS += -O1 -GF
LINK_EXE_LDFLAGS += /release
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win64-ic
###
### win64 - Visual C++ [AMD64 or Itanium]
###
ifeq ($(target),win64-vc)
o = .obj
a = .lib
e = .exe
CC = cl -nologo
CFLAGS = -W4 -Wall
CXXFLAGS = $(CFLAGS) -EHac -GR
LDFLAGS =
LINK_EXE_OUTPUT = -Fe$@
LINK_EXE_LDFLAGS = /link /map:$T.map
##LINK_EXE_LDFLAGS += /verbose
ifeq (1,1)
# statically link libcmt.lib
CC += -MT
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
else
# link against msvcrt.dll
CC += -MD
endif
LDLIBS = $(DOS_LDLIBS)
ifeq ($(DEBUG),1)
CFLAGS += -Od -ZI
LINK_EXE_LDFLAGS += /debug
else
CFLAGS += -O1 -GF
LINK_EXE_LDFLAGS += /release
endif
RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc)))
endif # win64-vc
# /***********************************************************************
# // malloc debuggers and memory checkers - obsolete, use valgrind
# ************************************************************************/
ifeq (1,2)
# compile in extra valgrind support
DEFS += -DWITH_VALGRIND
endif
ifeq (1,2)
LDLIBS += -lefence
endif
ifeq (1,2)
DEFS += -DWITH_DMALLOC
LDLIBS += -ldmalloc
endif
ifeq (1,2)
DEFS += -DWITH_GC -DLINUX_THREADS -D_REENTRANT
LDLIBS += -lgc -lpthread
# only needed when using -static:
##LDFLAGS += -Wl,-defsym,_DYNAMIC=0
endif
# /***********************************************************************
# // main targets
# ************************************************************************/
-include ./Makefile.local
all: $(upx_exe)
$(upx_exe): $(OBJECTS) $(LIBS) $(RESOURCES)
$(strip $(CXX_LINK_EXE))
$(strip $(STUBEDIT_EXE))
$(strip $(STUBIFY_EXE))
$(strip $(CHMOD_EXE))
mostlyclean:
-rm -f *.d *.err *.i *.log *.map gdb-trans*
clean: mostlyclean
-rm -f *.a *.lib *.o *.obj *.res *.tds tags TAGS ID
-rm -f *.idb *.pdb
-rm -f $(upx_exe) upx upx.exe upx.ttp upx_nrv upx_nrv.exe upx_nrv.ttp upx_ucl upx_ucl.exe upx_ucl.ttp
-rm -rf .deps _deps
distclean: clean
maintainer-clean: distclean
.PHONY: all mostlyclean clean distclean maintainer-clean
# /***********************************************************************
# // rules
# ************************************************************************/
%$o : %.c
$(strip $(CC_COMPILE))
%$o : %.cpp
$(strip $(CXX_COMPILE))
%.res : %.rc
rc -l 0x409 -fo$@ $<
# vi:nowrap
-1
View File
@@ -1 +0,0 @@
GNUmakefile
-340
View File
@@ -1,340 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
-94
View File
@@ -1,94 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*
* Possible configuration values:
*
* ACC_CONFIG_NO_HEADER
* ACC_CONFIG_HEADER if given, then use this as <config.h>
* ACC_CONFIG_INCLUDE include path to acc_ files
*
* ACC_CONFIG_PREFER___INT64 [acc_type.h]
*/
#ifndef __ACC_H_INCLUDED
#define __ACC_H_INCLUDED 1
#define ACC_VERSION 20040715L
#if !defined(ACC_CONFIG_INCLUDE)
# define ACC_CONFIG_INCLUDE(file) file
#endif
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
# define __CYGWIN__ __CYGWIN32__
#endif
#if defined(__IBMCPP__) && !defined(__IBMC__)
# define __IBMC__ __IBMCPP__
#endif
#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
# define __INTEL_COMPILER __ICL
#endif
#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
# define _ALL_SOURCE 1
#endif
/* disable pedantic warnings for undefined preprocessing symbols */
#if defined(__INTEL_COMPILER) && defined(__linux__)
# pragma warning(disable: 193)
#endif
#if defined(__KEIL__) && defined(__C166__)
# pragma warning disable = 322
#elif 0 && defined(__C251__)
# pragma warning disable = 322
#endif
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
# if (_MSC_VER >= 1300)
# pragma warning(disable: 4668)
# endif
#endif
#if 0 && defined(__WATCOMC__)
# if (__WATCOMC__ < 1060)
# pragma warning 203 9
# endif
#endif
#include <limits.h>
#include ACC_CONFIG_INCLUDE("acc_init.h")
#include ACC_CONFIG_INCLUDE("acc_os.h")
#include ACC_CONFIG_INCLUDE("acc_cc.h")
#include ACC_CONFIG_INCLUDE("acc_arch.h")
#include ACC_CONFIG_INCLUDE("acc_mm.h")
#include ACC_CONFIG_INCLUDE("acc_defs.h")
#if defined(ACC_CONFIG_NO_HEADER)
#elif defined(ACC_CONFIG_HEADER)
# include ACC_CONFIG_HEADER
#else
# include ACC_CONFIG_INCLUDE("acc_auto.h")
#endif
#include ACC_CONFIG_INCLUDE("acc_type.h")
#endif /* already included */
/*
vi:ts=4:et
*/
-124
View File
@@ -1,124 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*
* CPU architecture - exactly one of:
*
* ACC_ARCH_UNKNOWN [default]
* ACC_ARCH_ALPHA
* ACC_ARCH_AMD64 aka x86-64 or ia32e
* ACC_ARCH_C166
* ACC_ARCH_IA16 Intel Architecture (8088, 8086, 80186, 80286)
* ACC_ARCH_IA32 Intel Architecture (80386+)
* ACC_ARCH_IA64 Intel Architecture (Itanium)
* ACC_ARCH_M68K Motorola 680x0
* ACC_ARCH_MCS251
* ACC_ARCH_MCS51
* ACC_ARCH_PPC64 Power PC
* ACC_ARCH_SPARC64
*
* Optionally define one of:
* ACC_ENDIAN_LITTLE_ENDIAN
* ACC_ENDIAN_BIG_ENDIAN
*
* Note that this list is not exhaustive - actually we only really care
* about architectures which allow unaligned memory access at reasonable
* speed (for the moment this means IA16, IA32 and AMD64).
*/
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
# define ACC_ARCH_IA16 1
# define ACC_INFO_ARCH "ia16"
#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
# define ACC_ARCH_AMD64 1
# define ACC_INFO_ARCH "amd64"
#elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__)
# define ACC_ARCH_AVR 1
# define ACC_INFO_ARCH "avr"
#elif (UINT_MAX == ACC_0xffffL) && defined(__C166__)
# define ACC_ARCH_C166 1
# define ACC_INFO_ARCH "c166"
#elif (UINT_MAX == ACC_0xffffL) && defined(__C251__)
# define ACC_ARCH_MCS251 1
# define ACC_INFO_ARCH "mcs-251"
#elif (UINT_MAX == ACC_0xffffL) && defined(__C51__)
# define ACC_ARCH_MCS51 1
# define ACC_INFO_ARCH "mcs-51"
#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
# define ACC_ARCH_IA32 1
# define ACC_INFO_ARCH "ia32"
#elif (ACC_CC_ZORTECHC && defined(__I86__))
# define ACC_ARCH_IA32 1
# define ACC_INFO_ARCH "ia32"
#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
# define ACC_ARCH_IA64 1
# define ACC_INFO_ARCH "ia64"
#elif (ACC_OS_DOS32 && ACC_CC_HIGHC) && defined(_I386)
# define ACC_ARCH_IA32 1
# define ACC_INFO_ARCH "ia32"
#elif (ACC_OS_DOS32 || ACC_OS_OS2)
# error "missing define for CPU architecture"
#elif (ACC_OS_WIN32)
# error "missing define for CPU architecture"
#elif (ACC_OS_WIN64)
/* # error "missing define for CPU architecture" */
#elif (ACC_OS_TOS) || defined(__m68000__)
# define ACC_ARCH_M68K 1
# define ACC_INFO_ARCH "m68k"
#elif defined(__alpha__) || defined(__alpha)
# define ACC_ARCH_ALPHA 1
# define ACC_INFO_ARCH "alpha"
#elif defined(__ppc64__) || defined(__ppc64)
# define ACC_ARCH_PPC64 1
# define ACC_INFO_ARCH "ppc64"
#elif defined(__sparc64__) || defined(__sparc64)
# define ACC_ARCH_SPARC64 1
# define ACC_INFO_ARCH "sparc64"
#else
# define ACC_ARCH_UNKNOWN 1
# define ACC_INFO_ARCH "unknown"
#endif
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA16 || ACC_ARCH_IA32)
# define ACC_ENDIAN_LITTLE_ENDIAN 1
# define ACC_INFO_ENDIAN "little-endian"
#elif (ACC_ARCH_M68K)
# define ACC_ENDIAN_BIG_ENDIAN 1
# define ACC_INFO_ENDIAN "big-endian"
#endif
#if (ACC_ARCH_IA16)
# if (UINT_MAX != ACC_0xffffL)
# error "this should not happen"
# endif
# if (ULONG_MAX != ACC_0xffffffffL)
# error "this should not happen"
# endif
#endif
#if (ACC_ARCH_IA32)
# if (UINT_MAX != ACC_0xffffffffL)
# error "this should not happen"
# endif
# if (ULONG_MAX != ACC_0xffffffffL)
# error "this should not happen"
# endif
#endif
/*
vi:ts=4:et
*/
-660
View File
@@ -1,660 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*
* Possible configuration values:
*
* ACC_CONFIG_AUTO_NO_HEADERS
* ACC_CONFIG_AUTO_NO_FUNCTIONS
* ACC_CONFIG_AUTO_NO_SIZES
*/
/*************************************************************************
// Checks for <stdint.h>
**************************************************************************/
#if !defined(ACC_CONFIG_AUTO_NO_HEADERS)
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
# define HAVE_STDINT_H 1
# endif
#elif defined(__dietlibc__)
# undef HAVE_STDINT_H /* incomplete */
#elif (ACC_CC_BORLANDC) && (__BORLANDC__ >= 0x560)
# undef HAVE_STDINT_H /* broken & incomplete */
#elif (ACC_CC_DMC) && (__DMC__ >= 0x825)
# define HAVE_STDINT_H 1
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#endif /* !defined(ACC_CONFIG_AUTO_NO_HEADERS) */
/*************************************************************************
// Checks for header files
**************************************************************************/
#if !defined(ACC_CONFIG_AUTO_NO_HEADERS)
#define STDC_HEADERS 1
#define HAVE_ASSERT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_DIRENT_H 1
#define HAVE_ERRNO_H 1
#define HAVE_FCNTL_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_SETJMP_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
#undef HAVE_ALLOCA_H
#undef HAVE_CONIO_H
#undef HAVE_DIRECT_H
#undef HAVE_DOS_H
#undef HAVE_IO_H
#undef HAVE_SHARE_H
#undef HAVE_STDINT_H
#undef HAVE_STRINGS_H
#undef HAVE_SYS_UTIME_H
#if (ACC_OS_POSIX)
# define HAVE_STRINGS_H 1
# if (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_OPENBSD)
# undef HAVE_MALLOC_H /* deprecated */
# elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX)
# define HAVE_ALLOCA_H 1
# endif
# if (ACC_OS_POSIX_MACOSX && ACC_CC_MWERKS) && defined(__MSL__)
/* FIXME ??? */
# undef HAVE_SYS_TIME_H
# undef HAVE_SYS_TYPES_H
# endif
#elif (ACC_OS_CYGWIN)
# define HAVE_IO_H 1
#elif (ACC_OS_EMX)
# define HAVE_ALLOCA_H 1
# define HAVE_IO_H 1
#elif (ACC_OS_TOS && ACC_CC_GNUC)
# if !defined(__MINT__)
# undef HAVE_MALLOC_H
# endif
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
# undef HAVE_DIRENT_H
# undef HAVE_FCNTL_H
# undef HAVE_MALLOC_H
# undef HAVE_MEMORY_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_STAT_H
# undef HAVE_SYS_TIME_H
# undef HAVE_SYS_TYPES_H
#endif
/* DOS, OS/2 & Windows */
#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
#define HAVE_CONIO_H 1
#define HAVE_DIRECT_H 1
#define HAVE_DOS_H 1
#define HAVE_IO_H 1
#define HAVE_SHARE_H 1
#if (ACC_CC_AZTECC)
# undef HAVE_CONIO_H
# undef HAVE_DIRECT_H
# undef HAVE_DIRENT_H
# undef HAVE_MALLOC_H
# undef HAVE_SHARE_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_STAT_H
# undef HAVE_SYS_TIME_H
# undef HAVE_SYS_TYPES_H
#elif (ACC_CC_BORLANDC)
# undef HAVE_UNISTD_H
# undef HAVE_SYS_TIME_H
# if (ACC_OS_WIN32 || ACC_OS_WIN64)
# undef HAVE_DIRENT_H /* pulls in <windows.h>; use <dir.h> instead */
# endif
# if (__BORLANDC__ < 0x0400)
# undef HAVE_DIRENT_H
# undef HAVE_UTIME_H
# endif
#elif (ACC_CC_DMC)
# undef HAVE_DIRENT_H /* not working */
# undef HAVE_UNISTD_H /* not working */
# define HAVE_SYS_DIRENT_H 1
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
# define HAVE_ALLOCA_H 1
# undef HAVE_DIRENT_H
# undef HAVE_UNISTD_H
#elif (ACC_CC_IBMC && ACC_OS_OS2)
# undef HAVE_DOS_H
# undef HAVE_DIRENT_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H
# define HAVE_SYS_UTIME_H 1
#elif (ACC_CC_INTELC || ACC_CC_MSC)
# undef HAVE_DIRENT_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H
# define HAVE_SYS_UTIME_H 1
#elif (ACC_CC_LCC)
# undef HAVE_DIRENT_H
# undef HAVE_DOS_H
# undef HAVE_SYS_TIME_H
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
# undef HAVE_UTIME_H
# define HAVE_SYS_UTIME_H 1
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
# define HAVE_ALLOCA_H 1
# undef HAVE_DOS_H
# undef HAVE_SHARE_H
# undef HAVE_SYS_TIME_H
#elif (ACC_CC_NDPC)
# undef HAVE_DIRENT_H
# undef HAVE_DOS_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H
#elif (ACC_CC_PACIFICC)
# undef HAVE_DIRECT_H
# undef HAVE_DIRENT_H
# undef HAVE_FCNTL_H
# undef HAVE_IO_H
# undef HAVE_MALLOC_H
# undef HAVE_MEMORY_H
# undef HAVE_SHARE_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_STAT_H
# undef HAVE_SYS_TIME_H
# undef HAVE_SYS_TYPES_H
#elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
# undef HAVE_DIRENT_H
# undef HAVE_DOS_H
# undef HAVE_MALLOC_H
# undef HAVE_SHARE_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H
# if (__POCC__ < 280)
# else
# define HAVE_SYS_UTIME_H 1
# endif
#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
# undef HAVE_UTIME_H
# define HAVE_SYS_UTIME_H 1
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
#elif (ACC_CC_SYMANTECC)
# undef HAVE_DIRENT_H /* opendir() not implemented in libc */
# undef HAVE_UNISTD_H /* not working */
# if (__SC__ < 0x700)
# undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H
# endif
#elif (ACC_CC_TOPSPEEDC)
# undef HAVE_DIRENT_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_STAT_H
# undef HAVE_SYS_TIME_H
# undef HAVE_SYS_TYPES_H
#elif (ACC_CC_TURBOC)
# undef HAVE_UNISTD_H
# undef HAVE_SYS_TIME_H
# undef HAVE_SYS_TYPES_H /* useless */
# if (ACC_OS_WIN32 || ACC_OS_WIN64)
# undef HAVE_DIRENT_H /* pulls in <windows.h>; use <dir.h> instead */
# endif
# if (__TURBOC__ < 0x0200)
# undef HAVE_SIGNAL_H /* not working */
# endif
# if (__TURBOC__ < 0x0400)
# undef HAVE_DIRECT_H
# undef HAVE_DIRENT_H
# undef HAVE_MALLOC_H
# undef HAVE_MEMORY_H
# undef HAVE_UTIME_H
# endif
#elif (ACC_CC_WATCOMC)
# undef HAVE_DIRENT_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H
# define HAVE_SYS_UTIME_H 1
# if (__WATCOMC__ < 950)
# undef HAVE_UNISTD_H
# endif
#elif (ACC_CC_ZORTECHC)
# undef HAVE_DIRENT_H
# undef HAVE_MEMORY_H
# undef HAVE_UNISTD_H
# undef HAVE_UTIME_H
# undef HAVE_SYS_TIME_H
#endif
#endif /* DOS, OS/2 & Windows */
#if (HAVE_SYS_TIME_H && HAVE_TIME_H)
# define TIME_WITH_SYS_TIME 1
#endif
#endif /* !defined(ACC_CONFIG_AUTO_NO_HEADERS) */
/*************************************************************************
// Checks for library functions
**************************************************************************/
#if !defined(ACC_CONFIG_AUTO_NO_FUNCTIONS)
#define HAVE_ACCESS 1
#define HAVE_ALLOCA 1
#define HAVE_ATEXIT 1
#define HAVE_ATOI 1
#define HAVE_ATOL 1
#define HAVE_CHMOD 1
#define HAVE_CHOWN 1
#define HAVE_CTIME 1
#define HAVE_DIFFTIME 1
#define HAVE_FILENO 1
#define HAVE_FSTAT 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GMTIME 1
#define HAVE_LOCALTIME 1
#define HAVE_LONGJMP 1
#define HAVE_LSTAT 1
#define HAVE_MEMCMP 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMSET 1
#define HAVE_MKTIME 1
#define HAVE_QSORT 1
#define HAVE_RAISE 1
#define HAVE_SETJMP 1
#define HAVE_SIGNAL 1
#define HAVE_SNPRINTF 1
#define HAVE_STAT 1
#define HAVE_STRCHR 1
#define HAVE_STRDUP 1
#define HAVE_STRERROR 1
#define HAVE_STRFTIME 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_TIME 1
#define HAVE_UMASK 1
#define HAVE_UTIME 1
#define HAVE_VSNPRINTF 1
#if (ACC_OS_BEOS || ACC_OS_CYGWIN || ACC_OS_POSIX || ACC_OS_QNX)
# define HAVE_STRCASECMP 1
# define HAVE_STRNCASECMP 1
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
# define HAVE_STRCASECMP 1
# define HAVE_STRNCASECMP 1
#else
# define HAVE_STRICMP 1
# define HAVE_STRNICMP 1
#endif
#if (ACC_OS_POSIX)
# if (ACC_CC_TINYC)
# undef HAVE_ALLOCA
# elif defined(__dietlibc__)
# endif
# if (ACC_OS_POSIX_MACOSX && ACC_CC_MWERKS) && defined(__MSL__)
/* FIXME ??? */
# undef HAVE_CHOWN
# undef HAVE_LSTAT
# endif
#elif (ACC_OS_CYGWIN)
# if (ACC_CC_GNUC < 0x025a00ul)
# undef HAVE_GETTIMEOFDAY
# undef HAVE_LSTAT
# endif
# if (ACC_CC_GNUC < 0x025f00ul)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# endif
#elif (ACC_OS_EMX)
# undef HAVE_CHOWN
# undef HAVE_LSTAT
#elif (ACC_OS_TOS && ACC_CC_GNUC)
# if !defined(__MINT__)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# endif
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
# undef HAVE_ALLOCA
# undef HAVE_ACCESS
# undef HAVE_CHMOD
# undef HAVE_CHOWN
# undef HAVE_FSTAT
# undef HAVE_GETTIMEOFDAY
# undef HAVE_LSTAT
# undef HAVE_SNPRINTF
# undef HAVE_UMASK
# undef HAVE_UTIME
# undef HAVE_VSNPRINTF
#endif
/* DOS, OS/2 & Windows */
#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
#undef HAVE_CHOWN
#undef HAVE_GETTIMEOFDAY
#undef HAVE_LSTAT
#undef HAVE_UMASK
#if (ACC_CC_AZTECC)
# undef HAVE_ALLOCA
# undef HAVE_DIFFTIME /* difftime() is in the math library */
# undef HAVE_FSTAT
# undef HAVE_STRDUP /* missing in 5.2a */
# undef HAVE_SNPRINTF
# undef HAVE_UTIME /* struct utimbuf is missing */
# undef HAVE_VSNPRINTF
#elif (ACC_CC_BORLANDC)
# if (__BORLANDC__ < 0x0400)
# undef HAVE_ALLOCA
# undef HAVE_UTIME
# endif
# if ((__BORLANDC__ < 0x0410) && ACC_OS_WIN16)
# undef HAVE_ALLOCA
# endif
# if (__BORLANDC__ < 0x0550)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# endif
#elif (ACC_CC_DMC)
# if (ACC_OS_WIN16)
# undef HAVE_ALLOCA
# endif
# define snprintf _snprintf
# define vsnprintf _vsnprintf
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
#elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
#elif (ACC_CC_IBMC)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
#elif (ACC_CC_INTELC)
# define snprintf _snprintf
# define vsnprintf _vsnprintf
#elif (ACC_CC_LCC)
# define utime _utime
#elif (ACC_CC_MSC)
# if (_MSC_VER < 600)
# undef HAVE_STRFTIME
# endif
# if (_MSC_VER < 700)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# else
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# endif
# if ((_MSC_VER < 800) && ACC_OS_WIN16)
# undef HAVE_ALLOCA
# endif
# if (ACC_ARCH_IA16) && defined(__cplusplus)
# undef HAVE_LONGJMP
# undef HAVE_SETJMP
# endif
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
# if (ACC_CC_GNUC < 0x025f00ul)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# else
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# endif
#elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
# if (__MSL__ < 0x8000ul)
# undef HAVE_CHMOD /* <unix.h> which in turn pulls in <windows.h> */
# endif
#elif (ACC_CC_NDPC)
# undef HAVE_ALLOCA
# undef HAVE_SNPRINTF
# undef HAVE_STRNICMP
# undef HAVE_UTIME
# undef HAVE_VSNPRINTF
# if defined(__cplusplus)
# undef HAVE_STAT
# endif
#elif (ACC_CC_PACIFICC)
# undef HAVE_ACCESS
# undef HAVE_ALLOCA
# undef HAVE_CHMOD
# undef HAVE_DIFFTIME
# undef HAVE_FSTAT
# undef HAVE_MKTIME
# undef HAVE_RAISE
# undef HAVE_SNPRINTF
# undef HAVE_STRFTIME
# undef HAVE_UTIME
# undef HAVE_VSNPRINTF
#elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
# if (__POCC__ < 280)
# define alloca _alloca
# undef HAVE_UTIME
# endif
#elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
# define snprintf _snprintf
# define vsnprintf _vsnprintf
#elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
#elif (ACC_CC_SYMANTECC)
# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
# undef HAVE_ALLOCA
# endif
# if (__SC__ < 0x600)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# else
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# endif
# if (__SC__ < 0x700)
# undef HAVE_DIFFTIME /* difftime() is broken */
# undef HAVE_UTIME /* struct utimbuf is missing */
# endif
#elif (ACC_CC_TOPSPEEDC)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
#elif (ACC_CC_TURBOC)
# undef HAVE_ALLOCA
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# if (__TURBOC__ < 0x0200)
# undef HAVE_RAISE
# undef HAVE_SIGNAL
# endif
# if (__TURBOC__ < 0x0295)
# undef HAVE_MKTIME
# undef HAVE_STRFTIME
# endif
# if (__TURBOC__ < 0x0400)
# undef HAVE_UTIME
# endif
#elif (ACC_CC_WATCOMC)
# if (__WATCOMC__ < 1100)
# undef HAVE_SNPRINTF
# undef HAVE_VSNPRINTF
# elif (__WATCOMC__ < 1200)
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# endif
#elif (ACC_CC_ZORTECHC)
# if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
# undef HAVE_ALLOCA
# endif
# undef HAVE_DIFFTIME /* difftime() is broken */
# undef HAVE_SNPRINTF
# undef HAVE_UTIME /* struct utimbuf is missing */
# undef HAVE_VSNPRINTF
#endif
#endif /* DOS, OS/2 & Windows */
#endif /* !defined(ACC_CONFIG_AUTO_NO_FUNCTIONS) */
/*************************************************************************
// Checks for sizes
**************************************************************************/
#if !defined(ACC_CONFIG_AUTO_NO_SIZES)
#define SIZEOF_SHORT (__ACC_SHORT_BIT / 8)
#define SIZEOF_INT (__ACC_INT_BIT / 8)
#define SIZEOF_LONG (__ACC_LONG_BIT / 8)
#if (ACC_OS_WIN64) /* LLP64 programming model */
# define SIZEOF_PTRDIFF_T 8
# define SIZEOF_SIZE_T 8
# define SIZEOF_VOID_P 8
#elif (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
# define SIZEOF_SIZE_T 2
# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
# define SIZEOF_VOID_P 2
# elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
# define SIZEOF_VOID_P 4
# else
# error "ACC_MM"
# endif
# if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
# define SIZEOF_PTRDIFF_T 2
# elif (ACC_MM_COMPACT || ACC_MM_LARGE)
# if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
# define SIZEOF_PTRDIFF_T 4
# else
# define SIZEOF_PTRDIFF_T 2
# endif
# elif (ACC_MM_HUGE)
# define SIZEOF_PTRDIFF_T 4
# else
# error "ACC_MM"
# endif
#elif (ACC_ARCH_AVR || ACC_ARCH_C166 || ACC_ARCH_MCS51 || ACC_ARCH_MCS251)
# define SIZEOF_PTRDIFF_T 2
# define SIZEOF_SIZE_T 2
# define SIZEOF_VOID_P 2
#else
# define SIZEOF_PTRDIFF_T SIZEOF_LONG
# define SIZEOF_SIZE_T SIZEOF_LONG
# define SIZEOF_VOID_P SIZEOF_LONG
#endif
#if !defined(SIZEOF_CHAR_P) && (SIZEOF_VOID_P > 0)
# define SIZEOF_CHAR_P SIZEOF_VOID_P
#endif
#if ((SIZEOF_LONG) > 0 && (SIZEOF_LONG) < 8)
#if (ACC_ARCH_IA16 && ACC_CC_DMC)
#elif (ACC_CC_GNUC)
# define SIZEOF_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG_LONG 8
#elif ((ACC_OS_WIN32 || ACC_OS_WIN64) && ACC_CC_MSC && (_MSC_VER >= 1400))
# define SIZEOF_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG_LONG 8
#elif (ACC_OS_WIN64)
# define SIZEOF___INT64 8
# define SIZEOF_UNSIGNED___INT64 8
#elif (ACC_ARCH_IA32 && (ACC_CC_DMC))
# define SIZEOF_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG_LONG 8
#elif (ACC_ARCH_IA32 && (ACC_CC_SYMANTECC && (__SC__ >= 0x700)))
# define SIZEOF_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG_LONG 8
#elif (ACC_ARCH_IA32 && (ACC_CC_INTELC && defined(__linux__)))
# define SIZEOF_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG_LONG 8
#elif (ACC_ARCH_IA32 && (ACC_CC_MWERKS || ACC_CC_PELLESC || ACC_CC_PGI))
# define SIZEOF_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG_LONG 8
#elif (ACC_ARCH_IA32 && (ACC_CC_INTELC || ACC_CC_MSC))
# define SIZEOF___INT64 8
# define SIZEOF_UNSIGNED___INT64 8
#elif (ACC_ARCH_IA32 && (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
/* INFO: unsigned __int64 is somewhat broken in 0x0520; fixed in 0x0530 */
# define SIZEOF___INT64 8
# define SIZEOF_UNSIGNED___INT64 8
#elif (ACC_ARCH_IA32 && (ACC_CC_WATCOMC && (__WATCOMC__ >= 1100)))
# define SIZEOF___INT64 8
# define SIZEOF_UNSIGNED___INT64 8
#elif (ACC_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
# define SIZEOF___INT64 8
# define SIZEOF_UNSIGNED___INT64 8
#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define SIZEOF_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG_LONG 8
#endif
#endif
#if defined(__cplusplus) && defined(ACC_CC_GNUC)
# if (ACC_CC_GNUC < 0x020800ul)
# undef SIZEOF_LONG_LONG
# undef SIZEOF_UNSIGNED_LONG_LONG
# endif
#endif
#endif /* !defined(ACC_CONFIG_AUTO_NO_SIZES) */
/*************************************************************************
// misc
**************************************************************************/
#if defined(HAVE_SIGNAL) && !defined(RETSIGTYPE)
# define RETSIGTYPE void
#endif
/*
vi:ts=4:et
*/
-143
View File
@@ -1,143 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*
* C/C++ Compiler - exactly one of:
*
* ACC_CC_UNKNOWN [default]
* ACC_CC_GNUC
* ...
*/
#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
# define ACC_CC_CILLY 1
# define ACC_INFO_CC "Cilly"
# define ACC_INFO_CCVER "unknown"
#elif defined(__INTEL_COMPILER)
# define ACC_CC_INTELC 1
# define ACC_INFO_CC "Intel C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__INTEL_COMPILER)
#elif defined(__POCC__)
# define ACC_CC_PELLESC 1
# define ACC_INFO_CC "Pelles C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__POCC__)
#elif defined(__GNUC__) && defined(__VERSION__)
# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
# elif defined(__GNUC_MINOR__)
# define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
# else
# define ACC_CC_GNUC (__GNUC__ * 0x10000L)
# endif
# define ACC_INFO_CC "gcc"
# define ACC_INFO_CCVER __VERSION__
#elif defined(__AZTEC_C__)
# define ACC_CC_AZTECC 1
# define ACC_INFO_CC "Aztec C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__AZTEC_C__)
#elif defined(__BORLANDC__)
# define ACC_CC_BORLANDC 1
# define ACC_INFO_CC "Borland C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__BORLANDC__)
#elif defined(__DMC__)
# define ACC_CC_DMC 1
# define ACC_INFO_CC "Digital Mars C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__DMC__)
#elif defined(__DECC)
# define ACC_CC_DECC 1
# define ACC_INFO_CC "DEC C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__DECC)
#elif defined(__HIGHC__)
# define ACC_CC_HIGHC 1
# define ACC_INFO_CC "MetaWare High C"
# define ACC_INFO_CCVER "unknown"
#elif defined(__IBMC__)
# define ACC_CC_IBMC 1
# define ACC_INFO_CC "IBM C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__IBMC__)
#elif defined(__KEIL__) && defined(__C166__)
# define ACC_CC_KEILC 1
# define ACC_INFO_CC "Keil C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__C166__)
#elif defined(__LCC__)
# define ACC_CC_LCC 1
# define ACC_INFO_CC "lcc"
# define ACC_INFO_CCVER "unknown"
#elif defined(_MSC_VER)
# define ACC_CC_MSC 1
# define ACC_INFO_CC "Microsoft C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(_MSC_VER)
#elif defined(__MWERKS__)
# define ACC_CC_MWERKS 1
# define ACC_INFO_CC "Metrowerks C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__MWERKS__)
#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
# define ACC_CC_NDPC 1
# define ACC_INFO_CC "Microway NDP C"
# define ACC_INFO_CCVER "unknown"
#elif defined(__PACIFIC__)
# define ACC_CC_PACIFICC 1
# define ACC_INFO_CC "Pacific C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__PACIFIC__)
#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
# define ACC_CC_PGI 1
# define ACC_INFO_CC "Portland Group PGI C"
# define ACC_INFO_CCVER "unknown"
#elif defined(__PUREC__)
# define ACC_CC_PUREC 1
# define ACC_INFO_CC "Pure C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__PUREC__)
#elif defined(__SC__)
# define ACC_CC_SYMANTECC 1
# define ACC_INFO_CC "Symantec C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__SC__)
#elif defined(__SUNPRO_C)
# define ACC_CC_SUNPROC 1
# define ACC_INFO_CC "Sun C"
# define ACC_INFO_CCVER "unknown"
#elif defined(__TINYC__)
# define ACC_CC_TINYC 1
# define ACC_INFO_CC "Tiny C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__TINYC__)
#elif defined(__TSC__)
# define ACC_CC_TOPSPEEDC 1
# define ACC_INFO_CC "TopSpeed C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__TSC__)
#elif defined(__WATCOMC__)
# define ACC_CC_WATCOMC 1
# define ACC_INFO_CC "Watcom C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__WATCOMC__)
#elif defined(__TURBOC__)
# define ACC_CC_TURBOC 1
# define ACC_INFO_CC "Turbo C"
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__TURBOC__)
#elif defined(__ZTC__)
# define ACC_CC_ZORTECHC 1
# define ACC_INFO_CC "Zortech C"
# if (__ZTC__ == 0x310)
# define ACC_INFO_CCVER "0x310"
# else
# define ACC_INFO_CCVER ACC_CPP_MACRO_EXPAND(__ZTC__)
# endif
#else
# define ACC_CC_UNKNOWN 1
# define ACC_INFO_CC "unknown"
# define ACC_INFO_CCVER "unknown"
#endif
/*
vi:ts=4:et
*/
-455
View File
@@ -1,455 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*************************************************************************
//
**************************************************************************/
#if !defined(ACCCHK_ASSERT)
# define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
#endif
/* compile-time sign */
#if !defined(ACCCHK_ASSERT_SIGN_T)
# define ACCCHK_ASSERT_SIGN_T(type,relop) \
ACCCHK_ASSERT( (type) (-1) relop (type) 0 ) \
ACCCHK_ASSERT( (type) (~(type)0) relop (type) 0 ) \
ACCCHK_ASSERT( (type) (~(type)0) == (type) (-1) )
#endif
#if !defined(ACCCHK_IS_SIGNED_T)
# define ACCCHK_ASSERT_IS_SIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,<)
#endif
#if !defined(ACCCHK_IS_UNSIGNED_T)
# if (ACC_BROKEN_INTEGRAL_PROMOTION)
# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) \
ACCCHK_ASSERT( (type) (-1) > (type) 0 )
# else
# define ACCCHK_ASSERT_IS_UNSIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,>)
# endif
#endif
/*************************************************************************
// check preprocessor
**************************************************************************/
#if (ACC_0xffffffffL - ACC_UINT32L_C(4294967294) != 1)
# error "preprocessor error 1"
#endif
#if (ACC_0xffffffffL - ACC_UINT32L_C(0xfffffffd) != 2)
# error "preprocessor error 2"
#endif
#define ACCCHK_VAL 1
#define ACCCHK_TMP1 ACCCHK_VAL
#undef ACCCHK_VAL
#define ACCCHK_VAL 2
#define ACCCHK_TMP2 ACCCHK_VAL
#if (ACCCHK_TMP1 != 2)
# error "preprocessor error 3a"
#endif
#if (ACCCHK_TMP2 != 2)
# error "preprocessor error 3b"
#endif
#undef ACCCHK_VAL
#if (ACCCHK_TMP2)
# error "preprocessor error 3c"
#endif
#if (ACCCHK_TMP2 + 0 != 0)
# error "preprocessor error 3d"
#endif
#undef ACCCHK_TMP1
#undef ACCCHK_TMP2
/*************************************************************************
// check basic arithmetics
**************************************************************************/
ACCCHK_ASSERT(1 == 1)
ACCCHK_ASSERT(__ACC_INT_MAX(2) == 1)
ACCCHK_ASSERT(__ACC_INT_MAX(8) == 127)
ACCCHK_ASSERT(__ACC_INT_MAX(16) == 32767)
ACCCHK_ASSERT(__ACC_UINT_MAX(2) == 3)
ACCCHK_ASSERT(__ACC_UINT_MAX(16) == 0xffffU)
ACCCHK_ASSERT(__ACC_UINT_MAX(32) == 0xffffffffUL)
#if !defined(ACC_BROKEN_INTEGRAL_PROMOTION)
ACCCHK_ASSERT(__ACC_UINT_MAX(__ACC_INT_BIT) == ~(0u))
ACCCHK_ASSERT(__ACC_UINT_MAX(__ACC_LONG_BIT) == ~(0ul))
#endif
/*************************************************************************
// check basic types
**************************************************************************/
ACCCHK_ASSERT_IS_SIGNED_T(signed char)
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned char)
ACCCHK_ASSERT(sizeof(signed char) == sizeof(char))
ACCCHK_ASSERT(sizeof(unsigned char) == sizeof(char))
ACCCHK_ASSERT(sizeof(char) == 1)
#if (ACC_CC_CILLY)
/* CIL is broken */
#else
ACCCHK_ASSERT(sizeof(char) == sizeof((char)0))
#endif
#if defined(__cplusplus)
ACCCHK_ASSERT(sizeof('\0') == sizeof(char))
#else
# if (ACC_CC_DMC)
/* Digital Mars C is broken */
# else
ACCCHK_ASSERT(sizeof('\0') == sizeof(int))
# endif
#endif
#if defined(acc_alignof)
ACCCHK_ASSERT(acc_alignof(char) == 1)
ACCCHK_ASSERT(acc_alignof(signed char) == 1)
ACCCHK_ASSERT(acc_alignof(unsigned char) == 1)
#endif
ACCCHK_ASSERT_IS_SIGNED_T(short)
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned short)
ACCCHK_ASSERT(sizeof(short) == sizeof(unsigned short))
ACCCHK_ASSERT(sizeof(short) >= 2)
ACCCHK_ASSERT(sizeof(short) >= sizeof(char))
#if (ACC_CC_CILLY)
/* CIL is broken */
#else
ACCCHK_ASSERT(sizeof(short) == sizeof((short)0))
#endif
#if (SIZEOF_SHORT > 0)
ACCCHK_ASSERT(sizeof(short) == SIZEOF_SHORT)
#endif
ACCCHK_ASSERT_IS_SIGNED_T(int)
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned int)
ACCCHK_ASSERT(sizeof(int) == sizeof(unsigned int))
ACCCHK_ASSERT(sizeof(int) >= 2)
ACCCHK_ASSERT(sizeof(int) >= sizeof(short))
ACCCHK_ASSERT(sizeof(int) == sizeof(0))
ACCCHK_ASSERT(sizeof(int) == sizeof((int)0))
#if (SIZEOF_INT > 0)
ACCCHK_ASSERT(sizeof(int) == SIZEOF_INT)
#endif
ACCCHK_ASSERT_IS_SIGNED_T(long)
ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned long)
ACCCHK_ASSERT(sizeof(long) == sizeof(unsigned long))
ACCCHK_ASSERT(sizeof(long) >= 4)
ACCCHK_ASSERT(sizeof(long) >= sizeof(int))
ACCCHK_ASSERT(sizeof(long) == sizeof(0L))
ACCCHK_ASSERT(sizeof(long) == sizeof((long)0))
#if (SIZEOF_LONG > 0)
ACCCHK_ASSERT(sizeof(long) == SIZEOF_LONG)
#endif
ACCCHK_ASSERT_IS_UNSIGNED_T(size_t)
ACCCHK_ASSERT(sizeof(size_t) >= sizeof(int))
ACCCHK_ASSERT(sizeof(size_t) == sizeof(sizeof(0))) /* sizeof() returns size_t */
#if (SIZEOF_SIZE_T > 0)
ACCCHK_ASSERT(sizeof(size_t) == SIZEOF_SIZE_T)
#endif
ACCCHK_ASSERT_IS_SIGNED_T(ptrdiff_t)
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
#if !defined(ACC_BROKEN_SIZEOF)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof((char*)0 - (char*)0))
# if (ACC_HAVE_MM_HUGE_PTR)
ACCCHK_ASSERT(4 == sizeof((char __huge*)0 - (char __huge*)0))
# endif
#endif
#if (SIZEOF_PTRDIFF_T > 0)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == SIZEOF_PTRDIFF_T)
#endif
ACCCHK_ASSERT(sizeof(void*) >= sizeof(char*))
#if (SIZEOF_VOID_P > 0)
ACCCHK_ASSERT(sizeof(void*) == SIZEOF_VOID_P)
#endif
#if (SIZEOF_CHAR_P > 0)
ACCCHK_ASSERT(sizeof(char*) == SIZEOF_CHAR_P)
#endif
#if (ACC_HAVE_MM_HUGE_PTR)
ACCCHK_ASSERT(4 == sizeof(void __huge*))
ACCCHK_ASSERT(4 == sizeof(char __huge*))
#endif
/*************************************************************************
// check arithmetics
**************************************************************************/
ACCCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
ACCCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
#if (ACC_CC_TURBOC && (__TURBOC__ < 0x0150))
/* TC 1.0 bug, probably due to ACC_BROKEN_INTEGRAL_PROMOTION ?? */
#else
ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
#endif
ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0)
ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0)
ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
#if defined(acc_int32e_t)
ACCCHK_ASSERT(sizeof(acc_int32e_t) == 4)
ACCCHK_ASSERT(sizeof(acc_int32e_t) == SIZEOF_ACC_INT32E_T)
ACCCHK_ASSERT(sizeof(acc_uint32e_t) == 4)
ACCCHK_ASSERT(sizeof(acc_int32e_t) == sizeof(acc_uint32e_t))
ACCCHK_ASSERT_IS_SIGNED_T(acc_int32e_t)
ACCCHK_ASSERT(((( (acc_int32e_t)1 << 30) + 1) >> 30) == 1)
ACCCHK_ASSERT(((( ACC_INT32E_C(1) << 30) + 1) >> 30) == 1)
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32e_t)
ACCCHK_ASSERT(((( (acc_uint32e_t)1 << 31) + 1) >> 31) == 1)
ACCCHK_ASSERT(((( ACC_UINT32E_C(1) << 31) + 1) >> 31) == 1)
ACCCHK_ASSERT( (acc_int32e_t) (1 + ~(acc_int32e_t)0) == 0)
#if defined(ACCCHK_CONFIG_PEDANTIC)
/* compiler may warn about overflow */
ACCCHK_ASSERT( (acc_uint32e_t)(1 + ~(acc_uint32e_t)0) == 0)
#endif /* ACCCHK_CONFIG_PEDANTIC */
#if (SIZEOF_ACC_INT32E_T < SIZEOF_INT)
ACCCHK_ASSERT(sizeof(ACC_INT32E_C(0)) == sizeof(int))
ACCCHK_ASSERT(sizeof(ACC_UINT32E_C(0)) == sizeof(int))
#else
ACCCHK_ASSERT(sizeof(ACC_INT32E_C(0)) == SIZEOF_ACC_INT32E_T)
ACCCHK_ASSERT(sizeof(ACC_UINT32E_C(0)) == SIZEOF_ACC_INT32E_T)
#endif
ACCCHK_ASSERT((ACC_INT32E_C(1) << (8*SIZEOF_ACC_INT32E_T-1)) < 0)
ACCCHK_ASSERT((ACC_UINT32E_C(1) << (8*SIZEOF_ACC_INT32E_T-1)) > 0)
ACCCHK_ASSERT((ACC_INT32E_C(1) << (int)(8*sizeof(ACC_INT32E_C(1))-1)) < 0)
ACCCHK_ASSERT((ACC_UINT32E_C(1) << (int)(8*sizeof(ACC_UINT32E_C(1))-1)) > 0)
ACCCHK_ASSERT(ACC_INT32E_C(2147483647) > 0)
ACCCHK_ASSERT(ACC_INT32E_C(-2147483647) -1 < 0)
ACCCHK_ASSERT(ACC_UINT32E_C(4294967295) > 0)
ACCCHK_ASSERT(ACC_UINT32E_C(4294967295) == ACC_0xffffffffL)
#endif
ACCCHK_ASSERT(sizeof(acc_int32l_t) >= sizeof(int))
#if defined(acc_int32e_t)
ACCCHK_ASSERT(sizeof(acc_int32l_t) >= sizeof(acc_int32e_t))
#endif
ACCCHK_ASSERT(sizeof(acc_int32l_t) >= 4)
ACCCHK_ASSERT(sizeof(acc_int32l_t) == SIZEOF_ACC_INT32L_T)
ACCCHK_ASSERT(sizeof(acc_uint32l_t) >= 4)
ACCCHK_ASSERT(sizeof(acc_int32l_t) == sizeof(acc_uint32l_t))
ACCCHK_ASSERT_IS_SIGNED_T(acc_int32l_t)
ACCCHK_ASSERT(((( (acc_int32l_t)1 << 30) + 1) >> 30) == 1)
ACCCHK_ASSERT(((( ACC_INT32L_C(1) << 30) + 1) >> 30) == 1)
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32l_t)
ACCCHK_ASSERT(((( (acc_uint32l_t)1 << 31) + 1) >> 31) == 1)
ACCCHK_ASSERT(((( ACC_UINT32L_C(1) << 31) + 1) >> 31) == 1)
#if (SIZEOF_ACC_INT32L_T < SIZEOF_INT)
ACCCHK_ASSERT(sizeof(ACC_INT32L_C(0)) == sizeof(int))
ACCCHK_ASSERT(sizeof(ACC_UINT32L_C(0)) == sizeof(int))
#else
ACCCHK_ASSERT(sizeof(ACC_INT32L_C(0)) == SIZEOF_ACC_INT32L_T)
ACCCHK_ASSERT(sizeof(ACC_UINT32L_C(0)) == SIZEOF_ACC_INT32L_T)
#endif
ACCCHK_ASSERT((ACC_INT32L_C(1) << (8*SIZEOF_ACC_INT32L_T-1)) < 0)
ACCCHK_ASSERT((ACC_UINT32L_C(1) << (8*SIZEOF_ACC_INT32L_T-1)) > 0)
ACCCHK_ASSERT((ACC_INT32L_C(1) << (int)(8*sizeof(ACC_INT32L_C(1))-1)) < 0)
ACCCHK_ASSERT((ACC_UINT32L_C(1) << (int)(8*sizeof(ACC_UINT32L_C(1))-1)) > 0)
ACCCHK_ASSERT(ACC_INT32L_C(2147483647) > 0)
ACCCHK_ASSERT(ACC_INT32L_C(-2147483647) -1 < 0)
ACCCHK_ASSERT(ACC_UINT32L_C(4294967295) > 0)
ACCCHK_ASSERT(ACC_UINT32L_C(4294967295) == ACC_0xffffffffL)
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(int))
#if defined(acc_int32e_t)
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32e_t))
#endif
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= 4)
ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
ACCCHK_ASSERT(sizeof(acc_int32f_t) == SIZEOF_ACC_INT32F_T)
ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= 4)
ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= sizeof(acc_uint32l_t))
ACCCHK_ASSERT(sizeof(acc_int32f_t) == sizeof(acc_uint32f_t))
ACCCHK_ASSERT_IS_SIGNED_T(acc_int32f_t)
ACCCHK_ASSERT(((( (acc_int32f_t)1 << 30) + 1) >> 30) == 1)
ACCCHK_ASSERT(((( ACC_INT32F_C(1) << 30) + 1) >> 30) == 1)
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32f_t)
ACCCHK_ASSERT(((( (acc_uint32f_t)1 << 31) + 1) >> 31) == 1)
ACCCHK_ASSERT(((( ACC_UINT32F_C(1) << 31) + 1) >> 31) == 1)
#if (SIZEOF_ACC_INT32F_T < SIZEOF_INT)
ACCCHK_ASSERT(sizeof(ACC_INT32F_C(0)) == sizeof(int))
ACCCHK_ASSERT(sizeof(ACC_UINT32F_C(0)) == sizeof(int))
#else
ACCCHK_ASSERT(sizeof(ACC_INT32F_C(0)) == SIZEOF_ACC_INT32F_T)
ACCCHK_ASSERT(sizeof(ACC_UINT32F_C(0)) == SIZEOF_ACC_INT32F_T)
#endif
ACCCHK_ASSERT((ACC_INT32F_C(1) << (8*SIZEOF_ACC_INT32F_T-1)) < 0)
ACCCHK_ASSERT((ACC_UINT32F_C(1) << (8*SIZEOF_ACC_INT32F_T-1)) > 0)
ACCCHK_ASSERT((ACC_INT32F_C(1) << (int)(8*sizeof(ACC_INT32F_C(1))-1)) < 0)
ACCCHK_ASSERT((ACC_UINT32F_C(1) << (int)(8*sizeof(ACC_UINT32F_C(1))-1)) > 0)
ACCCHK_ASSERT(ACC_INT32F_C(2147483647) > 0)
ACCCHK_ASSERT(ACC_INT32F_C(-2147483647) -1 < 0)
ACCCHK_ASSERT(ACC_UINT32F_C(4294967295) > 0)
ACCCHK_ASSERT(ACC_UINT32F_C(4294967295) == ACC_0xffffffffL)
#if defined(acc_int64l_t)
ACCCHK_ASSERT(sizeof(acc_int64l_t) >= 8)
ACCCHK_ASSERT(sizeof(acc_int64l_t) == SIZEOF_ACC_INT64L_T)
ACCCHK_ASSERT(sizeof(acc_uint64l_t) >= 8)
ACCCHK_ASSERT(sizeof(acc_int64l_t) == sizeof(acc_uint64l_t))
ACCCHK_ASSERT_IS_SIGNED_T(acc_int64l_t)
ACCCHK_ASSERT(((( (acc_int64l_t)1 << 62) + 1) >> 62) == 1)
ACCCHK_ASSERT(((( ACC_INT64L_C(1) << 62) + 1) >> 62) == 1)
#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530))
/* Borland C is broken */
#else
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64l_t)
ACCCHK_ASSERT(ACC_UINT64L_C(18446744073709551615) > 0)
#endif
ACCCHK_ASSERT(((( (acc_uint64l_t)1 << 63) + 1) >> 63) == 1)
ACCCHK_ASSERT(((( ACC_UINT64L_C(1) << 63) + 1) >> 63) == 1)
#if defined(ACCCHK_CONFIG_PEDANTIC)
#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0560))
/* Borland C is broken */
#elif (SIZEOF_ACC_INT64L_T < SIZEOF_INT)
ACCCHK_ASSERT(sizeof(ACC_INT64L_C(0)) == sizeof(int))
ACCCHK_ASSERT(sizeof(ACC_UINT64L_C(0)) == sizeof(int))
#else
ACCCHK_ASSERT(sizeof(ACC_INT64L_C(0)) == SIZEOF_ACC_INT64L_T)
ACCCHK_ASSERT(sizeof(ACC_UINT64L_C(0)) == SIZEOF_ACC_INT64L_T)
#endif
#endif /* ACCCHK_CONFIG_PEDANTIC */
ACCCHK_ASSERT((ACC_INT64L_C(1) << (8*SIZEOF_ACC_INT64L_T-1)) < 0)
ACCCHK_ASSERT((ACC_UINT64L_C(1) << (8*SIZEOF_ACC_INT64L_T-1)) > 0)
#if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020600ul))
/* avoid pedantic warning */
ACCCHK_ASSERT(ACC_INT64L_C(9223372036854775807) > ACC_INT64L_C(0))
#else
ACCCHK_ASSERT(ACC_INT64L_C(9223372036854775807) > 0)
#endif
ACCCHK_ASSERT(ACC_INT64L_C(-9223372036854775807) - 1 < 0)
ACCCHK_ASSERT( ACC_INT64L_C(9223372036854775807) % 2147483629l == 721)
ACCCHK_ASSERT( ACC_INT64L_C(9223372036854775807) % 2147483647l == 1)
ACCCHK_ASSERT(ACC_UINT64L_C(9223372036854775807) % 2147483629ul == 721)
ACCCHK_ASSERT(ACC_UINT64L_C(9223372036854775807) % 2147483647ul == 1)
#endif /* acc_int64l_t */
ACCCHK_ASSERT_IS_SIGNED_T(acc_intptr_t)
ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uintptr_t)
ACCCHK_ASSERT(sizeof(acc_intptr_t) >= sizeof(void *))
ACCCHK_ASSERT(sizeof(acc_intptr_t) == SIZEOF_ACC_INTPTR_T)
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(acc_uintptr_t))
/*************************************************************************
// check memory model ACC_MM
**************************************************************************/
#if (ACC_MM_FLAT)
#if 0
/* this is not a valid assumption -- disabled */
ACCCHK_ASSERT(sizeof(void*) == sizeof(void (*)(void)))
#endif
#endif
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
ACCCHK_ASSERT(sizeof(void*) == 2)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 2)
#elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
ACCCHK_ASSERT(sizeof(void*) == 4)
#endif
#if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_COMPACT)
ACCCHK_ASSERT(sizeof(void (*)(void)) == 2)
#elif (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE)
ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
#endif
/*************************************************************************
// check ACC_ARCH and ACC_OS
**************************************************************************/
#if (ACC_ARCH_IA16)
ACCCHK_ASSERT(sizeof(size_t) == 2)
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
#elif (ACC_ARCH_IA32 || ACC_ARCH_M68K)
ACCCHK_ASSERT(sizeof(size_t) == 4)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
#elif (ACC_ARCH_AMD64 || ACC_ARCH_IA64)
ACCCHK_ASSERT(sizeof(size_t) == 8)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8)
ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
#endif
#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32)
ACCCHK_ASSERT(sizeof(size_t) == 4)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
#elif (ACC_OS_WIN64)
ACCCHK_ASSERT(sizeof(size_t) == 8)
ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8)
ACCCHK_ASSERT(sizeof(void (*)(void)) == 8)
#endif
/*************************************************************************
// check promotion rules
**************************************************************************/
#if (ACC_CC_NDPC)
/* NDP C is broken */
#else
/* check that the compiler correctly casts signed to unsigned */
ACCCHK_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255)
#endif
#if (ACC_CC_KEILC)
/* Keil C is broken */
#elif (ACC_CC_NDPC)
/* NDP C is broken */
#elif !defined(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
/* check that the compiler correctly promotes integrals */
ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
#endif
/*
vi:ts=4:et
*/
-126
View File
@@ -1,126 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*************************************************************************
//
**************************************************************************/
#if !defined(__ACCCHKR_FUNCNAME)
# define __ACCCHKR_FUNCNAME(f) accchkr_ ## f
#endif
#if !defined(ACCCHKR_ASSERT)
#if 0 || defined(ACCCHKR_CONFIG_DEBUG)
#include <stdio.h>
static int __ACCCHKR_FUNCNAME(assert_fail)(const char* s, unsigned l)
{
fprintf(stderr, "ACCCHKR assertion failed in line %u: `%s'\n", l, s);
return 0;
}
#define ACCCHKR_ASSERT(expr) ((expr) ? 1 : __ACCCHKR_FUNCNAME(assert_fail)(#expr,__LINE__))
#else
#define ACCCHKR_ASSERT(expr) ((expr) ? 1 : 0)
#endif
#endif
/* avoid inlining */
static int __ACCCHKR_FUNCNAME(schedule_insns_bug)(void);
static int __ACCCHKR_FUNCNAME(strength_reduce_bug)(int*);
/*************************************************************************
// main entry
**************************************************************************/
static int __ACCCHKR_FUNCNAME(check)(int r)
{
#if defined(ACC_ENDIAN_BIG_ENDIAN)
{
union { long l; unsigned char c[sizeof(long)]; } u;
u.l = 0; u.c[sizeof(long)-1] = 0x80;
r &= ACCCHKR_ASSERT(u.l == 128);
u.l = 0; u.c[0] = 0x80;
r &= ACCCHKR_ASSERT(u.l < 0);
ACC_UNUSED(u);
}
#endif
#if defined(ACC_ENDIAN_LITTLE_ENDIAN)
{
union { long l; unsigned char c[sizeof(long)]; } u;
u.l = 0; u.c[0] = 0x80;
r &= ACCCHKR_ASSERT(u.l == 128);
u.l = 0; u.c[sizeof(long)-1] = 0x80;
r &= ACCCHKR_ASSERT(u.l < 0);
ACC_UNUSED(u);
}
#endif
/* check for the gcc schedule-insns optimization bug */
if (r == 1)
{
r &= ACCCHKR_ASSERT(!__ACCCHKR_FUNCNAME(schedule_insns_bug()));
}
/* check for the gcc strength-reduce optimization bug */
if (r == 1)
{
static int x[3];
static unsigned xn = 3;
register unsigned j;
for (j = 0; j < xn; j++)
x[j] = (int)j - 3;
r &= ACCCHKR_ASSERT(!__ACCCHKR_FUNCNAME(strength_reduce_bug(x)));
}
return r;
}
/*************************************************************************
//
**************************************************************************/
static int __ACCCHKR_FUNCNAME(schedule_insns_bug)(void)
{
const int a[] = {1, 2, 0}; const int* b;
b = a; return (*b) ? 0 : 1;
}
static int __ACCCHKR_FUNCNAME(strength_reduce_bug)(int* x)
{
#if 0 && (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
ACC_UNUSED(x); return 0;
#else
return x[0] != -3 || x[1] != -2 || x[2] != -1;
#endif
}
/*
vi:ts=4:et
*/
-157
View File
@@ -1,157 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
#ifndef __ACC_CXX_H_INCLUDED
#define __ACC_CXX_H_INCLUDED 1
#if defined(__cplusplus)
/*************************************************************************
// exception specification
// ACC_CXX_NOTHROW
**************************************************************************/
#if defined(ACC_CXX_NOTHROW)
#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul))
#elif (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
#elif (ACC_CC_HIGHC)
#elif (ACC_CC_MSC && (_MSC_VER < 1100))
#elif (ACC_CC_NDPC)
#elif (ACC_CC_TURBOC)
#elif (ACC_CC_WATCOMC && !defined(_CPPUNWIND))
#elif (ACC_CC_ZORTECHC)
#else
# define ACC_CXX_NOTHROW throw()
#endif
#if !defined(ACC_CXX_NOTHROW)
# define ACC_CXX_NOTHROW
#endif
/*************************************************************************
// disable dynamic allocation of an object - private helpers
// __ACC_CXX_DO_NEW
// __ACC_CXX_DO_DELETE
**************************************************************************/
#if defined(__ACC_CXX_DO_NEW)
#elif (ACC_CC_NDPC || ACC_CC_PGI)
# define __ACC_CXX_DO_NEW { return 0; }
#else
# define __ACC_CXX_DO_NEW ;
#endif
/* need an implementation in case a class has virtual members */
#if defined(__ACC_CXX_DO_DELETE)
#elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
# define __ACC_CXX_DO_DELETE { }
#else
# define __ACC_CXX_DO_DELETE ACC_CXX_NOTHROW { }
#endif
/*************************************************************************
// disable dynamic allocation of an object
// ACC_CXX_DISABLE_NEW_DELETE
**************************************************************************/
/*
#undef __ACC_CXX_HAVE_ARRAY_NEW
#undef __ACC_CXX_HAVE_PLACEMENT_NEW
#undef __ACC_CXX_HAVE_PLACEMENT_DELETE
*/
#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
#elif (ACC_CC_MSC && ACC_MM_HUGE)
# define ACC_CXX_DISABLE_NEW_DELETE private:
#elif (ACC_CC_MSC && (_MSC_VER < 1100))
#elif (ACC_CC_NDPC)
#elif (ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
#elif (ACC_CC_TURBOC)
#elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100))
#else
# define __ACC_CXX_HAVE_ARRAY_NEW 1
#endif
#if (__ACC_CXX_HAVE_ARRAY_NEW)
# define __ACC_CXX_HAVE_PLACEMENT_NEW 1
#endif
#if (__ACC_CXX_HAVE_PLACEMENT_NEW)
# if (ACC_CC_GNUC >= 0x030000ul)
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_INTELC)
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_MSC && (_MSC_VER >= 1200))
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# elif (ACC_CC_PGI)
# define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
# endif
#endif
#if defined(ACC_CXX_DISABLE_NEW_DELETE)
#elif defined(new) || defined(delete)
# define ACC_CXX_DISABLE_NEW_DELETE private:
#elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025b00ul))
# define ACC_CXX_DISABLE_NEW_DELETE private:
#elif (ACC_CC_HIGHC)
# define ACC_CXX_DISABLE_NEW_DELETE private:
#elif !defined(__ACC_CXX_HAVE_ARRAY_NEW)
/* for old compilers use `protected' instead of `private' */
# define ACC_CXX_DISABLE_NEW_DELETE \
protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
protected: static void* operator new(size_t) __ACC_CXX_DO_NEW \
private:
#else
# define ACC_CXX_DISABLE_NEW_DELETE \
protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
static void operator delete[](void*) __ACC_CXX_DO_DELETE \
private: static void* operator new(size_t) __ACC_CXX_DO_NEW \
static void* operator new[](size_t) __ACC_CXX_DO_NEW
#endif
/*************************************************************************
// Assist the compiler by defining a unique location for vtables and RTTI.
// Every class which has virtual member functions or derives from a class
// with virtual members should put this macro at the very top of its
// class declaration.
// ACC_CXX_TRIGGER_FUNCTION
**************************************************************************/
#if defined(ACC_CXX_TRIGGER_FUNCTION)
#else
# define ACC_CXX_TRIGGER_FUNCTION \
protected: virtual const void* acc_cxx_trigger_function() const; \
private:
#endif
#if defined(ACC_CXX_TRIGGER_FUNCTION_IMPL)
#else
# define ACC_CXX_TRIGGER_FUNCTION_IMPL(klass) \
const void* klass::acc_cxx_trigger_function() const { return 0; }
#endif
#endif /* __cplusplus */
#endif /* already included */
/*
vi:ts=4:et
*/
-191
View File
@@ -1,191 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/***********************************************************************
// acc_alignof() / acc_inline
************************************************************************/
#if (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_PGI)
# define acc_alignof(e) __alignof__(e)
#elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700))
# define acc_alignof(e) __alignof__(e)
#elif (ACC_CC_MSC && (_MSC_VER >= 1300))
# define acc_alignof(e) __alignof(e)
#endif
#if (ACC_CC_TURBOC && (__TURBOC__ <= 0x0295))
#elif defined(__cplusplus)
# define acc_inline inline
#elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
# define acc_inline __inline
#elif (ACC_CC_CILLY || ACC_CC_GNUC || ACC_CC_PGI)
# define acc_inline __inline__
#elif (ACC_CC_DMC)
# define acc_inline __inline
#elif (ACC_CC_INTELC)
# define acc_inline __inline
#elif (ACC_CC_MSC && (_MSC_VER >= 900))
# define acc_inline __inline
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define acc_inline inline
#endif
/***********************************************************************
// ACC_UNUSED / ACC_UNUSED_FUNC
************************************************************************/
#if !defined(ACC_UNUSED)
# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
# define ACC_UNUSED(var) ((void) &var)
# elif (ACC_CC_BORLANDC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_TURBOC)
# define ACC_UNUSED(var) if (&var) ; else
# elif (ACC_CC_MSC && (_MSC_VER < 900))
# define ACC_UNUSED(var) if (&var) ; else
# elif (ACC_CC_GNUC)
# define ACC_UNUSED(var) ((void) var)
# elif (ACC_CC_KEILC)
# define ACC_UNUSED(var)
# else
# define ACC_UNUSED(var) ((void) &var)
# endif
#endif
#if !defined(ACC_UNUSED_FUNC)
# if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
# define ACC_UNUSED_FUNC(func) ((void) func)
# elif (ACC_CC_BORLANDC || ACC_CC_NDPC || ACC_CC_TURBOC)
# define ACC_UNUSED_FUNC(func) if (func) ; else
# elif (ACC_CC_GNUC == 0x030400ul) && defined(__llvm__)
# define ACC_UNUSED_FUNC(func) ((void) &func)
# elif (ACC_CC_MSC && (_MSC_VER < 900))
# define ACC_UNUSED_FUNC(func) if (func) ; else
# elif (ACC_CC_MSC)
# define ACC_UNUSED_FUNC(func) ((void) &func)
# elif (ACC_CC_KEILC)
# define ACC_UNUSED_FUNC(func)
# else
# define ACC_UNUSED_FUNC(func) ((void) func)
# endif
#endif
/***********************************************************************
// compile-time-assertions
************************************************************************/
/* This can be put into a header file but may get ignored by some compilers. */
#if !defined(ACC_COMPILE_TIME_ASSERT_HEADER)
# if (ACC_CC_AZTECC || ACC_CC_ZORTECHC)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
# elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1u-2*!(e)];
# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
# else
# define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-2*!(e)];
# endif
#endif
/* This must appear within a function body. */
#if !defined(ACC_COMPILE_TIME_ASSERT)
# if (ACC_CC_AZTECC)
# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-!(e)];}
# elif (ACC_CC_DMC || ACC_CC_PACIFICC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
# elif (ACC_CC_MSC && (_MSC_VER < 900))
# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
# elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
# define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
# else
# define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-2*!(e)];}
# endif
#endif
/***********************************************************************
// macros
************************************************************************/
#if !defined(__ACC_UINT_MAX)
# define __ACC_INT_MAX(b) ((((1l << ((b)-2)) - 1l) * 2l) + 1l)
# define __ACC_UINT_MAX(b) ((((1ul << ((b)-1)) - 1ul) * 2ul) + 1ul)
#endif
/***********************************************************************
// get sizes of builtin integral types from <limits.h>
************************************************************************/
#if !defined(__ACC_SHORT_BIT)
# if (USHRT_MAX == ACC_0xffffL)
# define __ACC_SHORT_BIT 16
# elif (USHRT_MAX == ACC_0xffffffffL)
# define __ACC_SHORT_BIT 32
# elif (USHRT_MAX == __ACC_UINT_MAX(64))
# define __ACC_SHORT_BIT 64
# elif (USHRT_MAX == __ACC_UINT_MAX(128))
# define __ACC_SHORT_BIT 128
# else
# error "check your compiler installation: USHRT_MAX"
# endif
#endif
#if !defined(__ACC_INT_BIT)
# if (UINT_MAX == ACC_0xffffL)
# define __ACC_INT_BIT 16
# elif (UINT_MAX == ACC_0xffffffffL)
# define __ACC_INT_BIT 32
# elif (UINT_MAX == __ACC_UINT_MAX(64))
# define __ACC_INT_BIT 64
# elif (UINT_MAX == __ACC_UINT_MAX(128))
# define __ACC_INT_BIT 128
# else
# error "check your compiler installation: UINT_MAX"
# endif
#endif
#if !defined(__ACC_LONG_BIT)
# if (ULONG_MAX == ACC_0xffffffffL)
# define __ACC_LONG_BIT 32
# elif (ULONG_MAX == __ACC_UINT_MAX(64))
# define __ACC_LONG_BIT 64
# elif (ULONG_MAX == __ACC_UINT_MAX(128))
# define __ACC_LONG_BIT 128
# else
# error "check your compiler installation: ULONG_MAX"
# endif
#endif
/***********************************************************************
// acc_auto.h supplements
************************************************************************/
#if (ACC_OS_CYGWIN || (ACC_OS_EMX && defined(__RSXNT__)) || ACC_OS_WIN32 || ACC_OS_WIN64)
# if (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
# elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
/* ancient pw32 version */
# elif ((ACC_OS_CYGWIN || defined(__MINGW32__)) && (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025f00ul)))
/* ancient cygwin/mingw version */
# else
# define ACC_HAVE_WINDOWS_H 1
# endif
#endif
/*
vi:ts=4:et
*/
-67
View File
@@ -1,67 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
#ifndef __ACC_INCD_H_INCLUDED
#define __ACC_INCD_H_INCLUDED 1
/* default system includes */
/* see Autoconf:
* headers.m4, _AC_INCLUDES_DEFAULT_REQUIREMENTS ac_includes_default
*/
#include <stdio.h>
#if defined(HAVE_TIME_H) && defined(__MSL__) && defined(__cplusplus)
# include <time.h>
#endif
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
# include <stdint.h>
# endif
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
-87
View File
@@ -1,87 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
#ifndef __ACC_INCE_H_INCLUDED
#define __ACC_INCE_H_INCLUDED 1
/* extra system includes */
#if defined(HAVE_STDARG_H)
# include <stdarg.h>
#endif
#if defined(HAVE_CTYPE_H)
# include <ctype.h>
#endif
#if defined(HAVE_ERRNO_H)
# include <errno.h>
#endif
#if defined(HAVE_MALLOC_H)
# include <malloc.h>
#endif
#if defined(HAVE_ALLOCA_H)
# include <alloca.h>
#endif
#if defined(HAVE_FCNTL_H)
# include <fcntl.h>
#endif
#if defined(HAVE_DIRENT_H)
# include <dirent.h>
#endif
#if defined(HAVE_SETJMP_H)
# include <setjmp.h>
#endif
#if defined(HAVE_SIGNAL_H)
# include <signal.h>
#endif
#if defined(TIME_WITH_SYS_TIME)
# include <sys/time.h>
# include <time.h>
#elif defined(HAVE_TIME_H)
# include <time.h>
#endif
#if defined(HAVE_UTIME_H)
# include <utime.h>
#elif defined(HAVE_SYS_UTIME_H)
# include <sys/utime.h>
#endif
/* DOS, OS/2 & Windows */
#if defined(HAVE_IO_H)
# include <io.h>
#endif
#if defined(HAVE_DOS_H)
# include <dos.h>
#endif
#if defined(HAVE_DIRECT_H)
# include <direct.h>
#endif
#if defined(HAVE_SHARE_H)
# include <share.h>
#endif
#if defined(ACC_CC_NDPC)
# include <os.h>
#endif
/* TOS */
#if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__))
# include <ext.h>
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
-103
View File
@@ -1,103 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
#ifndef __ACC_INCI_H_INCLUDED
#define __ACC_INCI_H_INCLUDED 1
/*************************************************************************
// internal system includes
**************************************************************************/
#if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
# include <tos.h>
#elif (ACC_HAVE_WINDOWS_H)
# if 1 && !defined(WIN32_LEAN_AND_MEAN)
# define WIN32_LEAN_AND_MEAN 1
# endif
# if 1 && !defined(_WIN32_WINNT)
/* Restrict to a subset of Windows NT 4.0 header files */
# define _WIN32_WINNT 0x0400
# endif
# include <windows.h>
# if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
# include <dir.h>
# endif
#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_WIN16)
# if (ACC_CC_AZTECC)
# include <model.h>
# include <stat.h>
# elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
# include <alloc.h>
# include <dir.h>
# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
# include <sys/exceptn.h>
# elif (ACC_CC_PACIFICC)
# include <unixio.h>
# include <stat.h>
# include <sys.h>
# elif (ACC_CC_WATCOMC)
# include <i86.h>
# endif
#elif (ACC_OS_OS216)
# if (ACC_CC_WATCOMC)
# include <i86.h>
# endif
#endif
/*************************************************************************
//
**************************************************************************/
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
# if defined(FP_OFF)
# define ACC_FP_OFF(x) FP_OFF(x)
# elif defined(_FP_OFF)
# define ACC_FP_OFF(x) _FP_OFF(x)
# else
# define ACC_FP_OFF(x) (((const unsigned __far*)&(x))[0])
# endif
# if defined(FP_SEG)
# define ACC_FP_SEG(x) FP_SEG(x)
# elif defined(_FP_SEG)
# define ACC_FP_SEG(x) _FP_SEG(x)
# else
# define ACC_FP_SEG(x) (((const unsigned __far*)&(x))[1])
# endif
# if defined(MK_FP)
# define ACC_MK_FP(s,o) MK_FP(s,o)
# elif defined(_MK_FP)
# define ACC_MK_FP(s,o) _MK_FP(s,o)
# else
# define ACC_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
# endif
# if 0
# undef ACC_FP_OFF
# undef ACC_FP_SEG
# undef ACC_MK_FP
# define ACC_FP_OFF(x) (((const unsigned __far*)&(x))[0])
# define ACC_FP_SEG(x) (((const unsigned __far*)&(x))[1])
# define ACC_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
# endif
#endif
#endif /* already included */
/*
vi:ts=4:et
*/
-237
View File
@@ -1,237 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/***********************************************************************
// preprocessor
************************************************************************/
/* workaround for preprocessor bugs in some compilers */
#if 0
#define ACC_0xffffL 0xfffful
#define ACC_0xffffffffL 0xfffffffful
#else
#define ACC_0xffffL 65535ul
#define ACC_0xffffffffL 4294967295ul
#endif
/* some things we cannot work around */
#if (ACC_0xffffL == ACC_0xffffffffL)
# error "your preprocessor is broken 1"
#endif
#if (16ul * 16384ul != 262144ul)
# error "your preprocessor is broken 2"
#endif
#if 0
#if (32767 >= 4294967295ul)
# error "your preprocessor is broken 3"
#endif
#if (65535u >= 4294967295ul)
# error "your preprocessor is broken 4"
#endif
#endif
/***********************************************************************
// try to detect specific compilers
************************************************************************/
#if (UINT_MAX == ACC_0xffffL)
#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
# if !defined(MSDOS)
# define MSDOS 1
# endif
# if !defined(_MSDOS)
# define _MSDOS 1
# endif
#elif defined(__VERSION) && defined(MB_LEN_MAX)
# if (__VERSION == 520) && (MB_LEN_MAX == 1)
# if !defined(__AZTEC_C__)
# define __AZTEC_C__ __VERSION
# endif
# if !defined(__DOS__)
# define __DOS__ 1
# endif
# endif
#endif
#endif
/***********************************************************************
// fix incorrect and missing stuff
************************************************************************/
/* Microsoft C does not correctly define ptrdiff_t for
* the 16-bit huge memory model.
*/
#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == ACC_0xffffL)
# define ptrdiff_t long
# define _PTRDIFF_T_DEFINED
#endif
/* Fix old compiler versions. */
#if (UINT_MAX == ACC_0xffffL)
# undef __ACC_RENAME_A
# undef __ACC_RENAME_B
# if defined(__AZTEC_C__) && defined(__DOS__)
# define __ACC_RENAME_A 1
# elif defined(_MSC_VER) && defined(MSDOS)
# if (_MSC_VER < 600)
# define __ACC_RENAME_A 1
# elif (_MSC_VER < 700)
# define __ACC_RENAME_B 1
# endif
# elif defined(__TSC__) && defined(__OS2__)
# define __ACC_RENAME_A 1
# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
# define __ACC_RENAME_A 1
# elif defined(__PACIFIC__) && defined(DOS)
# if !defined(__far)
# define __far far
# endif
# if !defined(__near)
# define __near near
# endif
# endif
# if defined(__ACC_RENAME_A)
# if !defined(__cdecl)
# define __cdecl cdecl
# endif
# if !defined(__far)
# define __far far
# endif
# if !defined(__huge)
# define __huge huge
# endif
# if !defined(__near)
# define __near near
# endif
# if !defined(__pascal)
# define __pascal pascal
# endif
# if !defined(__huge)
# define __huge huge
# endif
# elif defined(__ACC_RENAME_B)
# if !defined(__cdecl)
# define __cdecl _cdecl
# endif
# if !defined(__far)
# define __far _far
# endif
# if !defined(__huge)
# define __huge _huge
# endif
# if !defined(__near)
# define __near _near
# endif
# if !defined(__pascal)
# define __pascal _pascal
# endif
# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
# if !defined(__cdecl)
# define __cdecl cdecl
# endif
# if !defined(__pascal)
# define __pascal pascal
# endif
# endif
# undef __ACC_RENAME_A
# undef __ACC_RENAME_B
#endif
#if (UINT_MAX == ACC_0xffffL)
#if defined(__AZTEC_C__) && defined(__DOS__)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
#elif defined(_MSC_VER) && defined(MSDOS)
# if (_MSC_VER < 600)
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
# endif
# if (_MSC_VER < 700)
# define ACC_BROKEN_INTEGRAL_PROMOTION 1
# define ACC_BROKEN_SIZEOF 1
# endif
#elif defined(__PACIFIC__) && defined(DOS)
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
#elif defined(__TURBOC__) && defined(__MSDOS__)
# if (__TURBOC__ < 0x0150)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
# define ACC_BROKEN_INTEGRAL_PROMOTION 1
# endif
# if (__TURBOC__ < 0x0200)
# define ACC_BROKEN_SIZEOF 1
# endif
# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
# endif
#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
# define ACC_BROKEN_CDECL_ALT_SYNTAX 1
# define ACC_BROKEN_SIZEOF 1
#endif
#endif
#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
# define ACC_BROKEN_INTEGRAL_CONSTANTS 1
#endif
/***********************************************************************
// ANSI C preprocessor macros (cpp)
************************************************************************/
#define ACC_CPP_STRINGIZE(x) #x
#define ACC_CPP_MACRO_EXPAND(x) ACC_CPP_STRINGIZE(x)
/* concatenate */
#define ACC_CPP_CONCAT2(a,b) a ## b
#define ACC_CPP_CONCAT3(a,b,c) a ## b ## c
#define ACC_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
#define ACC_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
/* expand and concatenate (by using one level of indirection) */
#define ACC_CPP_ECONCAT2(a,b) ACC_CPP_CONCAT2(a,b)
#define ACC_CPP_ECONCAT3(a,b,c) ACC_CPP_CONCAT3(a,b,c)
#define ACC_CPP_ECONCAT4(a,b,c,d) ACC_CPP_CONCAT4(a,b,c,d)
#define ACC_CPP_ECONCAT5(a,b,c,d,e) ACC_CPP_CONCAT5(a,b,c,d,e)
/***********************************************************************
// stdc macros
************************************************************************/
#if defined(__cplusplus)
# undef __STDC_CONSTANT_MACROS
# undef __STDC_LIMIT_MACROS
# define __STDC_CONSTANT_MACROS 1
# define __STDC_LIMIT_MACROS 1
#endif
/***********************************************************************
// misc macros
************************************************************************/
#if defined(__cplusplus)
# define ACC_EXTERN_C extern "C"
#else
# define ACC_EXTERN_C extern
#endif
/*
vi:ts=4:et
*/
-61
View File
@@ -1,61 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
#if !defined(ACC_VERSION)
# if defined ACC_CONFIG_INCLUDE
# include ACC_CONFIG_INCLUDE("acc.h")
# else
# include "acc.h"
# endif
#endif
#ifndef __ACC_INCD_H_INCLUDED
# include ACC_CONFIG_INCLUDE("acc_incd.h")
#endif
#ifndef __ACC_INCE_H_INCLUDED
# include ACC_CONFIG_INCLUDE("acc_ince.h")
#endif
#ifndef __ACC_INCI_H_INCLUDED
# include ACC_CONFIG_INCLUDE("acc_inci.h")
#endif
#ifndef __ACC_LIB_H_INCLUDED
# include ACC_CONFIG_INCLUDE("acc_lib.h")
#endif
#if !defined(ACCLIB_PUBLIC)
# define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
#endif
#include ACC_CONFIG_INCLUDE("acclib/bele.ch")
#include ACC_CONFIG_INCLUDE("acclib/hmemcpy.ch")
#include ACC_CONFIG_INCLUDE("acclib/hstring.ch")
#include ACC_CONFIG_INCLUDE("acclib/halloc.ch")
#include ACC_CONFIG_INCLUDE("acclib/dosalloc.ch")
#include ACC_CONFIG_INCLUDE("acclib/hfread.ch")
#include ACC_CONFIG_INCLUDE("acclib/hread.ch")
#include ACC_CONFIG_INCLUDE("acclib/opendir.ch")
#include ACC_CONFIG_INCLUDE("acclib/rand.ch")
#include ACC_CONFIG_INCLUDE("acclib/misc.ch")
#if 0
/* modules which use floating point are not included by default */
#include ACC_CONFIG_INCLUDE("acclib/uclock.ch")
#endif
/*
vi:ts=4:et
*/
-526
View File
@@ -1,526 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
#ifndef __ACC_LIB_H_INCLUDED
#define __ACC_LIB_H_INCLUDED 1
#if !defined(__ACCLIB_FUNCNAME)
# define __ACCLIB_FUNCNAME(f) f
#endif
#if !defined(ACCLIB_EXTERN)
# define ACCLIB_EXTERN(r,f) extern r __ACCLIB_FUNCNAME(f)
#endif
#if !defined(__ACCLIB_CONST_CAST_RETURN)
#if (ACC_CC_GNUC)
# define __ACCLIB_CONST_CAST_RETURN(type,var) \
{ union { type a; const type b; } u; u.b = (var); return u.a; }
#else
# define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (var);
#endif
#endif
#if (ACC_OS_WIN64)
# define acclib_handle_t acc_int64l_t
# define acclib_uhandle_t acc_uint64l_t
#elif (ACC_ARCH_IA32 && ACC_CC_MSC && (_MSC_VER >= 1300))
typedef __w64 long acclib_handle_t;
typedef __w64 unsigned long acclib_uhandle_t;
# define acclib_handle_t acclib_handle_t
# define acclib_uhandle_t acclib_uhandle_t
#else
# define acclib_handle_t long
# define acclib_uhandle_t unsigned long
#endif
/*************************************************************************
// wrap <ctype.h>
**************************************************************************/
#if 0
ACCLIB_EXTERN(int, acc_ascii_digit) (int);
ACCLIB_EXTERN(int, acc_ascii_islower) (int);
ACCLIB_EXTERN(int, acc_ascii_isupper) (int);
ACCLIB_EXTERN(int, acc_ascii_tolower) (int);
ACCLIB_EXTERN(int, acc_ascii_toupper) (int);
ACCLIB_EXTERN(int, acc_ascii_utolower) (int);
ACCLIB_EXTERN(int, acc_ascii_utoupper) (int);
#endif
#define acc_ascii_isdigit(c) (((unsigned)(c) - 48) < 10)
#define acc_ascii_islower(c) (((unsigned)(c) - 97) < 26)
#define acc_ascii_isupper(c) (((unsigned)(c) - 65) < 26)
#define acc_ascii_tolower(c) ((int)(c) + (acc_ascii_isupper(c) << 5))
#define acc_ascii_toupper(c) ((int)(c) - (acc_ascii_islower(c) << 5))
#define acc_ascii_utolower(c) acc_ascii_tolower((unsigned char)(c))
#define acc_ascii_utoupper(c) acc_ascii_toupper((unsigned char)(c))
/*************************************************************************
// huge pointer layer
**************************************************************************/
#ifndef acc_hsize_t
#if (ACC_HAVE_MM_HUGE_PTR)
# define acc_hsize_t unsigned long
# define acc_hvoid_p void __huge *
# define acc_hchar_p char __huge *
# define acc_hchar_pp char __huge * __huge *
# define acc_hbyte_p unsigned char __huge *
#else
# define acc_hsize_t size_t
# define acc_hvoid_p void *
# define acc_hchar_p char *
# define acc_hchar_pp char **
# define acc_hbyte_p unsigned char *
#endif
#endif
#ifndef ACC_FILE_P
#define ACC_FILE_P FILE *
#endif
/* halloc */
ACCLIB_EXTERN(acc_hvoid_p, acc_halloc) (acc_hsize_t);
ACCLIB_EXTERN(void, acc_hfree) (acc_hvoid_p);
/* dos_alloc */
#if (ACC_OS_DOS16 || ACC_OS_OS216)
ACCLIB_EXTERN(void __far*, acc_dos_alloc) (unsigned long);
ACCLIB_EXTERN(int, acc_dos_free) (void __far*);
#endif
/* string */
ACCLIB_EXTERN(int, acc_hmemcmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemset) (acc_hvoid_p, int, acc_hsize_t);
/* string */
ACCLIB_EXTERN(acc_hsize_t, acc_hstrlen) (const acc_hchar_p);
ACCLIB_EXTERN(int, acc_hstrcmp) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(int, acc_hstrncmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
ACCLIB_EXTERN(int, acc_ascii_hstricmp) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(int, acc_ascii_hstrnicmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
ACCLIB_EXTERN(int, acc_ascii_hmemicmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrstr) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstristr) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemimem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrcpy) (acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrcat) (acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
ACCLIB_EXTERN(int, acc_hstrscpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
ACCLIB_EXTERN(int, acc_hstrscat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrccpy) (acc_hchar_p, const acc_hchar_p, int);
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemccpy) (acc_hvoid_p, const acc_hvoid_p, int, acc_hsize_t);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrchr) (const acc_hchar_p, int);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrrchr) (const acc_hchar_p, int);
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrichr) (const acc_hchar_p, int);
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrrichr) (const acc_hchar_p, int);
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemchr) (const acc_hvoid_p, int, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_hmemrchr) (const acc_hvoid_p, int, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemichr) (const acc_hvoid_p, int, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemrichr) (const acc_hvoid_p, int, acc_hsize_t);
ACCLIB_EXTERN(acc_hsize_t, acc_hstrspn) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hsize_t, acc_hstrrspn) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hsize_t, acc_hstrcspn) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hsize_t, acc_hstrrcspn) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrpbrk) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrrpbrk) (const acc_hchar_p, const acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrsep) (acc_hchar_pp, const acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_hstrrsep) (acc_hchar_pp, const acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrlwr) (acc_hchar_p);
ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrupr) (acc_hchar_p);
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemlwr) (acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemupr) (acc_hvoid_p, acc_hsize_t);
/* stdio */
ACCLIB_EXTERN(acc_hsize_t, acc_hfread) (ACC_FILE_P, acc_hvoid_p, acc_hsize_t);
ACCLIB_EXTERN(acc_hsize_t, acc_hfwrite) (ACC_FILE_P, const acc_hvoid_p, acc_hsize_t);
/* io */
#if (ACC_HAVE_MM_HUGE_PTR)
ACCLIB_EXTERN(long, acc_hread) (int, acc_hvoid_p, long);
ACCLIB_EXTERN(long, acc_hwrite) (int, const acc_hvoid_p, long);
#endif
ACCLIB_EXTERN(long, acc_safe_hread) (int, acc_hvoid_p, long);
ACCLIB_EXTERN(long, acc_safe_hwrite) (int, const acc_hvoid_p, long);
/*************************************************************************
// wrap filename limits
**************************************************************************/
/* maximum length of full pathname (excl. '\0') */
#if !defined(ACC_FN_PATH_MAX)
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
# define ACC_FN_PATH_MAX 143
#elif (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN32 || ACC_OS_WIN64)
# define ACC_FN_PATH_MAX 259
#elif (ACC_OS_TOS)
# define ACC_FN_PATH_MAX 259
#endif
#endif
#if !defined(ACC_FN_PATH_MAX)
/* arbitrary limit for acclib implementation */
# define ACC_FN_PATH_MAX 1024
#endif
/* maximum length of a filename (a single path component) (excl. '\0') */
#if !defined(ACC_FN_NAME_MAX)
#if (ACC_OS_DOS16 || ACC_OS_WIN16)
# define ACC_FN_NAME_MAX 12
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
# define ACC_FN_NAME_MAX 12
#elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
#elif (ACC_OS_DOS32)
# define ACC_FN_NAME_MAX 12
#endif
#endif
#if !defined(ACC_FN_NAME_MAX)
# define ACC_FN_NAME_MAX ACC_FN_PATH_MAX
#endif
#define ACC_FNMATCH_NOESCAPE 1
#define ACC_FNMATCH_PATHNAME 2
#define ACC_FNMATCH_PATHSTAR 4
#define ACC_FNMATCH_PERIOD 8
#define ACC_FNMATCH_ASCII_CASEFOLD 16
ACCLIB_EXTERN(int, acc_fnmatch) (const acc_hchar_p, const acc_hchar_p, int);
/*************************************************************************
// wrap <dirent.h>
**************************************************************************/
#undef __ACCLIB_USE_OPENDIR
#if (HAVE_DIRENT_H || ACC_CC_WATCOMC)
# define __ACCLIB_USE_OPENDIR 1
# if (ACC_OS_DOS32 && defined(__BORLANDC__))
# elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
# elif (ACC_OS_OS2 || ACC_OS_OS216)
# elif (ACC_OS_TOS && ACC_CC_GNUC)
# elif (ACC_OS_WIN32 && !defined(ACC_HAVE_WINDOWS_H))
# elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
# undef __ACCLIB_USE_OPENDIR
# endif
#endif
typedef struct
{
#if defined(__ACCLIB_USE_OPENDIR)
void *u_dirp; /* private */
# if (ACC_CC_WATCOMC)
unsigned short f_time;
unsigned short f_date;
unsigned long f_size;
# endif
char f_name[ACC_FN_NAME_MAX+1];
#elif (ACC_OS_WIN32 || ACC_OS_WIN64)
acclib_handle_t u_handle; /* private */
unsigned f_attr;
unsigned f_size_low;
unsigned f_size_high;
char f_name[ACC_FN_NAME_MAX+1];
#elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_TOS || ACC_OS_WIN16)
char u_dta[21]; /* private */
unsigned char f_attr;
unsigned short f_time;
unsigned short f_date;
unsigned short f_size_low;
unsigned short f_size_high;
char f_name[ACC_FN_NAME_MAX+1];
char u_dirp; /* private */
#else
void *u_dirp; /* private */
char f_name[ACC_FN_NAME_MAX+1];
#endif
} acc_dir_t;
#ifndef acc_dir_p
#define acc_dir_p acc_dir_t *
#endif
ACCLIB_EXTERN(int, acc_opendir) (acc_dir_p, const char*);
ACCLIB_EXTERN(int, acc_readdir) (acc_dir_p);
ACCLIB_EXTERN(int, acc_closedir) (acc_dir_p);
/*************************************************************************
// wrap misc
**************************************************************************/
#if (ACC_CC_GNUC) && (defined(__CYGWIN__) || defined(__MINGW32__))
# define acc_alloca(x) __builtin_alloca((x))
#elif (ACC_CC_BORLANDC) && defined(__linux__)
/* FIXME: alloca does not work */
#elif (HAVE_ALLOCA)
# define acc_alloca(x) alloca((x))
#endif
#if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
# define acc_stackavail() stackavail()
#elif (ACC_ARCH_IA16 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0410))
# define acc_stackavail() stackavail()
#elif (ACC_ARCH_IA16 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0400))
# if (ACC_OS_WIN16) && (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
# else
# define acc_stackavail() stackavail()
# endif
#elif ((ACC_ARCH_IA16 || ACC_ARCH_IA32) && (ACC_CC_DMC || ACC_CC_SYMANTECC))
# define acc_stackavail() stackavail()
#elif ((ACC_ARCH_IA16) && ACC_CC_MSC && (_MSC_VER >= 700))
# define acc_stackavail() _stackavail()
#elif ((ACC_ARCH_IA16) && ACC_CC_MSC)
# define acc_stackavail() stackavail()
#elif ((ACC_ARCH_IA16 || ACC_ARCH_IA32) && ACC_CC_TURBOC && (__TURBOC__ >= 0x0450))
# define acc_stackavail() stackavail()
#elif (ACC_ARCH_IA16 && ACC_CC_TURBOC && (__TURBOC__ >= 0x0400))
ACC_EXTERN_C size_t __cdecl stackavail(void);
# define acc_stackavail() stackavail()
#elif ((ACC_ARCH_IA16 || ACC_ARCH_IA32) && (ACC_CC_WATCOMC))
# define acc_stackavail() stackavail()
#elif (ACC_ARCH_IA16 && ACC_CC_ZORTECHC)
# define acc_stackavail() _chkstack()
#endif
ACCLIB_EXTERN(acclib_handle_t, acc_get_osfhandle) (int);
ACCLIB_EXTERN(int, acc_isatty) (int);
ACCLIB_EXTERN(int, acc_mkdir) (const char*, unsigned);
ACCLIB_EXTERN(int, acc_response) (int*, char***);
ACCLIB_EXTERN(int, acc_set_binmode) (int, int);
ACCLIB_EXTERN(acc_int32l_t, acc_muldiv32) (acc_int32l_t, acc_int32l_t, acc_int32l_t);
ACCLIB_EXTERN(acc_uint32l_t, acc_umuldiv32) (acc_uint32l_t, acc_uint32l_t, acc_uint32l_t);
ACCLIB_EXTERN(void, acc_wildargv) (int*, char***);
/*************************************************************************
// uclock (real, i.e. "wall" clock)
**************************************************************************/
#if defined(acc_int32e_t)
ACCLIB_EXTERN(int, acc_tsc_read) (acc_uint32e_t*);
ACCLIB_EXTERN(int, acc_tsc_read_add) (acc_uint32e_t*);
#endif
typedef struct { /* all private */
acclib_handle_t h;
int mode;
#if (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
double qpf;
#endif
} acc_uclock_handle_t;
typedef struct { /* all private */
union {
acc_uint32l_t t32;
#if !(ACC_OS_DOS16 || ACC_OS_WIN16)
double td;
# if defined(acc_int64l_t)
acc_int64l_t t64;
# endif
#endif
} ticks;
#if (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
acc_int64l_t qpc;
#endif
} acc_uclock_t;
#ifndef acc_uclock_handle_p
#define acc_uclock_handle_p acc_uclock_handle_t *
#endif
#ifndef acc_uclock_p
#define acc_uclock_p acc_uclock_t *
#endif
ACCLIB_EXTERN(int, acc_uclock_open) (acc_uclock_handle_p);
ACCLIB_EXTERN(int, acc_uclock_close) (acc_uclock_handle_p);
ACCLIB_EXTERN(void, acc_uclock_read) (acc_uclock_handle_p, acc_uclock_p);
ACCLIB_EXTERN(double, acc_uclock_get_elapsed) (acc_uclock_handle_p, const acc_uclock_p, const acc_uclock_p);
/*************************************************************************
// performance counters (virtual clock)
**************************************************************************/
#if defined(acc_int64l_t)
typedef struct { /* all private */
void* h;
unsigned cpu_type, cpu_features, cpu_khz, cpu_nrctrs;
const char* cpu_name;
} acc_perfctr_handle_t;
typedef struct {
acc_uint64l_t tsc;
#if (ACC_OS_POSIX_LINUX)
acc_uint64l_t pmc[18];
#else
acc_uint64l_t pmc[1];
#endif
} acc_perfctr_clock_t;
#ifndef acc_perfctr_handle_p
#define acc_perfctr_handle_p acc_perfctr_handle_t *
#endif
#ifndef acc_perfctr_clock_p
#define acc_perfctr_clock_p acc_perfctr_clock_t *
#endif
ACCLIB_EXTERN(int, acc_perfctr_open) (acc_perfctr_handle_p);
ACCLIB_EXTERN(int, acc_perfctr_close) (acc_perfctr_handle_p);
ACCLIB_EXTERN(void, acc_perfctr_read) (acc_perfctr_handle_p, acc_perfctr_clock_p);
ACCLIB_EXTERN(double, acc_perfctr_get_elapsed) (acc_perfctr_handle_p, const acc_perfctr_clock_p, const acc_perfctr_clock_p);
ACCLIB_EXTERN(double, acc_perfctr_get_elapsed_tsc) (acc_perfctr_handle_p, acc_uint64l_t);
#endif
/*************************************************************************
// Big Endian / Little Endian
**************************************************************************/
ACCLIB_EXTERN(unsigned, acc_get_be16) (const acc_hvoid_p);
ACCLIB_EXTERN(acc_uint32l_t, acc_get_be24) (const acc_hvoid_p);
ACCLIB_EXTERN(acc_uint32l_t, acc_get_be32) (const acc_hvoid_p);
ACCLIB_EXTERN(void, acc_set_be16) (acc_hvoid_p, unsigned);
ACCLIB_EXTERN(void, acc_set_be24) (acc_hvoid_p, acc_uint32l_t);
ACCLIB_EXTERN(void, acc_set_be32) (acc_hvoid_p, acc_uint32l_t);
ACCLIB_EXTERN(unsigned, acc_get_le16) (const acc_hvoid_p);
ACCLIB_EXTERN(acc_uint32l_t, acc_get_le24) (const acc_hvoid_p);
ACCLIB_EXTERN(acc_uint32l_t, acc_get_le32) (const acc_hvoid_p);
ACCLIB_EXTERN(void, acc_set_le16) (acc_hvoid_p, unsigned);
ACCLIB_EXTERN(void, acc_set_le24) (acc_hvoid_p, acc_uint32l_t);
ACCLIB_EXTERN(void, acc_set_le32) (acc_hvoid_p, acc_uint32l_t);
#if defined(acc_uint64l_t)
ACCLIB_EXTERN(acc_uint64l_t, acc_get_be64) (const acc_hvoid_p);
ACCLIB_EXTERN(void, acc_set_be64) (acc_hvoid_p, acc_uint64l_t);
ACCLIB_EXTERN(acc_uint64l_t, acc_get_le64) (const acc_hvoid_p);
ACCLIB_EXTERN(void, acc_set_le64) (acc_hvoid_p, acc_uint64l_t);
#endif
/* inline versions */
#if (ACC_ARCH_AMD64 || ACC_ARCH_IA32)
# define ACC_GET_LE16(p) (* (const unsigned short *) (p))
# define ACC_GET_LE32(p) (* (const acc_uint32e_t *) (p))
# define ACC_SET_LE16(p,v) (* (unsigned short *) (p) = (unsigned short) (v))
# define ACC_SET_LE32(p,v) (* (acc_uint32e_t *) (p) = (acc_uint32e_t) (v))
#endif
#if (ACC_ARCH_AMD64)
# define ACC_GET_LE64(p) (* (const acc_uint64l_t *) (p))
# define ACC_SET_LE64(p,v) (* (acc_uint64l_t *) (p) = (acc_uint64l_t) (v))
#endif
/*************************************************************************
// getopt
**************************************************************************/
typedef struct {
const char* name;
int has_arg;
int* flag;
int val;
} acc_getopt_longopt_t;
#ifndef acc_getopt_longopt_p
#define acc_getopt_longopt_p acc_getopt_longopt_t *
#endif
typedef struct {
int go_argc;
char** go_argv;
const char* go_shortopts;
const acc_getopt_longopt_p longopts;
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
int __acc_cdecl_va (*go_error)(const char *, ...);
#else
int (__acc_cdecl_va *go_error)(const char *, ...);
#endif
} acc_getopt_t;
#ifndef acc_getopt_p
#define acc_getopt_p acc_getopt_t *
#endif
ACCLIB_EXTERN(void, acc_getopt_init) (acc_getopt_p);
ACCLIB_EXTERN(int, acc_getopt) (acc_getopt_p);
ACCLIB_EXTERN(void, acc_getopt_close)(acc_getopt_p);
/*************************************************************************
// rand
**************************************************************************/
typedef struct { /* all private */
acc_uint32l_t seed;
} acc_rand31_t;
#ifndef acc_rand31_p
#define acc_rand31_p acc_rand31_t *
#endif
ACCLIB_EXTERN(void, acc_srand31) (acc_rand31_p, acc_uint32l_t);
ACCLIB_EXTERN(acc_uint32l_t, acc_rand31) (acc_rand31_p);
#if defined(acc_uint64l_t)
typedef struct { /* all private */
acc_uint64l_t seed;
} acc_rand48_t;
#ifndef acc_rand48_p
#define acc_rand48_p acc_rand48_t *
#endif
ACCLIB_EXTERN(void, acc_srand48) (acc_rand48_p, acc_uint32l_t);
ACCLIB_EXTERN(acc_uint32l_t, acc_rand48) (acc_rand48_p);
ACCLIB_EXTERN(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p);
#endif
#if defined(acc_uint64l_t)
typedef struct { /* all private */
acc_uint64l_t seed;
} acc_rand64_t;
#ifndef acc_rand64_p
#define acc_rand64_p acc_rand64_t *
#endif
ACCLIB_EXTERN(void, acc_srand64) (acc_rand64_p, acc_uint64l_t);
ACCLIB_EXTERN(acc_uint32l_t, acc_rand64) (acc_rand64_p);
ACCLIB_EXTERN(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p);
#endif
typedef struct { /* all private */
unsigned n;
acc_uint32l_t s[624];
} acc_randmt_t;
#ifndef acc_randmt_p
#define acc_randmt_p acc_randmt_t *
#endif
ACCLIB_EXTERN(void, acc_srandmt) (acc_randmt_p, acc_uint32l_t);
ACCLIB_EXTERN(acc_uint32l_t, acc_randmt) (acc_randmt_p);
ACCLIB_EXTERN(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p);
#endif /* already included */
/*
vi:ts=4:et
*/
-199
View File
@@ -1,199 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*
* Memory Model - exactly one of:
*
* ACC_MM_FLAT [default]
* ACC_MM_TINY
* ACC_MM_SMALL
* ACC_MM_MEDIUM
* ACC_MM_COMPACT
* ACC_MM_LARGE
* ACC_MM_HUGE
*/
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
#if (UINT_MAX != ACC_0xffffL)
# error "this should not happen"
#endif
#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
# define ACC_MM_TINY 1
#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
# define ACC_MM_HUGE 1
#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
# define ACC_MM_SMALL 1
#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
# define ACC_MM_MEDIUM 1
#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
# define ACC_MM_COMPACT 1
#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
# define ACC_MM_LARGE 1
#elif (ACC_CC_AZTECC)
# if defined(_LARGE_CODE) && defined(_LARGE_DATA)
# define ACC_MM_LARGE 1
# elif defined(_LARGE_CODE)
# define ACC_MM_MEDIUM 1
# elif defined(_LARGE_DATA)
# define ACC_MM_COMPACT 1
# else
# define ACC_MM_SMALL 1
# endif
#elif (ACC_CC_ZORTECHC && defined(__VCM__))
# define ACC_MM_LARGE 1
#else
# error "unknown memory model"
#endif
/* ACC_HAVE_MM_HUGE_PTR ... working __huge pointers
* ACC_HAVE_MM_HUGE_ARRAY ... char __huge x[256*1024L] works */
#define ACC_HAVE_MM_HUGE_PTR 1
#define ACC_HAVE_MM_HUGE_ARRAY 1
#if (ACC_MM_TINY)
# undef ACC_HAVE_MM_HUGE_ARRAY
#endif
#if (ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_ZORTECHC)
# undef ACC_HAVE_MM_HUGE_PTR
# undef ACC_HAVE_MM_HUGE_ARRAY
#elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
# undef ACC_HAVE_MM_HUGE_ARRAY
#elif (ACC_CC_MSC && defined(_QC))
# undef ACC_HAVE_MM_HUGE_ARRAY
# if (_MSC_VER < 600)
# undef ACC_HAVE_MM_HUGE_PTR
# endif
#elif (ACC_CC_TURBOC && (__TURBOC__ < 0x0295))
# undef ACC_HAVE_MM_HUGE_ARRAY
#elif (ACC_CC_WATCOMC && (__WATCOMC__ >= 1200))
/* pointer arithmetics with __huge arrays seems broken in OpenWatcom 1.x */
# undef ACC_HAVE_MM_HUGE_ARRAY
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
extern void __near __cdecl _AHSHIFT(void);
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
#elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
extern void __near __cdecl _AHSHIFT(void);
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
#elif (ACC_CC_MSC || ACC_CC_TOPSPEEDC)
extern void __near __cdecl _AHSHIFT(void);
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
#elif (ACC_CC_TURBOC && (__TURBOC__ >= 0x0295))
extern void __near __cdecl _AHSHIFT(void);
# define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
#elif ((ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_TURBOC) && ACC_OS_DOS16)
# define ACC_MM_AHSHIFT 12
#elif (ACC_CC_WATCOMC)
extern unsigned char _HShift;
# define ACC_MM_AHSHIFT ((unsigned) _HShift)
#else
# error "FIXME - implement ACC_MM_AHSHIFT"
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#elif (ACC_ARCH_C166)
#if !defined(__MODEL__)
# error "FIXME - C166 __MODEL__"
#elif ((__MODEL__) == 0)
# define ACC_MM_SMALL 1
#elif ((__MODEL__) == 1)
# define ACC_MM_SMALL 1
#elif ((__MODEL__) == 2)
# define ACC_MM_LARGE 1
#elif ((__MODEL__) == 3)
# define ACC_MM_TINY 1
#elif ((__MODEL__) == 4)
# define ACC_MM_XTINY 1
#elif ((__MODEL__) == 5)
# define ACC_MM_XSMALL 1
#else
# error "FIXME - C166 __MODEL__"
#endif
#elif (ACC_ARCH_MCS251)
#if !defined(__MODEL__)
# error "FIXME - MCS251 __MODEL__"
#elif ((__MODEL__) == 0)
# define ACC_MM_SMALL 1
#elif ((__MODEL__) == 2)
# define ACC_MM_LARGE 1
#elif ((__MODEL__) == 3)
# define ACC_MM_TINY 1
#elif ((__MODEL__) == 4)
# define ACC_MM_XTINY 1
#elif ((__MODEL__) == 5)
# define ACC_MM_XSMALL 1
#else
# error "FIXME - MCS251 __MODEL__"
#endif
#elif (ACC_ARCH_MCS51)
#if !defined(__MODEL__)
# error "FIXME - MCS51 __MODEL__"
#elif ((__MODEL__) == 1)
# define ACC_MM_SMALL 1
#elif ((__MODEL__) == 2)
# define ACC_MM_LARGE 1
#elif ((__MODEL__) == 3)
# define ACC_MM_TINY 1
#elif ((__MODEL__) == 4)
# define ACC_MM_XTINY 1
#elif ((__MODEL__) == 5)
# define ACC_MM_XSMALL 1
#else
# error "FIXME - MCS51 __MODEL__"
#endif
#else
# define ACC_MM_FLAT 1
#endif
#if (ACC_MM_FLAT)
# define ACC_INFO_MM "flat"
#elif (ACC_MM_TINY)
# define ACC_INFO_MM "tiny"
#elif (ACC_MM_SMALL)
# define ACC_INFO_MM "small"
#elif (ACC_MM_MEDIUM)
# define ACC_INFO_MM "medium"
#elif (ACC_MM_COMPACT)
# define ACC_INFO_MM "compact"
#elif (ACC_MM_LARGE)
# define ACC_INFO_MM "large"
#elif (ACC_MM_HUGE)
# define ACC_INFO_MM "huge"
#else
# error "unknown memory model"
#endif
/*
vi:ts=4:et
*/
-203
View File
@@ -1,203 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/*
* Operating System - exactly one of:
*
* ACC_OS_POSIX [default]
* ACC_OS_AMIGAOS
* ACC_OS_BEOS
* ACC_OS_CYGWIN hybrid WIN32 and POSIX
* ACC_OS_DOS16 16-bit DOS (segmented memory model)
* ACC_OS_DOS32
* ACC_OS_EMX hybrid OS/2, DOS32, WIN32 (with RSX) and POSIX
* ACC_OS_MACCLASSIC Macintosh Classic
* ACC_OS_PALMOS
* ACC_OS_OS2 OS/2
* ACC_OS_OS216 16-bit OS/2 1.x (segmented memory model)
* ACC_OS_QNX
* ACC_OS_RISCOS
* ACC_OS_TOS Atari TOS / MiNT
* ACC_OS_VMS
* ACC_OS_WIN16 16-bit Windows 3.x (segmented memory model)
* ACC_OS_WIN32
* ACC_OS_WIN64 64-bit Windows (LLP64 programming model)
*/
#if defined(__CYGWIN__) && defined(__GNUC__)
# define ACC_OS_CYGWIN 1
# define ACC_INFO_OS "cygwin"
#elif defined(__EMX__) && defined(__GNUC__)
# define ACC_OS_EMX 1
# define ACC_INFO_OS "emx"
#elif defined(__BEOS__)
# define ACC_OS_BEOS 1
# define ACC_INFO_OS "beos"
#elif defined(__QNX__)
# define ACC_OS_QNX 1
# define ACC_INFO_OS "qnx"
#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
# define ACC_OS_DOS32 1
# define ACC_INFO_OS "dos32"
#elif defined(__BORLANDC__) && defined(__DPMI16__)
# define ACC_OS_DOS16 1
# define ACC_INFO_OS "dos16"
#elif defined(__ZTC__) && defined(DOS386)
# define ACC_OS_DOS32 1
# define ACC_INFO_OS "dos32"
#elif defined(__OS2__) || defined(__OS2V2__)
# if (UINT_MAX == ACC_0xffffL)
# define ACC_OS_OS216 1
# define ACC_INFO_OS "os216"
# elif (UINT_MAX == ACC_0xffffffffL)
# define ACC_OS_OS2 1
# define ACC_INFO_OS "os2"
# else
# error "check your limits.h header"
# endif
#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
# define ACC_OS_WIN64 1
# define ACC_INFO_OS "win64"
#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
# define ACC_OS_WIN32 1
# define ACC_INFO_OS "win32"
#elif defined(__MWERKS__) && defined(__INTEL__)
# define ACC_OS_WIN32 1
# define ACC_INFO_OS "win32"
#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
# if (UINT_MAX == ACC_0xffffL)
# define ACC_OS_WIN16 1
# define ACC_INFO_OS "win16"
# elif (UINT_MAX == ACC_0xffffffffL)
# define ACC_OS_WIN32 1
# define ACC_INFO_OS "win32"
# else
# error "check your limits.h header"
# endif
#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
# if (UINT_MAX == ACC_0xffffL)
# define ACC_OS_DOS16 1
# define ACC_INFO_OS "dos16"
# elif (UINT_MAX == ACC_0xffffffffL)
# define ACC_OS_DOS32 1
# define ACC_INFO_OS "dos32"
# else
# error "check your limits.h header"
# endif
#elif defined(__WATCOMC__)
# if defined(__NT__) && (UINT_MAX == ACC_0xffffL)
/* wcl: NT host defaults to DOS target */
# define ACC_OS_DOS16 1
# define ACC_INFO_OS "dos16"
# elif defined(__NT__) && (__WATCOMC__ < 1100)
/* wcl386: Watcom C 11 defines _WIN32 */
# define ACC_OS_WIN32 1
# define ACC_INFO_OS "win32"
# else
# error "please specify a target using the -bt compiler option"
# endif
#elif defined(__palmos__)
# if (UINT_MAX == ACC_0xffffL)
# define ACC_OS_PALMOS 1
# define ACC_INFO_OS "palmos"
# else
# error "check your limits.h header"
# endif
#elif defined(__TOS__) || defined(__atarist__)
# define ACC_OS_TOS 1
# define ACC_INFO_OS "tos"
#elif defined(macintosh) && !defined(__ppc__)
# define ACC_OS_MACCLASSIC 1
# define ACC_INFO_OS "macclassic"
#elif defined(__VMS)
# define ACC_OS_VMS 1
# define ACC_INFO_OS "vms"
#else
# define ACC_OS_POSIX 1
# define ACC_INFO_OS "posix"
#endif
#if (ACC_OS_POSIX)
# if defined(_AIX) || defined(__AIX__) || defined(__aix__)
# define ACC_OS_POSIX_AIX 1
# define ACC_INFO_OS_POSIX "aix"
# elif defined(__FreeBSD__)
# define ACC_OS_POSIX_FREEBSD 1
# define ACC_INFO_OS_POSIX "freebsd"
# elif defined(__hpux__) || defined(__hpux)
# define ACC_OS_POSIX_HPUX 1
# define ACC_INFO_OS_POSIX "hpux"
# elif defined(__INTERIX)
# define ACC_OS_POSIX_INTERIX 1
# define ACC_INFO_OS_POSIX "interix"
# elif defined(__IRIX__) || defined(__irix__)
# define ACC_OS_POSIX_IRIX 1
# define ACC_INFO_OS_POSIX "irix"
# elif defined(__linux__) || defined(__linux)
# define ACC_OS_POSIX_LINUX 1
# define ACC_INFO_OS_POSIX "linux"
# elif defined(__APPLE__) || defined(__MACOS__)
# define ACC_OS_POSIX_MACOSX 1
# define ACC_INFO_OS_POSIX "macosx"
# elif defined(__NetBSD__)
# define ACC_OS_POSIX_NETBSD 1
# define ACC_INFO_OS_POSIX "netbsd"
# elif defined(__OpenBSD__)
# define ACC_OS_POSIX_OPENBSD 1
# define ACC_INFO_OS_POSIX "openbsd"
# elif defined(__osf__)
# define ACC_OS_POSIX_OSF 1
# define ACC_INFO_OS_POSIX "osf"
# elif defined(__solaris__) || defined(__sun)
# if defined(__SVR4) || defined(__svr4__)
# define ACC_OS_POSIX_SOLARIS 1
# define ACC_INFO_OS_POSIX "solaris"
# else
# define ACC_OS_POSIX_SUNOS 1
# define ACC_INFO_OS_POSIX "sunos"
# endif
# elif defined(__ultrix__) || defined(__ultrix)
# define ACC_OS_POSIX_ULTRIX 1
# define ACC_INFO_OS_POSIX "ultrix"
# else
# define ACC_OS_POSIX_UNKNOWN 1
# define ACC_INFO_OS_POSIX "unknown"
# endif
#endif
#if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
# if (UINT_MAX != ACC_0xffffL)
# error "this should not happen"
# endif
# if (ULONG_MAX != ACC_0xffffffffL)
# error "this should not happen"
# endif
#endif
#if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32 || ACC_OS_WIN64)
# if (UINT_MAX != ACC_0xffffffffL)
# error "this should not happen"
# endif
# if (ULONG_MAX != ACC_0xffffffffL)
# error "this should not happen"
# endif
#endif
/*
vi:ts=4:et
*/
-321
View File
@@ -1,321 +0,0 @@
/* ACC -- Automatic Compiler Configuration
Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
This software is a copyrighted work licensed under the terms of
the GNU General Public License. Please consult the file "ACC_LICENSE"
for details.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/
*/
/***********************************************************************
//
************************************************************************/
#if (ACC_CC_GNUC >= 0x020800ul) /* 2.8.0 */
# define __acc_gnuc_extension__ __extension__
#else
# define __acc_gnuc_extension__
#endif
#if (SIZEOF_LONG_LONG > 0)
__acc_gnuc_extension__ typedef long long acc_llong_t;
#endif
#if (SIZEOF_UNSIGNED_LONG_LONG > 0)
__acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
#endif
#if (!(SIZEOF_SHORT > 0 && SIZEOF_INT > 0 && SIZEOF_LONG > 0))
# error "missing defines for sizes"
#endif
#if (!(SIZEOF_PTRDIFF_T > 0 && SIZEOF_SIZE_T > 0 && SIZEOF_VOID_P > 0 && SIZEOF_CHAR_P > 0))
# error "missing defines for sizes"
#endif
/***********************************************************************
// some <stdint.h> types:
// required: least & fast: acc_int32l_t, acc_int32f_t
// optional: exact32 acc_int32e_t
// optional: least64 acc_int64l_t
************************************************************************/
/* acc_int32e_t is int32_t in <stdint.h> terminology */
#if !defined(acc_int32e_t)
#if (SIZEOF_INT == 4)
# define acc_int32e_t int
# define acc_uint32e_t unsigned int
# define ACC_INT32E_C(c) c
# define ACC_UINT32E_C(c) c##U
#elif (SIZEOF_LONG == 4)
# define acc_int32e_t long int
# define acc_uint32e_t unsigned long int
# define ACC_INT32E_C(c) c##L
# define ACC_UINT32E_C(c) c##UL
#elif (SIZEOF_SHORT == 4)
# define acc_int32e_t short int
# define acc_uint32e_t unsigned short int
# define ACC_INT32E_C(c) c
# define ACC_UINT32E_C(c) c##U
#elif (SIZEOF_LONG_LONG == 4 && SIZEOF_UNSIGNED_LONG_LONG == 4)
# define acc_int32e_t acc_llong_t
# define acc_uint32e_t acc_ullong_t
# define ACC_INT32E_C(c) c##LL
# define ACC_UINT32E_C(c) c##ULL
#elif (SIZEOF___INT32 == 4 && SIZEOF_UNSIGNED___INT32 == 4)
# define acc_int32e_t __int32
# define acc_uint32e_t unsigned __int32
# if (SIZEOF_INT > 4)
# define ACC_INT32E_C(c) c
# define ACC_UINT32E_C(c) c##U
# elif (SIZEOF_LONG > 4)
# define ACC_INT32E_C(c) c##L
# define ACC_UINT32E_C(c) c##UL
# else
# define ACC_INT32E_C(c) c##i32
# define ACC_UINT32E_C(c) c##ui32
# endif
#else
/* no exact 32-bit integral type on this machine */
#endif
#endif
#if defined(acc_int32e_t)
# define SIZEOF_ACC_INT32E_T 4
#endif
/* acc_int32l_t is int_least32_t in <stdint.h> terminology */
#if !defined(acc_int32l_t)
#if defined(acc_int32e_t)
# define acc_int32l_t acc_int32e_t
# define acc_uint32l_t acc_uint32e_t
# define ACC_INT32L_C(c) ACC_INT32E_C(c)
# define ACC_UINT32L_C(c) ACC_UINT32E_C(c)
# define SIZEOF_ACC_INT32L_T SIZEOF_ACC_INT32E_T
#elif (SIZEOF_INT > 4)
# define acc_int32l_t int
# define acc_uint32l_t unsigned int
# define ACC_INT32L_C(c) c
# define ACC_UINT32L_C(c) c##U
# define SIZEOF_ACC_INT32L_T SIZEOF_INT
#elif (SIZEOF_LONG > 4)
# define acc_int32l_t long int
# define acc_uint32l_t unsigned long int
# define ACC_INT32L_C(c) c##L
# define ACC_UINT32L_C(c) c##UL
# define SIZEOF_ACC_INT32L_T SIZEOF_LONG
#else
# error "acc_int32l_t"
#endif
#endif
/* acc_int32f_t is int_fast32_t in <stdint.h> terminology */
#if !defined(acc_int32f_t)
#if (SIZEOF_INT >= 4)
# define acc_int32f_t int
# define acc_uint32f_t unsigned int
# define ACC_INT32F_C(c) c
# define ACC_UINT32F_C(c) c##U
# define SIZEOF_ACC_INT32F_T SIZEOF_INT
#elif (SIZEOF_LONG >= 4)
# define acc_int32f_t long int
# define acc_uint32f_t unsigned long int
# define ACC_INT32F_C(c) c##L
# define ACC_UINT32F_C(c) c##UL
# define SIZEOF_ACC_INT32F_T SIZEOF_LONG
#elif defined(acc_int32e_t)
# define acc_int32f_t acc_int32e_t
# define acc_uint32f_t acc_uint32e_t
# define ACC_INT32F_C(c) ACC_INT32E_C(c)
# define ACC_UINT32F_C(c) ACC_UINT32E_C(c)
# define SIZEOF_ACC_INT32F_T SIZEOF_ACC_INT32E_T
#else
# error "acc_int32f_t"
#endif
#endif
/* acc_int64l_t is int_least64_t in <stdint.h> terminology */
#if !defined(acc_int64l_t)
#if (SIZEOF___INT64 >= 8 && SIZEOF_UNSIGNED___INT64 >= 8)
# if (ACC_CC_BORLANDC) && !defined(ACC_CONFIG_PREFER___INT64)
# define ACC_CONFIG_PREFER___INT64 1
# endif
#endif
#if (SIZEOF_INT >= 8)
# define acc_int64l_t int
# define acc_uint64l_t unsigned int
# define ACC_INT64L_C(c) c
# define ACC_UINT64L_C(c) c##U
# define SIZEOF_ACC_INT64L_T SIZEOF_INT
#elif (SIZEOF_LONG >= 8)
# define acc_int64l_t long int
# define acc_uint64l_t unsigned long int
# define ACC_INT64L_C(c) c##L
# define ACC_UINT64L_C(c) c##UL
# define SIZEOF_ACC_INT64L_T SIZEOF_LONG
#elif (SIZEOF_LONG_LONG >= 8 && SIZEOF_UNSIGNED_LONG_LONG >= 8) && !defined(ACC_CONFIG_PREFER___INT64)
# define acc_int64l_t acc_llong_t
# define acc_uint64l_t acc_ullong_t
# if (ACC_CC_BORLANDC)
# define ACC_INT64L_C(c) ((c) + 0ll)
# define ACC_UINT64L_C(c) ((c) + 0ull)
# else
# define ACC_INT64L_C(c) c##LL
# define ACC_UINT64L_C(c) c##ULL
# endif
# define SIZEOF_ACC_INT64L_T SIZEOF_LONG_LONG
#elif (SIZEOF___INT64 >= 8 && SIZEOF_UNSIGNED___INT64 >= 8)
# define acc_int64l_t __int64
# define acc_uint64l_t unsigned __int64
# if (ACC_CC_BORLANDC)
# define ACC_INT64L_C(c) ((c) + 0i64)
# define ACC_UINT64L_C(c) ((c) + 0ui64)
# else
# define ACC_INT64L_C(c) c##i64
# define ACC_UINT64L_C(c) c##ui64
# endif
# define SIZEOF_ACC_INT64L_T SIZEOF___INT64
#else
/* no least 64-bit integral type on this machine */
#endif
#endif
#if !defined(acc_intptr_t)
#if (ACC_ARCH_IA32 && ACC_CC_MSC && (_MSC_VER >= 1300))
typedef __w64 int acc_intptr_t;
typedef __w64 unsigned int acc_uintptr_t;
# define acc_intptr_t acc_intptr_t
# define acc_uintptr_t acc_uintptr_t
# define SIZEOF_ACC_INTPTR_T SIZEOF_INT
#elif (SIZEOF_INT >= SIZEOF_VOID_P)
# define acc_intptr_t int
# define acc_uintptr_t unsigned int
# define SIZEOF_ACC_INTPTR_T SIZEOF_INT
#elif (SIZEOF_LONG >= SIZEOF_VOID_P)
# define acc_intptr_t long
# define acc_uintptr_t unsigned long
# define SIZEOF_ACC_INTPTR_T SIZEOF_LONG
#elif (SIZEOF_ACC_INT64L_T >= SIZEOF_VOID_P)
# define acc_intptr_t acc_int64l_t
# define acc_uintptr_t acc_uint64l_t
# define SIZEOF_ACC_INTPTR_T SIZEOF_ACC_INT64L_T
#else
# error "acc_intptr_t"
#endif
#endif
/* workaround for broken compilers */
#if (ACC_BROKEN_INTEGRAL_CONSTANTS)
# undef ACC_INT32E_C
# undef ACC_UINT32E_C
# undef ACC_INT32L_C
# undef ACC_UINT32L_C
# undef ACC_INT32F_C
# undef ACC_UINT32F_C
# if (SIZEOF_INT == 4)
# define ACC_INT32E_C(c) ((c) + 0)
# define ACC_UINT32E_C(c) ((c) + 0U)
# define ACC_INT32L_C(c) ((c) + 0)
# define ACC_UINT32L_C(c) ((c) + 0U)
# define ACC_INT32F_C(c) ((c) + 0)
# define ACC_UINT32F_C(c) ((c) + 0U)
# elif (SIZEOF_LONG == 4)
# define ACC_INT32E_C(c) ((c) + 0L)
# define ACC_UINT32E_C(c) ((c) + 0UL)
# define ACC_INT32L_C(c) ((c) + 0L)
# define ACC_UINT32L_C(c) ((c) + 0UL)
# define ACC_INT32F_C(c) ((c) + 0L)
# define ACC_UINT32F_C(c) ((c) + 0UL)
# else
# error "integral constants"
# endif
#endif
/***********************************************************************
// calling conventions
************************************************************************/
#if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC)
# elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
# define __acc_cdecl __cdecl
# define __acc_cdecl_atexit
# define __acc_cdecl_main __cdecl
# if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
# define __acc_cdecl_qsort __pascal
# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
# define __acc_cdecl_qsort _stdcall
# else
# define __acc_cdecl_qsort __cdecl
# endif
# elif (ACC_CC_WATCOMC)
# define __acc_cdecl __cdecl
# else
# define __acc_cdecl __cdecl
# define __acc_cdecl_atexit __cdecl
# define __acc_cdecl_main __cdecl
# define __acc_cdecl_qsort __cdecl
# endif
# if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC || ACC_CC_WATCOMC)
# elif (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
# define __acc_cdecl_sighandler __pascal
# elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
# define __acc_cdecl_sighandler _stdcall
# elif (ACC_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
# define __acc_cdecl_sighandler __clrcall
# elif (ACC_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
# if defined(_DLL)
# define __acc_cdecl_sighandler _far _cdecl _loadds
# elif defined(_MT)
# define __acc_cdecl_sighandler _far _cdecl
# else
# define __acc_cdecl_sighandler _cdecl
# endif
# else
# define __acc_cdecl_sighandler __cdecl
# endif
#elif (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
# define __acc_cdecl cdecl
#endif
#if !defined(__acc_cdecl)
# define __acc_cdecl
#endif
#if !defined(__acc_cdecl_atexit)
# define __acc_cdecl_atexit
#endif
#if !defined(__acc_cdecl_main)
# define __acc_cdecl_main
#endif
#if !defined(__acc_cdecl_qsort)
# define __acc_cdecl_qsort
#endif
#if !defined(__acc_cdecl_sighandler)
# define __acc_cdecl_sighandler
#endif
#if !defined(__acc_cdecl_va)
# define __acc_cdecl_va __acc_cdecl
#endif
#if (ACC_BROKEN_CDECL_ALT_SYNTAX)
typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(int);
#elif defined(RETSIGTYPE)
typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(int);
#else
typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(int);
#endif
/*
vi:ts=4:et
*/
-3
View File
@@ -1,3 +0,0 @@
fnmatch.ch
getopt.ch
perfctr.ch

Some files were not shown because too many files have changed in this diff Show More