projects
/
centaur.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a417ad3
)
Expand downwards only if there is enough space
author
norly
<ny-git@enpas.org>
Wed, 26 Jun 2013 17:44:42 +0000
(18:44 +0100)
committer
norly
<ny-git@enpas.org>
Wed, 26 Jun 2013 17:44:42 +0000
(18:44 +0100)
src/libelfu/modelops/layout.c
patch
|
blob
|
history
diff --git
a/src/libelfu/modelops/layout.c
b/src/libelfu/modelops/layout.c
index 4026e58ce3e1e1a341201fe861bf8424b933aa17..f8a30ed4e2d66b4a40eebbfd45fb70e77abeeb84 100644
(file)
--- a/
src/libelfu/modelops/layout.c
+++ b/
src/libelfu/modelops/layout.c
@@
-240,7
+240,8
@@
GElf_Addr elfu_mLayoutGetSpaceInPhdr(ElfuElf *me, GElf_Word size,
} else if (((w && (lowestAddr->phdr.p_flags & PF_W))
|| (x && (lowestAddr->phdr.p_flags & PF_X)))
&& /* Enough space to expand downwards? */
} else if (((w && (lowestAddr->phdr.p_flags & PF_W))
|| (x && (lowestAddr->phdr.p_flags & PF_X)))
&& /* Enough space to expand downwards? */
- (lowestAddr->phdr.p_vaddr > 3 * lowestAddr->phdr.p_align)
+ (lowestAddr->phdr.p_vaddr >= ((2 * lowestAddr->phdr.p_align)
+ + ROUNDUP(size, lowestAddr->phdr.p_align)))
/* Merging only works if the LOAD is the first both in file and mem */
&& lowestAddr == lowestOffs) {
/* Need to prepend or split up the PHDR. */
/* Merging only works if the LOAD is the first both in file and mem */
&& lowestAddr == lowestOffs) {
/* Need to prepend or split up the PHDR. */