public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libebl: Handle SYMTAB_SHNDX in ebl_dynamic_tag_name.
@ 2018-03-16 18:45 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2018-03-16 18:45 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

SYMTAB_SHNDX was introduced when elf.h was imported, but not yet handled
in ebl_dynamic_tag_name. Handle it and add an eu_static_assert to make
sure stdtags always contains DT_NUM entries.

https://sourceware.org/bugzilla/show_bug.cgi?id=22976

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libebl/ChangeLog           | 6 ++++++
 libebl/ebldynamictagname.c | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index de325ab..b4e9049 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,9 @@
+2018-03-16  Mark Wielaard  <mark@klomp.org>
+
+	* ebldynamictagname.c (ebl_dynamic_tag_name): Add SYMTAB_SHNDX to
+	stdtags. Add a eu_static_assert to make sure stdtags contains all
+	DT_NUM entries.
+
 2018-02-21  Mark Wielaard  <mark@klomp.org>
 
 	* eblcheckreloctargettype.c (ebl_check_reloc_target_type): Accept
diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c
index 3aaccd0..5622fc3 100644
--- a/libebl/ebldynamictagname.c
+++ b/libebl/ebldynamictagname.c
@@ -34,6 +34,7 @@
 #include <inttypes.h>
 #include <stdio.h>
 #include <libeblP.h>
+#include "system.h"
 
 
 const char *
@@ -53,8 +54,9 @@ ebl_dynamic_tag_name (Ebl *ebl, int64_t tag, char *buf, size_t len)
 	      "RELENT", "PLTREL", "DEBUG", "TEXTREL", "JMPREL", "BIND_NOW",
 	      "INIT_ARRAY", "FINI_ARRAY", "INIT_ARRAYSZ", "FINI_ARRAYSZ",
 	      "RUNPATH", "FLAGS", "ENCODING", "PREINIT_ARRAY",
-	      "PREINIT_ARRAYSZ"
+	      "PREINIT_ARRAYSZ", "SYMTAB_SHNDX"
 	    };
+	  eu_static_assert (sizeof (stdtags) / sizeof (const char *) == DT_NUM);
 
 	  res = stdtags[tag];
 	}
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-16 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16 18:45 [PATCH] libebl: Handle SYMTAB_SHNDX in ebl_dynamic_tag_name Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).