6 #include <libelfu/libelfu.h>
10 * Returns the section that starts at the same point in the file as
11 * the segment AND is wholly contained in the memory image.
13 * If no section fits, NULL is returned.
15 Elf_Scn* elfu_firstSectionInSegment(Elf *e, GElf_Phdr *phdr)
19 scn = elf_getscn(e, 1);
23 if (gelf_getshdr(scn, &shdr) != &shdr) {
27 if (shdr.sh_offset == phdr->p_offset
28 && elfu_segmentContainsSection(phdr, &shdr)) {
32 scn = elf_nextscn(e, scn);