diff options
Diffstat (limited to 'src/elfops')
-rw-r--r-- | src/elfops/phdr-contains-section.c | 19 | ||||
-rw-r--r-- | src/elfops/section-in-segment.c | 4 |
2 files changed, 2 insertions, 21 deletions
diff --git a/src/elfops/phdr-contains-section.c b/src/elfops/phdr-contains-section.c deleted file mode 100644 index 7a89d61..0000000 --- a/src/elfops/phdr-contains-section.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <libelf/libelf.h> -#include <libelf/gelf.h> - -#include <libelfu/libelfu.h> - - -int elfu_ePhdrContainsScn(GElf_Phdr *phdr, GElf_Shdr *shdr) -{ - size_t secStart = shdr->sh_offset; - size_t secEnd = shdr->sh_offset + shdr->sh_size; - size_t segStart = phdr->p_offset; - size_t segEnd = phdr->p_offset + phdr->p_memsz; - - if (secStart < segStart || secEnd > segEnd) { - return 0; - } - - return 1; -} diff --git a/src/elfops/section-in-segment.c b/src/elfops/section-in-segment.c index 143c03f..185da36 100644 --- a/src/elfops/section-in-segment.c +++ b/src/elfops/section-in-segment.c @@ -25,7 +25,7 @@ Elf_Scn* elfu_eScnFirstInSegment(Elf *e, GElf_Phdr *phdr) } if (shdr.sh_offset == phdr->p_offset - && elfu_ePhdrContainsScn(phdr, &shdr)) { + && elfu_gPhdrContainsScn(phdr, &shdr)) { return scn; } @@ -59,7 +59,7 @@ Elf_Scn* elfu_eScnLastInSegment(Elf *e, GElf_Phdr *phdr) continue; } - if (elfu_ePhdrContainsScn(phdr, &shdr)) { + if (elfu_gPhdrContainsScn(phdr, &shdr)) { if (!last) { last = scn; } else { |