CI updates
This commit is contained in:
parent
2cf1c32d18
commit
decc1efb74
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -116,7 +116,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
@ -203,7 +203,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
@ -271,7 +271,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
@ -373,7 +373,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
@ -505,7 +505,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
4
.github/workflows/test-alpine-linux.yml
vendored
4
.github/workflows/test-alpine-linux.yml
vendored
@ -34,7 +34,7 @@ jobs:
|
|||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: 'upx*/build/*/upx'
|
path: 'upx*/build/*/upx'
|
||||||
@ -61,7 +61,7 @@ jobs:
|
|||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: 'upx*/build/*/upx'
|
path: 'upx*/build/*/upx'
|
||||||
|
|||||||
@ -41,7 +41,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
@ -82,7 +82,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
@ -81,7 +81,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
@ -68,7 +68,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
@ -160,7 +160,7 @@ jobs:
|
|||||||
|
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: 'upx with space*/build/*/*/*/upx'
|
path: 'upx with space*/build/*/*/*/upx'
|
||||||
|
|||||||
@ -86,7 +86,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
@ -85,7 +85,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
2
.github/workflows/weekly-ci-cc-zigcc.yml
vendored
2
.github/workflows/weekly-ci-cc-zigcc.yml
vendored
@ -120,7 +120,7 @@ jobs:
|
|||||||
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
# GitHub Actions magic: set "artifact_name" environment value for use in next step
|
||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
2
.github/workflows/weekly-ci-rt-checkers.yml
vendored
2
.github/workflows/weekly-ci-rt-checkers.yml
vendored
@ -72,7 +72,7 @@ jobs:
|
|||||||
echo "artifact_name=$N" >> $GITHUB_ENV
|
echo "artifact_name=$N" >> $GITHUB_ENV
|
||||||
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
- name: ${{ format('Upload artifact {0}', env.artifact_name) }}
|
||||||
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
if: ${{ !startsWith(matrix.container, 'i386/') }} # i386: missing nodejs on host
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
|
|||||||
@ -120,7 +120,7 @@ build/extra/gcc-std-cxx20/%: export UPX_CONFIG_DISABLE_CXX_STANDARD=ON
|
|||||||
build/extra/gcc-std-cxx23/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
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/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/extra/gcc-std-cxx23/%: export CC = gcc -std=gnu2x
|
build/extra/gcc-std-cxx23/%: export CC = gcc -std=gnu2x
|
||||||
build/extra/gcc-std-cxx23/%: export CXX = g++ -std=gnu++23
|
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_C_STANDARD=ON
|
||||||
build/extra/gcc-std-cxx23/%: export UPX_CONFIG_DISABLE_CXX_STANDARD=ON
|
build/extra/gcc-std-cxx23/%: export UPX_CONFIG_DISABLE_CXX_STANDARD=ON
|
||||||
|
|
||||||
@ -221,8 +221,8 @@ ifneq ($(CXX),)
|
|||||||
UPX_XTARGET := $(UPX_XTARGET)
|
UPX_XTARGET := $(UPX_XTARGET)
|
||||||
build/xtarget/$(UPX_XTARGET)/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
build/xtarget/$(UPX_XTARGET)/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||||
build/xtarget/$(UPX_XTARGET)/release: PHONY; $(call run_config_and_build,$@,Release)
|
build/xtarget/$(UPX_XTARGET)/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||||
build/xtarget/$(UPX_XTARGET)/%: export CC
|
build/xtarget/$(UPX_XTARGET)/%: export CC := $(CC)
|
||||||
build/xtarget/$(UPX_XTARGET)/%: export CXX
|
build/xtarget/$(UPX_XTARGET)/%: export CXX := $(CXX)
|
||||||
# shortcuts
|
# shortcuts
|
||||||
xtarget/all: xtarget/debug xtarget/release
|
xtarget/all: xtarget/debug xtarget/release
|
||||||
xtarget/debug: build/xtarget/$(UPX_XTARGET)/debug
|
xtarget/debug: build/xtarget/$(UPX_XTARGET)/debug
|
||||||
@ -246,12 +246,22 @@ __add_cmake_config = $(and $($1),-D$1="$($1)")
|
|||||||
# pass common CMake settings from environment/make to cmake
|
# pass common CMake settings from environment/make to cmake
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_VERBOSE_MAKEFILE)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_VERBOSE_MAKEFILE)
|
||||||
# pass common CMake toolchain settings from environment/make to cmake
|
# pass common CMake toolchain settings from environment/make to cmake
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_ADDR2LINE)
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_AR)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_AR)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_DLLTOOL)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_LINKER)
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_NM)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_NM)
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_RANLIB)
|
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_OBJCOPY)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_OBJCOPY)
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_OBJDUMP)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_OBJDUMP)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_RANLIB)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_READELF)
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_STRIP)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_STRIP)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_TAPI)
|
||||||
|
# pass common CMake LTO toolchain settings from environment/make to cmake (for use with "-flto")
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_C_COMPILER_AR)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_C_COMPILER_RANLIB)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_CXX_COMPILER_AR)
|
||||||
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_CXX_COMPILER_RANLIB)
|
||||||
# pass common CMake cross compilation settings from environment/make to cmake
|
# pass common CMake cross compilation settings from environment/make to cmake
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_SYSTEM_NAME)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_SYSTEM_NAME)
|
||||||
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_CROSSCOMPILING_EMULATOR)
|
build/%: UPX_CMAKE_CONFIG_FLAGS += $(call __add_cmake_config,CMAKE_CROSSCOMPILING_EMULATOR)
|
||||||
|
|||||||
114
src/packmast.cpp
114
src/packmast.cpp
@ -136,7 +136,7 @@ static noinline tribool try_can_unpack(PackerBase *pb, void *user) may_throw {
|
|||||||
/*static*/
|
/*static*/
|
||||||
PackerBase *PackMaster::visitAllPackers(visit_func_t func, InputFile *f, const Options *o,
|
PackerBase *PackMaster::visitAllPackers(visit_func_t func, InputFile *f, const Options *o,
|
||||||
void *user) may_throw {
|
void *user) may_throw {
|
||||||
#define D(Klass) \
|
#define VISIT(Klass) \
|
||||||
do { \
|
do { \
|
||||||
static_assert(std::is_class_v<Klass>); \
|
static_assert(std::is_class_v<Klass>); \
|
||||||
static_assert(std::is_nothrow_destructible_v<Klass>); \
|
static_assert(std::is_nothrow_destructible_v<Klass>); \
|
||||||
@ -159,91 +159,91 @@ PackerBase *PackMaster::visitAllPackers(visit_func_t func, InputFile *f, const O
|
|||||||
//
|
//
|
||||||
if (!o->dos_exe.force_stub) {
|
if (!o->dos_exe.force_stub) {
|
||||||
// dos32
|
// dos32
|
||||||
D(PackDjgpp2);
|
VISIT(PackDjgpp2);
|
||||||
D(PackTmt);
|
VISIT(PackTmt);
|
||||||
D(PackWcle);
|
VISIT(PackWcle);
|
||||||
// Windows
|
// Windows
|
||||||
// D(PackW64PeArm64EC); // NOT YET IMPLEMENTED
|
// VISIT(PackW64PeArm64EC); // NOT YET IMPLEMENTED
|
||||||
// D(PackW64PeArm64); // NOT YET IMPLEMENTED
|
// VISIT(PackW64PeArm64); // NOT YET IMPLEMENTED
|
||||||
D(PackW64PeAmd64);
|
VISIT(PackW64PeAmd64);
|
||||||
D(PackW32PeI386);
|
VISIT(PackW32PeI386);
|
||||||
D(PackWinCeArm);
|
VISIT(PackWinCeArm);
|
||||||
}
|
}
|
||||||
D(PackExe); // dos/exe
|
VISIT(PackExe); // dos/exe
|
||||||
|
|
||||||
//
|
//
|
||||||
// linux kernel
|
// linux kernel
|
||||||
//
|
//
|
||||||
D(PackVmlinuxARMEL);
|
VISIT(PackVmlinuxARMEL);
|
||||||
D(PackVmlinuxARMEB);
|
VISIT(PackVmlinuxARMEB);
|
||||||
D(PackVmlinuxPPC32);
|
VISIT(PackVmlinuxPPC32);
|
||||||
D(PackVmlinuxPPC64LE);
|
VISIT(PackVmlinuxPPC64LE);
|
||||||
D(PackVmlinuxAMD64);
|
VISIT(PackVmlinuxAMD64);
|
||||||
D(PackVmlinuxI386);
|
VISIT(PackVmlinuxI386);
|
||||||
D(PackVmlinuzI386);
|
VISIT(PackVmlinuzI386);
|
||||||
D(PackBvmlinuzI386);
|
VISIT(PackBvmlinuzI386);
|
||||||
D(PackVmlinuzARMEL);
|
VISIT(PackVmlinuzARMEL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// linux
|
// linux
|
||||||
//
|
//
|
||||||
if (!o->o_unix.force_execve) {
|
if (!o->o_unix.force_execve) {
|
||||||
if (o->o_unix.use_ptinterp) {
|
if (o->o_unix.use_ptinterp) {
|
||||||
D(PackLinuxElf32x86interp);
|
VISIT(PackLinuxElf32x86interp);
|
||||||
}
|
}
|
||||||
D(PackFreeBSDElf32x86);
|
VISIT(PackFreeBSDElf32x86);
|
||||||
D(PackNetBSDElf32x86);
|
VISIT(PackNetBSDElf32x86);
|
||||||
D(PackOpenBSDElf32x86);
|
VISIT(PackOpenBSDElf32x86);
|
||||||
D(PackLinuxElf32x86);
|
VISIT(PackLinuxElf32x86);
|
||||||
D(PackLinuxElf64amd);
|
VISIT(PackLinuxElf64amd);
|
||||||
D(PackLinuxElf32armLe);
|
VISIT(PackLinuxElf32armLe);
|
||||||
D(PackLinuxElf32armBe);
|
VISIT(PackLinuxElf32armBe);
|
||||||
D(PackLinuxElf64arm);
|
VISIT(PackLinuxElf64arm);
|
||||||
D(PackLinuxElf32ppc);
|
VISIT(PackLinuxElf32ppc);
|
||||||
D(PackLinuxElf64ppc);
|
VISIT(PackLinuxElf64ppc);
|
||||||
D(PackLinuxElf64ppcle);
|
VISIT(PackLinuxElf64ppcle);
|
||||||
D(PackLinuxElf32mipsel);
|
VISIT(PackLinuxElf32mipsel);
|
||||||
D(PackLinuxElf32mipseb);
|
VISIT(PackLinuxElf32mipseb);
|
||||||
D(PackLinuxI386sh);
|
VISIT(PackLinuxI386sh);
|
||||||
}
|
}
|
||||||
D(PackBSDI386);
|
VISIT(PackBSDI386);
|
||||||
D(PackMachFat); // cafebabe conflict
|
VISIT(PackMachFat); // cafebabe conflict
|
||||||
D(PackLinuxI386); // cafebabe conflict
|
VISIT(PackLinuxI386); // cafebabe conflict
|
||||||
|
|
||||||
// Mach (Darwin / macOS)
|
// Mach (Darwin / macOS)
|
||||||
D(PackDylibAMD64);
|
VISIT(PackDylibAMD64);
|
||||||
D(PackMachPPC32); // TODO: this works with upx 3.91..3.94 but got broken in 3.95; FIXME
|
VISIT(PackMachPPC32); // TODO: this works with upx 3.91..3.94 but got broken in 3.95; FIXME
|
||||||
D(PackMachI386);
|
VISIT(PackMachI386);
|
||||||
D(PackMachAMD64);
|
VISIT(PackMachAMD64);
|
||||||
D(PackMachARMEL);
|
VISIT(PackMachARMEL);
|
||||||
D(PackMachARM64EL);
|
VISIT(PackMachARM64EL);
|
||||||
|
|
||||||
// 2010-03-12 omit these because PackMachBase<T>::pack4dylib (p_mach.cpp)
|
// 2010-03-12 omit these because PackMachBase<T>::pack4dylib (p_mach.cpp)
|
||||||
// does not understand what the Darwin (Apple Mac OS X) dynamic loader
|
// does not understand what the Darwin (Apple Mac OS X) dynamic loader
|
||||||
// assumes about .dylib file structure.
|
// assumes about .dylib file structure.
|
||||||
// D(PackDylibI386);
|
// VISIT(PackDylibI386);
|
||||||
// D(PackDylibPPC32);
|
// VISIT(PackDylibPPC32);
|
||||||
|
|
||||||
//
|
//
|
||||||
// misc
|
// misc
|
||||||
//
|
//
|
||||||
D(PackTos); // atari/tos
|
VISIT(PackTos); // atari/tos
|
||||||
D(PackPs1); // ps1/exe
|
VISIT(PackPs1); // ps1/exe
|
||||||
D(PackSys); // dos/sys
|
VISIT(PackSys); // dos/sys
|
||||||
D(PackCom); // dos/com
|
VISIT(PackCom); // dos/com
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#undef D
|
#undef VISIT
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ PackerBase *PackMaster::getPacker(InputFile *f) {
|
/*static*/ PackerBase *PackMaster::getPacker(InputFile *f) may_throw {
|
||||||
PackerBase *pb = visitAllPackers(try_can_pack, f, opt, f);
|
PackerBase *pb = visitAllPackers(try_can_pack, f, opt, f);
|
||||||
if (!pb)
|
if (!pb)
|
||||||
throwUnknownExecutableFormat();
|
throwUnknownExecutableFormat();
|
||||||
return pb;
|
return pb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ PackerBase *PackMaster::getUnpacker(InputFile *f) {
|
/*static*/ PackerBase *PackMaster::getUnpacker(InputFile *f) may_throw {
|
||||||
PackerBase *pb = visitAllPackers(try_can_unpack, f, opt, f);
|
PackerBase *pb = visitAllPackers(try_can_unpack, f, opt, f);
|
||||||
if (!pb)
|
if (!pb)
|
||||||
throwNotPacked();
|
throwNotPacked();
|
||||||
@ -254,31 +254,31 @@ PackerBase *PackMaster::visitAllPackers(visit_func_t func, InputFile *f, const O
|
|||||||
// delegation from work.cpp
|
// delegation from work.cpp
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
void PackMaster::pack(OutputFile *fo) {
|
void PackMaster::pack(OutputFile *fo) may_throw {
|
||||||
assert(packer == nullptr);
|
assert(packer == nullptr);
|
||||||
packer = getPacker(fi);
|
packer = getPacker(fi);
|
||||||
packer->doPack(fo);
|
packer->doPack(fo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackMaster::unpack(OutputFile *fo) {
|
void PackMaster::unpack(OutputFile *fo) may_throw {
|
||||||
assert(packer == nullptr);
|
assert(packer == nullptr);
|
||||||
packer = getUnpacker(fi);
|
packer = getUnpacker(fi);
|
||||||
packer->doUnpack(fo);
|
packer->doUnpack(fo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackMaster::test() {
|
void PackMaster::test() may_throw {
|
||||||
assert(packer == nullptr);
|
assert(packer == nullptr);
|
||||||
packer = getUnpacker(fi);
|
packer = getUnpacker(fi);
|
||||||
packer->doTest();
|
packer->doTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackMaster::list() {
|
void PackMaster::list() may_throw {
|
||||||
assert(packer == nullptr);
|
assert(packer == nullptr);
|
||||||
packer = getUnpacker(fi);
|
packer = getUnpacker(fi);
|
||||||
packer->doList();
|
packer->doList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PackMaster::fileInfo() {
|
void PackMaster::fileInfo() may_throw {
|
||||||
assert(packer == nullptr);
|
assert(packer == nullptr);
|
||||||
packer = visitAllPackers(try_can_unpack, fi, opt, fi);
|
packer = visitAllPackers(try_can_unpack, fi, opt, fi);
|
||||||
if (!packer)
|
if (!packer)
|
||||||
|
|||||||
@ -47,16 +47,15 @@ public:
|
|||||||
void fileInfo() may_throw;
|
void fileInfo() may_throw;
|
||||||
|
|
||||||
typedef tribool (*visit_func_t)(PackerBase *pb, void *user);
|
typedef tribool (*visit_func_t)(PackerBase *pb, void *user);
|
||||||
static PackerBase *visitAllPackers(visit_func_t, InputFile *f, const Options *, void *user)
|
static noinline PackerBase *visitAllPackers(visit_func_t, InputFile *f, const Options *,
|
||||||
may_throw;
|
void *user) may_throw;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OwningPointer(PackerBase) packer = nullptr; // owner
|
|
||||||
InputFile *const fi; // reference, required
|
|
||||||
|
|
||||||
static PackerBase *getPacker(InputFile *f) may_throw;
|
static PackerBase *getPacker(InputFile *f) may_throw;
|
||||||
static PackerBase *getUnpacker(InputFile *f) may_throw;
|
static PackerBase *getUnpacker(InputFile *f) may_throw;
|
||||||
|
|
||||||
|
OwningPointer(PackerBase) packer = nullptr; // owner
|
||||||
|
InputFile *const fi; // reference, required
|
||||||
// setup local options for each file
|
// setup local options for each file
|
||||||
Options local_options;
|
Options local_options;
|
||||||
Options *saved_opt = nullptr;
|
Options *saved_opt = nullptr;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user