Copy section contents into newly allocated buffers
[centaur.git] / src / model / section-name.c
1 #include <assert.h>
2 #include <stdlib.h>
3 #include <libelf.h>
4 #include <gelf.h>
5 #include <libelfu/libelfu.h>
6
7
8
9 char* elfu_mScnName(ElfuElf *me, ElfuScn *ms)
10 {
11   assert(me);
12   assert(ms);
13
14   if (!me->shstrtab) {
15     return NULL;
16   }
17
18   if (!me->shstrtab->data.d_buf) {
19     return NULL;
20   }
21
22   return &((char*)me->shstrtab->data.d_buf)[ms->shdr.sh_name];
23 }