diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index cf63b710..7652547f 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -3733,6 +3733,7 @@ void PackLinuxElf64::unpack(OutputFile *fo) else { // main executable // Decompress each PT_LOAD. bool first_PF_X = true; + phdr = phdri; for (unsigned j=0; j < u_phnum; ++phdr, ++j) { if (PT_LOAD64==get_te32(&phdr->p_type)) { unsigned const filesz = get_te64(&phdr->p_filesz); @@ -4353,6 +4354,7 @@ void PackLinuxElf32::unpack(OutputFile *fo) else { // main executable // Decompress each PT_LOAD. bool first_PF_X = true; + phdr = phdri; for (unsigned j=0; j < u_phnum; ++phdr, ++j) { if (PT_LOAD32==get_te32(&phdr->p_type)) { unsigned const filesz = get_te32(&phdr->p_filesz);