End users wish to avoid "double packing".

https://github.com/upx/upx/issues/622
	modified:   src/p_lx_elf.cpp
This commit is contained in:
John Reiser 2022-11-09 15:39:16 -08:00 committed by Markus F.X.J. Oberhumer
parent 2578102be9
commit 2a136c1c1d
1 changed files with 3 additions and 0 deletions

View File

@ -2497,6 +2497,9 @@ PackLinuxElf64::canPack()
max_offset = UPX_MAX(max_offset, get_te64(&phdr->p_filesz) + get_te64(&phdr->p_offset));
}
}
if (canUnpack()) {
throwAlreadyPacked();
}
// We want to compress position-independent executable (gcc -pie)
// main programs, but compressing a shared library must be avoided
// because the result is no longer usable. In theory, there is no way