Implement orphaned sections
[centaur.git] / src / model / section-name.c
index 0e5d903817511b5691553ba3a330e2e217d88a75..68d9986eb2eec84a777161df9ad928c02a617db0 100644 (file)
@@ -1,14 +1,12 @@
 #include <assert.h>
 #include <stdlib.h>
-
-#include <libelf.h>
-#include <gelf.h>
-
+#include <libelf/libelf.h>
+#include <libelf/gelf.h>
 #include <libelfu/libelfu.h>
 
 
 
-char* elfu_modelScnName(ElfuElf *me, ElfuScn *ms)
+char* elfu_mScnName(ElfuElf *me, ElfuScn *ms)
 {
   assert(me);
   assert(ms);
@@ -17,11 +15,9 @@ char* elfu_modelScnName(ElfuElf *me, ElfuScn *ms)
     return NULL;
   }
 
-  if (CIRCLEQ_EMPTY(&me->shstrtab->dataList)) {
+  if (!me->shstrtab->data.d_buf) {
     return NULL;
   }
 
-  /* Don't take multiple data parts into account. */
-  ElfuData *md = me->shstrtab->dataList.cqh_first;
-  return &((char*)md->data.d_buf)[ms->shdr.sh_name];
+  return &((char*)me->shstrtab->data.d_buf)[ms->shdr.sh_name];
 }