From 29dfd585e8f8d87d978259919f74815493899f01 Mon Sep 17 00:00:00 2001 From: norly Date: Mon, 27 May 2013 03:18:00 +0100 Subject: Turn elfu_gScnSizeFile into a macro --- src/elfops/check.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/elfops/check.c') diff --git a/src/elfops/check.c b/src/elfops/check.c index c7ebc7d..8aaa7b5 100644 --- a/src/elfops/check.c +++ b/src/elfops/check.c @@ -126,14 +126,14 @@ int elfu_eCheck(Elf *e) } /* Section should not overlap with PHDRs. */ - if (OVERLAPPING(shdrs[i].sh_offset, elfu_gScnSizeFile(&shdrs[i]), + if (OVERLAPPING(shdrs[i].sh_offset, SCNFILESIZE(&shdrs[i]), ehdr.e_phoff, numPhdr * ehdr.e_phentsize)) { ELFU_WARN("elfu_eCheck: Section %d overlaps with PHDR.\n", i); goto ERROR; } /* Section should not overlap with SHDRs. */ - if (OVERLAPPING(shdrs[i].sh_offset, elfu_gScnSizeFile(&shdrs[i]), + if (OVERLAPPING(shdrs[i].sh_offset, SCNFILESIZE(&shdrs[i]), ehdr.e_shoff, numShdr * ehdr.e_shentsize)) { ELFU_WARN("elfu_eCheck: Section %d overlaps with SHDRs.\n", i); goto ERROR; @@ -154,8 +154,8 @@ int elfu_eCheck(Elf *e) } /* Sections must not overlap in file. */ - if (OVERLAPPING(shdrs[i].sh_offset, elfu_gScnSizeFile(&shdrs[i]), - shdrs[j].sh_offset, elfu_gScnSizeFile(&shdrs[j]))) { + if (OVERLAPPING(shdrs[i].sh_offset, SCNFILESIZE(&shdrs[i]), + shdrs[j].sh_offset, SCNFILESIZE(&shdrs[j]))) { ELFU_WARN("elfu_eCheck: Sections %d and %d overlap in file.\n", i, j); goto ERROR; } -- cgit v1.2.3