aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-11-21 16:44:02 +0000
committerNick Clifton <nickc@redhat.com>2022-11-21 16:44:02 +0000
commit1a7e622b82fa621ab505dd911bc30c1efcb4a9b0 (patch)
tree6736a37fd2c9c46a1de07f4b847087e11af15797
parentb0b23e06c3a2e3b92d6f12d99650c7d1cc5d939c (diff)
downloadgdb-1a7e622b82fa621ab505dd911bc30c1efcb4a9b0.zip
gdb-1a7e622b82fa621ab505dd911bc30c1efcb4a9b0.tar.gz
gdb-1a7e622b82fa621ab505dd911bc30c1efcb4a9b0.tar.bz2
Fix ARM and AArch64 assembler tests to work in a multi-arch environment.
PR 29764 gas * testsuite/gas/arm/cpu-cortex-a76ae.d: Add arm prefix to the -m option passed to objdump. * testsuite/gas/arm/cpu-cortex-a77.d: Likewise. * testsuite/gas/aarch64/cpu-cortex-a76ae.d: Add aarch64 prefix to the -m option passed to objdump. * testsuite/gas/aarch64/cpu-cortex-a77.d: Likewise. bfd * cpu-arm.c (scan): Accept machine names prefixed with "arm:". * cpu-aarch64.c (scan): Accept machine names prefixed with "aarch64:". bin * doc/binutils.texi (objdump): Note that the -m option supports the <architecture>:<machine> syntax.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/cpu-aarch64.c9
-rw-r--r--bfd/cpu-arm.c9
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/doc/binutils.texi6
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/testsuite/gas/aarch64/cpu-cortex-a76ae.d2
-rw-r--r--gas/testsuite/gas/aarch64/cpu-cortex-a77.d2
-rw-r--r--gas/testsuite/gas/arm/cpu-cortex-a76ae.d2
-rw-r--r--gas/testsuite/gas/arm/cpu-cortex-a77.d2
10 files changed, 50 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 06501775..24aa783 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2022-11-21 Nick Clifton <nickc@redhat.com>
+
+ PR 29764
+ * cpu-arm.c (scan): Accept machine names prefixed with "arm:".
+ * cpu-aarch64.c (scan): Accept machine names prefixed with "aarch64:".
+
2022-10-19 Nick Clifton <nickc@redhat.com>
PR 29699
diff --git a/bfd/cpu-aarch64.c b/bfd/cpu-aarch64.c
index eb88d0e..d51f2e3 100644
--- a/bfd/cpu-aarch64.c
+++ b/bfd/cpu-aarch64.c
@@ -85,6 +85,15 @@ scan (const struct bfd_arch_info *info, const char *string)
if (strcasecmp (string, info->printable_name) == 0)
return true;
+ /* If there is a prefix of "aarch64:" then skip it. */
+ const char * colon;
+ if ((colon = strchr (string, ':')) != NULL)
+ {
+ if (strncasecmp (string, "aarch64", colon - string) != 0)
+ return false;
+ string = colon + 1;
+ }
+
/* Next check for a processor name instead of an Architecture name. */
for (i = sizeof (processors) / sizeof (processors[0]); i--;)
{
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index 853a118..6d77e12 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -210,6 +210,15 @@ scan (const struct bfd_arch_info *info, const char *string)
if (strcasecmp (string, info->printable_name) == 0)
return true;
+ /* If there is a prefix of "arm:" then skip it. */
+ const char * colon;
+ if ((colon = strchr (string, ':')) != NULL)
+ {
+ if (strncasecmp (string, "arm", colon - string) != 0)
+ return false;
+ string = colon + 1;
+ }
+
/* Next check for a processor name instead of an Architecture name. */
for (i = sizeof (processors) / sizeof (processors[0]); i--;)
{
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b6bb667..dfa5f1f 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2022-11-21 Nick Clifton <nickc@redhat.com>
+
+ PR 29764
+ * doc/binutils.texi (objdump): Note that the -m option supports
+ the <architecture>:<machine> syntax.
+
2022-11-04 Nick Clifton <nickc@redhat.com>
* README-how-to-make-a-release: Add instructions for uploading the
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 483b72f..6024301 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -2526,6 +2526,12 @@ can be useful when disassembling object files which do not describe
architecture information, such as S-records. You can list the available
architectures with the @option{-i} option.
+For most architectures it is possible to supply an architecture
+name and a machine name, separated by a colon. For example
+@samp{foo:bar} would refer to the @samp{bar} machine type in the
+@samp{foo} architecture. This can be helpful if objdump has been
+configured to support multiple architectures.
+
If the target is an ARM architecture then this switch has an
additional effect. It restricts the disassembly to only those
instructions supported by the architecture specified by @var{machine}.
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a299d02..74dbaa0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+2022-11-21 Nick Clifton <nickc@redhat.com>
+
+ PR 29764
+ * testsuite/gas/arm/cpu-cortex-a76ae.d: Add arm prefix to the -m
+ option passed to objdump.
+ * testsuite/gas/arm/cpu-cortex-a77.d: Likewise.
+ * testsuite/gas/aarch64/cpu-cortex-a76ae.d: Add aarch64 prefix to
+ the -m option passed to objdump.
+ * testsuite/gas/aarch64/cpu-cortex-a77.d: Likewise.
+
2022-10-31 Nick Clifton <nickc@redhat.com>
* testsuite/gas/rx/mvtacgu.d: Update expected disassembly.
diff --git a/gas/testsuite/gas/aarch64/cpu-cortex-a76ae.d b/gas/testsuite/gas/aarch64/cpu-cortex-a76ae.d
index 7f7cf29..5870e30 100644
--- a/gas/testsuite/gas/aarch64/cpu-cortex-a76ae.d
+++ b/gas/testsuite/gas/aarch64/cpu-cortex-a76ae.d
@@ -1,6 +1,6 @@
# name: Assemble and dump for cortex-a76ae CPU
# source: nop-asm.s
# as: -mcpu=cortex-a76ae
-# objdump: -d -mcortex-a76ae
+# objdump: -d -maarch64:cortex-a76ae
#...
diff --git a/gas/testsuite/gas/aarch64/cpu-cortex-a77.d b/gas/testsuite/gas/aarch64/cpu-cortex-a77.d
index caff73f..4a4af8f 100644
--- a/gas/testsuite/gas/aarch64/cpu-cortex-a77.d
+++ b/gas/testsuite/gas/aarch64/cpu-cortex-a77.d
@@ -1,6 +1,6 @@
# name: Assemble and dump for cortex-a77 CPU
# source: nop-asm.s
# as: -mcpu=cortex-a77
-# objdump: -d -mcortex-a77
+# objdump: -d -maarch64:cortex-a77
#...
diff --git a/gas/testsuite/gas/arm/cpu-cortex-a76ae.d b/gas/testsuite/gas/arm/cpu-cortex-a76ae.d
index 7f7cf29..b3cb849 100644
--- a/gas/testsuite/gas/arm/cpu-cortex-a76ae.d
+++ b/gas/testsuite/gas/arm/cpu-cortex-a76ae.d
@@ -1,6 +1,6 @@
# name: Assemble and dump for cortex-a76ae CPU
# source: nop-asm.s
# as: -mcpu=cortex-a76ae
-# objdump: -d -mcortex-a76ae
+# objdump: -d -marm:cortex-a76ae
#...
diff --git a/gas/testsuite/gas/arm/cpu-cortex-a77.d b/gas/testsuite/gas/arm/cpu-cortex-a77.d
index caff73f..090edcc 100644
--- a/gas/testsuite/gas/arm/cpu-cortex-a77.d
+++ b/gas/testsuite/gas/arm/cpu-cortex-a77.d
@@ -1,6 +1,6 @@
# name: Assemble and dump for cortex-a77 CPU
# source: nop-asm.s
# as: -mcpu=cortex-a77
-# objdump: -d -mcortex-a77
+# objdump: -d -marm:cortex-a77
#...