summaryrefslogtreecommitdiff
path: root/src/model/layout.c
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2013-06-02 04:05:30 +0100
committernorly <ny-git@enpas.org>2013-06-03 02:08:46 +0100
commita08653637257ceaef8e61d965ab0d6c52b0c697d (patch)
tree8d5a0d2e1d42a582e0f4e98919817ecc7b5e1792 /src/model/layout.c
parentc68a087b1de2fc9be1bfc588a7b207f97667f897 (diff)
Guess where unknown functions are in .rel.plt
Diffstat (limited to 'src/model/layout.c')
-rw-r--r--src/model/layout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/model/layout.c b/src/model/layout.c
index d5d49d8..e4b3fb1 100644
--- a/src/model/layout.c
+++ b/src/model/layout.c
@@ -82,6 +82,12 @@ GElf_Addr elfu_mLayoutGetSpaceInPhdr(ElfuElf *me, GElf_Word size,
assert(!(w && x));
+ /* Treat read-only data as executable.
+ * That's what the GNU toolchain does on x86. */
+ if (!w && !x) {
+ x = 1;
+ }
+
/* Find first and last LOAD PHDRs.
* Don't compare p_memsz - segments don't overlap in memory. */
CIRCLEQ_FOREACH(mp, &me->phdrList, elem) {