|
Packit Service |
97d2fb |
/* Return dynamic tag name.
|
|
Packit Service |
97d2fb |
Copyright (C) 2001, 2002, 2006, 2008 Red Hat, Inc.
|
|
Packit Service |
97d2fb |
This file is part of elfutils.
|
|
Packit Service |
97d2fb |
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
This file is free software; you can redistribute it and/or modify
|
|
Packit Service |
97d2fb |
it under the terms of either
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU Lesser General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 3 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 2 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or both in parallel, as here.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
elfutils is distributed in the hope that it will be useful, but
|
|
Packit Service |
97d2fb |
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
97d2fb |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
97d2fb |
General Public License for more details.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
You should have received copies of the GNU General Public License and
|
|
Packit Service |
97d2fb |
the GNU Lesser General Public License along with this program. If
|
|
Packit Service |
97d2fb |
not, see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#ifdef HAVE_CONFIG_H
|
|
Packit Service |
97d2fb |
# include <config.h>
|
|
Packit Service |
97d2fb |
#endif
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#include <inttypes.h>
|
|
Packit Service |
97d2fb |
#include <stdio.h>
|
|
Packit Service |
97d2fb |
#include <libeblP.h>
|
|
Packit Service |
97d2fb |
#include "system.h"
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
const char *
|
|
Packit Service |
97d2fb |
ebl_dynamic_tag_name (Ebl *ebl, int64_t tag, char *buf, size_t len)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
const char *res = ebl != NULL ? ebl->dynamic_tag_name (tag, buf, len) : NULL;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
if (res == NULL)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
if (tag >= 0 && tag < DT_NUM)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
static const char *stdtags[] =
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
"NULL", "NEEDED", "PLTRELSZ", "PLTGOT", "HASH", "STRTAB",
|
|
Packit Service |
97d2fb |
"SYMTAB", "RELA", "RELASZ", "RELAENT", "STRSZ", "SYMENT",
|
|
Packit Service |
97d2fb |
"INIT", "FINI", "SONAME", "RPATH", "SYMBOLIC", "REL", "RELSZ",
|
|
Packit Service |
97d2fb |
"RELENT", "PLTREL", "DEBUG", "TEXTREL", "JMPREL", "BIND_NOW",
|
|
Packit Service |
97d2fb |
"INIT_ARRAY", "FINI_ARRAY", "INIT_ARRAYSZ", "FINI_ARRAYSZ",
|
|
Packit Service |
97d2fb |
"RUNPATH", "FLAGS", "ENCODING", "PREINIT_ARRAY",
|
|
Packit Service |
97d2fb |
"PREINIT_ARRAYSZ", "SYMTAB_SHNDX"
|
|
Packit Service |
97d2fb |
};
|
|
Packit Service |
97d2fb |
eu_static_assert (sizeof (stdtags) / sizeof (const char *) == DT_NUM);
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
res = stdtags[tag];
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
else if (tag == DT_VERSYM)
|
|
Packit Service |
97d2fb |
res = "VERSYM";
|
|
Packit Service |
97d2fb |
else if (tag >= DT_GNU_PRELINKED && tag <= DT_SYMINENT)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
static const char *valrntags[] =
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
"GNU_PRELINKED", "GNU_CONFLICTSZ", "GNU_LIBLISTSZ",
|
|
Packit Service |
97d2fb |
"CHECKSUM", "PLTPADSZ", "MOVEENT", "MOVESZ", "FEATURE_1",
|
|
Packit Service |
97d2fb |
"POSFLAG_1", "SYMINSZ", "SYMINENT"
|
|
Packit Service |
97d2fb |
};
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
res = valrntags[tag - DT_GNU_PRELINKED];
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
else if (tag >= DT_GNU_HASH && tag <= DT_SYMINFO)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
static const char *addrrntags[] =
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
"GNU_HASH", "TLSDESC_PLT", "TLSDESC_GOT",
|
|
Packit Service |
97d2fb |
"GNU_CONFLICT", "GNU_LIBLIST", "CONFIG", "DEPAUDIT", "AUDIT",
|
|
Packit Service |
97d2fb |
"PLTPAD", "MOVETAB", "SYMINFO"
|
|
Packit Service |
97d2fb |
};
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
res = addrrntags[tag - DT_GNU_HASH];
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
else if (tag >= DT_RELACOUNT && tag <= DT_VERNEEDNUM)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
static const char *suntags[] =
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
"RELACOUNT", "RELCOUNT", "FLAGS_1", "VERDEF", "VERDEFNUM",
|
|
Packit Service |
97d2fb |
"VERNEED", "VERNEEDNUM"
|
|
Packit Service |
97d2fb |
};
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
res = suntags[tag - DT_RELACOUNT];
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
else if (tag == DT_AUXILIARY)
|
|
Packit Service |
97d2fb |
res = "AUXILIARY";
|
|
Packit Service |
97d2fb |
else if (tag == DT_FILTER)
|
|
Packit Service |
97d2fb |
res = "FILTER";
|
|
Packit Service |
97d2fb |
else
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
snprintf (buf, len, gettext ("<unknown>: %#" PRIx64), tag);
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
res = buf;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
}
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
return res;
|
|
Packit Service |
97d2fb |
}
|