From 342b1b7d6ce6bd60a3420115a56bcbc2f645b493 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 19 Jan 2020 18:48:50 -0800 Subject: [PATCH] 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 --- 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 70349487..c03d6ee6 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -2956,7 +2956,7 @@ PackLinuxElf64::generateElfHdr( ) { // propagate sloppiness so that decompression does not complain h3->ehdr.e_ident[Elf64_Ehdr::EI_OSABI] = ehdri.e_ident[Elf64_Ehdr::EI_OSABI]; } - if (Elf64_Ehdr::EM_PPC64 == ehdri.e_machine) { + if (Elf64_Ehdr::EM_PPC64 == get_te16(&ehdri.e_machine)) { h3->ehdr.e_flags = ehdri.e_flags; // "0x1, abiv1" vs "0x2, abiv2" }