This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] elflint: Only check the PT_TLS phdr if it actually exists.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 18 Jun 2015 12:51:43 +0200
- Subject: [PATCH] elflint: Only check the PT_TLS phdr if it actually exists.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
src/ChangeLog | 5 +++++
src/elflint.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 1b4f1d6..06d67f9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2015-06-18 Mark Wielaard <mjw@redhat.com>
+ * elflint.c (check_symtab): Only check the PT_TLS phdr if it actually
+ exists.
+
+2015-06-18 Mark Wielaard <mjw@redhat.com>
+
* nm.c (show_symbols): Check sizeof (GElf_SymX), not GElf_Sym to
known whether or not we stack allocated memory.
diff --git a/src/elflint.c b/src/elflint.c
index 1c6a55a..6b5a6a9 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -858,7 +858,7 @@ 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
+ else if (phdr != NULL)
{
if (st_value
< destshdr->sh_offset - phdr->p_offset)
--
1.8.3.1