summaryrefslogtreecommitdiff
path: root/exec/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'exec/exec.c')
-rw-r--r--exec/exec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/exec/exec.c b/exec/exec.c
index 0e555145..a4dcc375 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -918,6 +918,8 @@ check_elf_phdr (struct execdata *e, const ElfW(Phdr) *mapped_phdr)
break;
case PT_LOAD:
/* Sanity check. */
+ if ((phdr->p_offset & -phdr->p_align) == 0)
+ e->info.elf.phdr_addr += phdr->p_vaddr - phdr->p_offset;
if (e->file_size <= (off_t) (phdr->p_offset +
phdr->p_filesz))
e->error = ENOEXEC;