summaryrefslogtreecommitdiff
path: root/src/model/fromFile.c
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2013-05-28 23:34:51 +0100
committernorly <ny-git@enpas.org>2013-05-28 23:34:51 +0100
commiteb5a1daba781013ccf168b95510d0f67f0b9c946 (patch)
tree1737caa39931eaec818b992acc5df43bb02b1794 /src/model/fromFile.c
parent11bf2836351cdb0703506d9d24ebd72bb420d1df (diff)
Implement orphaned sections
Orphaned sections are not (fully) included in any LOAD PHDR and can thus be moved and stripped at will without changing the memory image of the program.
Diffstat (limited to 'src/model/fromFile.c')
-rw-r--r--src/model/fromFile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/model/fromFile.c b/src/model/fromFile.c
index fd6aba0..cb09352 100644
--- a/src/model/fromFile.c
+++ b/src/model/fromFile.c
@@ -167,6 +167,7 @@ ElfuElf* elfu_mFromElf(Elf *e)
/* General stuff */
CIRCLEQ_INIT(&me->scnList);
CIRCLEQ_INIT(&me->phdrList);
+ CIRCLEQ_INIT(&me->orphanScnList);
me->shstrtab = NULL;
me->elfclass = gelf_getclass(e);
@@ -286,6 +287,8 @@ ElfuElf* elfu_mFromElf(Elf *e)
if (parent) {
CIRCLEQ_INSERT_TAIL(&parent->childScnList, ms, elemChildScn);
+ } else {
+ CIRCLEQ_INSERT_TAIL(&me->orphanScnList, ms, elemChildScn);
}
}