summaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2014-10-09 13:16:53 +0100
committerNick Clifton <nickc@redhat.com>2014-10-09 13:16:53 +0100
commit3d68f91c0fb05b426e554004cabd3ded4c91f9c8 (patch)
tree0297b29c1d0d20a3d36868c0357e23a0db4f6efd /binutils/readelf.c
parentfcbdedf866d777b3598cf8703737eb0f987c2aca (diff)
downloadbinutils-gdb-3d68f91c0fb05b426e554004cabd3ded4c91f9c8.tar.gz
This is a series of patches that add support for the SPARC M7 cpu to
binutils. They were discussed and approved here: https://sourceware.org/ml/binutils/2014-10/msg00038.html
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c50
1 files changed, 46 insertions, 4 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index d9c12cc8da6..3cf46d8b16b 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -11977,22 +11977,64 @@ display_sparc_hwcaps (int mask)
fputc('\n', stdout);
}
+static void
+display_sparc_hwcaps2 (int mask)
+{
+ if (mask)
+ {
+ int first = 1;
+ if (mask & ELF_SPARC_HWCAP2_FJATHPLUS)
+ fputs ("fjathplus", stdout), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_VIS3B)
+ printf ("%svis3b", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_ADP)
+ printf ("%sadp", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_SPARC5)
+ printf ("%ssparc5", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_MWAIT)
+ printf ("%smwait", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_XMPMUL)
+ printf ("%sxmpmul", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_XMONT)
+ printf ("%sxmont2", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_NSEC)
+ printf ("%snsec", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_FJATHHPC)
+ printf ("%sfjathhpc", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_FJDES)
+ printf ("%sfjdes", first ? "" : "|"), first = 0;
+ if (mask & ELF_SPARC_HWCAP2_FJAES)
+ printf ("%sfjaes", first ? "" : "|"), first = 0;
+ }
+ else
+ fputc('0', stdout);
+ fputc('\n', stdout);
+}
+
static unsigned char *
display_sparc_gnu_attribute (unsigned char * p,
int tag,
const unsigned char * const end)
{
+ unsigned int len;
+ int val;
+
if (tag == Tag_GNU_Sparc_HWCAPS)
{
- unsigned int len;
- int val;
-
val = read_uleb128 (p, &len, end);
p += len;
printf (" Tag_GNU_Sparc_HWCAPS: ");
display_sparc_hwcaps (val);
return p;
- }
+ }
+ if (tag == Tag_GNU_Sparc_HWCAPS2)
+ {
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_GNU_Sparc_HWCAPS2: ");
+ display_sparc_hwcaps2 (val);
+ return p;
+ }
return display_tag_value (tag, p, end);
}