From: Mark Wielaard Date: Thu, 18 Jun 2015 10:50:47 +0000 (+0200) Subject: elflint: Only check the PT_TLS phdr if it actually exists, warn otherwise. X-Git-Tag: elfutils-0.163~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77be59bca4057b22af70b0b2d0197f9505577381;p=thirdparty%2Felfutils.git elflint: Only check the PT_TLS phdr if it actually exists, warn otherwise. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index dbd1e44e9..13e66e1c2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-06-18 Mark Wielaard + + * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually + exists. Warn otherwise. + 2015-06-18 Mark Wielaard * nm.c (show_symbols): Check sizeof (sym_mem[0]), not GElf_Sym to diff --git a/src/elflint.c b/src/elflint.c index 1c6a55a79..a91688623 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -858,6 +858,12 @@ section [%2d] '%s': symbol %zu does not fit completely in referenced section [%2 section [%2d] '%s': symbol %zu: TLS symbol but no TLS program header entry\n"), idx, section_name (ebl, idx), cnt); } + else if (phdr == NULL) + { + ERROR (gettext ("\ +section [%2d] '%s': symbol %zu: TLS symbol but couldn't get TLS program header entry\n"), + idx, section_name (ebl, idx), cnt); + } else { if (st_value