+2020-04-15 Alan Modra <amodra@gmail.com>
+
+ * readelf.c (get_group_flags): Translate text.
+ (get_file_type, get_symbol_binding, get_symbol_type),
+ (get_ppc64_symbol_other, get_symbol_other): Increase size of buffer.
+
2020-04-15 Alan Modra <amodra@gmail.com>
PR 25821
static char *
get_file_type (unsigned e_type)
{
- static char buff[32];
+ static char buff[64];
switch (e_type)
{
else if (flags == GRP_COMDAT)
return "COMDAT ";
- snprintf (buff, 14, _("[0x%x: "), flags);
+ snprintf (buff, sizeof buff, "[0x%x: %s%s%s]",
+ flags,
+ flags & GRP_MASKOS ? _("<OS specific>") : "",
+ flags & GRP_MASKPROC ? _("<PROC specific>") : "",
+ (flags & ~(GRP_COMDAT | GRP_MASKOS | GRP_MASKPROC)
+ ? _("<unknown>") : ""));
- flags &= ~ GRP_COMDAT;
- if (flags & GRP_MASKOS)
- {
- strcat (buff, "<OS specific>");
- flags &= ~ GRP_MASKOS;
- }
-
- if (flags & GRP_MASKPROC)
- {
- strcat (buff, "<PROC specific>");
- flags &= ~ GRP_MASKPROC;
- }
-
- if (flags)
- strcat (buff, "<unknown>");
-
- strcat (buff, "]");
return buff;
}
static const char *
get_symbol_binding (Filedata * filedata, unsigned int binding)
{
- static char buff[32];
+ static char buff[64];
switch (binding)
{
static const char *
get_symbol_type (Filedata * filedata, unsigned int type)
{
- static char buff[32];
+ static char buff[64];
switch (type)
{
other >>= STO_PPC64_LOCAL_BIT;
if (other <= 6)
{
- static char buf[32];
+ static char buf[64];
if (other >= 2)
other = ppc64_decode_local_entry (other);
snprintf (buf, sizeof buf, _("<localentry>: %d"), other);
get_symbol_other (Filedata * filedata, unsigned int other)
{
const char * result = NULL;
- static char buff [32];
+ static char buff [64];
if (other == 0)
return "";