summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-09-26 20:25:11 +0000
committerRoland McGrath <roland@gnu.org>2004-09-26 20:25:11 +0000
commit1bce9e120e52f0e150d8d710618576b3fd95ff8f (patch)
tree4adce6b3b44b1ce9a83b48176b4f73a717e1a8e3 /exec
parent29626620f7aa9e631a4173bb38069d77088b0bb2 (diff)
(check_elf_phdr): Tweak last change.
Diffstat (limited to 'exec')
-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;