4 #include <libelfu/libelfu.h>
8 * Returns the section that starts at the same point in the file as
9 * the segment AND is wholly contained in the memory image.
11 * If no section fits, NULL is returned.
13 Elf_Scn* elfu_firstSectionInSegment(Elf *e, GElf_Phdr *phdr)
17 scn = elf_getscn(e, 1);
21 if (gelf_getshdr(scn, &shdr) != &shdr) {
25 if (shdr.sh_offset == phdr->p_offset
26 && elfu_segmentContainsSection(phdr, scn) == ELFU_TRUE) {
30 scn = elf_nextscn(e, scn);