Only establish PHDR->Scn relationship for PT_LOAD
authornorly <ny-git@enpas.org>
Mon, 27 May 2013 15:40:31 +0000 (16:40 +0100)
committernorly <ny-git@enpas.org>
Mon, 27 May 2013 15:40:31 +0000 (16:40 +0100)
src/model/fromFile.c

index bd085f6c61558b75d564f5341c0ddbd02d71804c..af54555917f77107c49c518f7665ba65ceb6a0e7 100644 (file)
@@ -38,6 +38,10 @@ static ElfuPhdr* parentPhdr(ElfuElf *me, ElfuScn *ms)
   assert(ms);
 
   CIRCLEQ_FOREACH(mp, &me->phdrList, elem) {
+    if (mp->phdr.p_type != PT_LOAD) {
+      continue;
+    }
+
     if (ms->shdr.sh_addr >= mp->phdr.p_vaddr
         && OFFS_END(ms->shdr.sh_addr, ms->shdr.sh_size) <= OFFS_END(mp->phdr.p_vaddr, mp->phdr.p_memsz)) {
       return mp;