mirror of
https://github.com/upx/upx.git
synced 2025-08-11 22:52:30 +08:00
Some PT_LOAD must have (p_flags & PF_X)
https://github.com/upx/upx/issues/511 modified: p_lx_elf.cpp
This commit is contained in:

committed by
Markus F.X.J. Oberhumer

parent
fdc5d25d03
commit
adafa841f7
@ -2168,6 +2168,9 @@ bool PackLinuxElf32::canPack()
|
||||
}
|
||||
check_pt_load(phdr);
|
||||
}
|
||||
if (!pload_x0) {
|
||||
throwCantPack("No PT_LOAD has (p_flags & PF_X)");
|
||||
}
|
||||
// elf_find_dynamic() returns 0 if 0==dynseg.
|
||||
dynstr= (char const *)elf_find_dynamic(Elf32_Dyn::DT_STRTAB);
|
||||
dynsym= (Elf32_Sym const *)elf_find_dynamic(Elf32_Dyn::DT_SYMTAB);
|
||||
@ -2563,6 +2566,9 @@ PackLinuxElf64::canPack()
|
||||
}
|
||||
check_pt_load(phdr);
|
||||
}
|
||||
if (!pload_x0) {
|
||||
throwCantPack("No PT_LOAD has (p_flags & PF_X)");
|
||||
}
|
||||
// elf_find_dynamic() returns 0 if 0==dynseg.
|
||||
dynstr= (char const *)elf_find_dynamic(Elf64_Dyn::DT_STRTAB);
|
||||
dynsym= (Elf64_Sym const *)elf_find_dynamic(Elf64_Dyn::DT_SYMTAB);
|
||||
|
Reference in New Issue
Block a user