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
This commit is contained in:
John Reiser 2020-01-19 18:48:50 -08:00
parent 936013f60c
commit 342b1b7d6c

View File

@ -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"
}