This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]