mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
default for AT_PHDR if no PT_PHDR (as in static upx)
l_lx_elf.c l_lx_sep.c; not needed in l_lx_sh.c committer: jreiser <jreiser> 973888017 +0000
This commit is contained in:
parent
10f26f276c
commit
b66930fa04
|
@ -344,7 +344,8 @@ void *upx_main(
|
|||
xi.buf -= 2*sizeof(size_t) + sz_pckhdrs;
|
||||
xi.size = ((Elf32_Phdr const *)(1 + my_ehdr))->p_filesz - lsize;
|
||||
|
||||
av[0].a_type = AT_PHDR; // av[0].a_un.a_val is set by do_xmap
|
||||
// av[0].a_un.a_val is set again by do_xmap if PT_PHDR is present
|
||||
av[0].a_type = AT_PHDR; av[0].a_un.a_ptr = 1+(Elf32_Ehdr *)phdr->p_vaddr;
|
||||
av[1].a_type = AT_PHENT; av[1].a_un.a_val = ehdr->e_phentsize;
|
||||
av[2].a_type = AT_PHNUM; av[2].a_un.a_val = ehdr->e_phnum;
|
||||
av[3].a_type = AT_PAGESZ; av[3].a_un.a_val = PAGE_SIZE;
|
||||
|
|
|
@ -394,7 +394,8 @@ ERR_LAB
|
|||
if (lseek(fdi, -(sizeof(xo) + sz_pckhdrs), SEEK_CUR) < 0) {
|
||||
err_exit(17);
|
||||
}
|
||||
av[0].a_type = AT_PHDR; av[0].a_un.a_val = 0; // updated by do_xmap
|
||||
// av[0].a_un.a_val is set again by do_xmap if PT_PHDR is present
|
||||
av[0].a_type = AT_PHDR; av[0].a_un.a_ptr = 1+(Elf32_Ehdr *)phdr->p_vaddr;
|
||||
av[1].a_type = AT_PHENT; av[1].a_un.a_val = ehdr->e_phentsize;
|
||||
av[2].a_type = AT_PHNUM; av[2].a_un.a_val = ehdr->e_phnum;
|
||||
av[3].a_type = AT_PAGESZ; av[3].a_un.a_val = PAGE_SIZE;
|
||||
|
|
Loading…
Reference in New Issue
Block a user