From c8a3acbba8048783e3595cf088a7d1df9be83b92 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Wed, 2 Nov 2022 10:03:25 -0700 Subject: [PATCH] Static executable with 4 PT_LOAD has only ELF headers in first PT_LOAD https://github.com/upx/upx/issues/615 --- src/p_lx_elf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index 3024e8da..9c6025dd 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -4448,7 +4448,7 @@ int PackLinuxElf64::pack2(OutputFile *fo, Filter &ft) } } else // main program, not shared library - if (hdr_u_len < (u64_t)x.size) { + if (hdr_u_len <= (u64_t)x.size) { if (0 == nx) { // 1st PT_LOAD64 must cover Ehdr at 0==p_offset unsigned const delta = hdr_u_len; if (ft.id < 0x40) {