aboutsummaryrefslogtreecommitdiff
path: root/binutils
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
parentfcbdedf866d777b3598cf8703737eb0f987c2aca (diff)
downloadgdb-3d68f91c0fb05b426e554004cabd3ded4c91f9c8.zip
gdb-3d68f91c0fb05b426e554004cabd3ded4c91f9c8.tar.gz
gdb-3d68f91c0fb05b426e554004cabd3ded4c91f9c8.tar.bz2
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')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/readelf.c50
2 files changed, 52 insertions, 4 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index e8b2daf..34d65fc 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-09 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * readelf.c (display_sparc_hwcaps2): New function.
+ (display_sparc_gnu_attribute): Call `display_sparc_hwcaps2' when
+ handling `Tag_GNU_Sparc_HWCAPS2' attributes.
+
2014-09-22 Alan Modra <amodra@gmail.com>
PR 16563
diff --git a/binutils/readelf.c b/binutils/readelf.c
index d9c12cc..3cf46d8 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);
}