diff options
author | norly <ny-git@enpas.org> | 2013-06-26 19:49:58 +0100 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2013-06-26 19:49:58 +0100 |
commit | 9ebc757b5592844e47bcddfba7335d2e7c590a8b (patch) | |
tree | 1201e1320f9dda71aefd2636b3d06dc45ccc19bb | |
parent | ba9a2612324c2cfaf63d64a722a1a0ecc5793de7 (diff) |
Expand PHDR space only if there are pages available
-rw-r--r-- | src/libelfu/modelops/layout.c | 3 |
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); |