-#include <stdio.h>
#include <stdlib.h>
-#include <libelf.h>
-#include <gelf.h>
+#include <libelf/libelf.h>
+#include <libelf/gelf.h>
#include <libelfu/libelfu.h>
*
* If no section fits, NULL is returned.
*/
-Elf_Scn* elfu_firstSectionInSegment(Elf *e, GElf_Phdr *phdr)
+Elf_Scn* elfu_eScnFirstInSegment(Elf *e, GElf_Phdr *phdr)
{
Elf_Scn *scn;
}
if (shdr.sh_offset == phdr->p_offset
- && elfu_segmentContainsSection(phdr, &shdr)) {
+ && elfu_gPhdrContainsScn(phdr, &shdr)) {
return scn;
}
*
* If no section fits, NULL is returned.
*/
-Elf_Scn* elfu_lastSectionInSegment(Elf *e, GElf_Phdr *phdr)
+Elf_Scn* elfu_eScnLastInSegment(Elf *e, GElf_Phdr *phdr)
{
Elf_Scn *last = NULL;
Elf_Scn *scn;
GElf_Shdr shdr;
if (gelf_getshdr(scn, &shdr) != &shdr) {
- fprintf(stderr, "gelf_getshdr() failed: %s\n", elf_errmsg(-1));
+ ELFU_WARNELF("gelf_getshdr");
continue;
}
- if (elfu_segmentContainsSection(phdr, &shdr)) {
+ if (elfu_gPhdrContainsScn(phdr, &shdr)) {
if (!last) {
last = scn;
} else {