1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

DT_NEEDED can be duplicated

modified:   p_lx_elf.cpp
This commit is contained in:
John Reiser 2019-11-26 19:33:27 -08:00
parent 8be9da8280
commit 5d295c24f0

View File

@ -1574,7 +1574,8 @@ PackLinuxElf32::invert_pt_dynamic(Elf32_Dyn const *dynp)
for (; ; ++ndx, ++dynp) {
unsigned const d_tag = get_te32(&dynp->d_tag);
if (d_tag < DT_NUM) {
if (dt_table[d_tag]
if (Elf32_Dyn::DT_NEEDED != d_tag
&& dt_table[d_tag]
&& get_te32(&dynp->d_val)
!= get_te32(&dynp0[-1+ dt_table[d_tag]].d_val)) {
char msg[50]; snprintf(msg, sizeof(msg),
@ -5029,7 +5030,8 @@ PackLinuxElf64::invert_pt_dynamic(Elf64_Dyn const *dynp)
throwCantPack(msg);
}
if (d_tag < DT_NUM) {
if (dt_table[d_tag]
if (Elf64_Dyn::DT_NEEDED != d_tag
&& dt_table[d_tag]
&& get_te64(&dynp->d_val)
!= get_te64(&dynp0[-1+ dt_table[d_tag]].d_val)) {
char msg[50]; snprintf(msg, sizeof(msg),