From 712c8faddc08844fb1f2814c8b6e817f03b0698e Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 22 Nov 2014 23:08:48 +0100 Subject: 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 --- src/elflint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/elflint.c') 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. -- cgit v1.2.1