From 77be59bca4057b22af70b0b2d0197f9505577381 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 18 Jun 2015 12:50:47 +0200 Subject: elflint: Only check the PT_TLS phdr if it actually exists, warn otherwise. Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 +++++ src/elflint.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index dbd1e44e..13e66e1c 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 1c6a55a7..a9168862 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 -- cgit v1.2.3