summaryrefslogtreecommitdiff
path: root/src/elflint.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-11-22 23:08:48 +0100
committerMark Wielaard <mjw@redhat.com>2014-11-26 20:17:22 +0100
commit712c8faddc08844fb1f2814c8b6e817f03b0698e (patch)
treedf68a29bd32a009875438dfbbd68cbe6f30425c0 /src/elflint.c
parent2deeb7c51020df07d752107cdc6822d70ae1da4e (diff)
downloadelfutils-712c8faddc08844fb1f2814c8b6e817f03b0698e.tar.gz
Use elf_getphdrnum instead of accessing ehdr->e_phnum directly.
Using elf_getphdrnum lets us handle ELF files that use more than PN_XNUM phdrs. And guards against some corrupt files. Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'src/elflint.c')
-rw-r--r--src/elflint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/elflint.c b/src/elflint.c
index d6a47748..fbc78ede 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -3532,7 +3532,7 @@ cannot get section header for section [%2zu] '%s': %s\n"),
GElf_Word good_type = special_sections[s].type;
if (IS_KNOWN_SPECIAL (s, ".plt", false)
- && ebl_bss_plt_p (ebl, ehdr))
+ && ebl_bss_plt_p (ebl))
good_type = SHT_NOBITS;
/* In a debuginfo file, any normal section can be SHT_NOBITS.