summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libelfu/modelops/layout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libelfu/modelops/layout.c b/src/libelfu/modelops/layout.c
index f8a30ed..2fd610c 100644
--- a/src/libelfu/modelops/layout.c
+++ b/src/libelfu/modelops/layout.c
@@ -101,7 +101,8 @@ static ElfuPhdr* appendPhdr(ElfuElf *me)
&lowestOffs, &highestOffsEnd);
if (phdr_maxsz < (me->ehdr.e_phnum + 1) * me->ehdr.e_phentsize
&& phdrmp == lowestAddr
- && phdrmp == lowestOffs) {
+ && phdrmp == lowestOffs
+ && (lowestAddr->phdr.p_vaddr >= 2 * lowestAddr->phdr.p_align)) {
ElfuPhdr *mp;
ElfuScn *ms;
GElf_Word size = ROUNDUP(me->ehdr.e_phentsize, phdrmp->phdr.p_align);