From: Mark Wielaard Date: Fri, 16 Mar 2018 18:42:17 +0000 (+0100) Subject: libebl: Handle SYMTAB_SHNDX in ebl_dynamic_tag_name. X-Git-Tag: elfutils-0.171~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92581d7eb483cb039e60112b0a03a04c2ffa4df4;p=thirdparty%2Felfutils.git libebl: Handle SYMTAB_SHNDX in ebl_dynamic_tag_name. 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 --- diff --git a/libebl/ChangeLog b/libebl/ChangeLog index de325ab2e..b4e9049ca 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,9 @@ +2018-03-16 Mark Wielaard + + * 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 * eblcheckreloctargettype.c (ebl_check_reloc_target_type): Accept diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c index 3aaccd0d5..5622fc31d 100644 --- a/libebl/ebldynamictagname.c +++ b/libebl/ebldynamictagname.c @@ -34,6 +34,7 @@ #include #include #include +#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]; }