]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix ARM and AArch64 assembler tests to work in a multi-arch environment.
authorNick Clifton <nickc@redhat.com>
Mon, 21 Nov 2022 16:44:02 +0000 (16:44 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 21 Nov 2022 16:44:02 +0000 (16:44 +0000)
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.

bfd/ChangeLog
bfd/cpu-aarch64.c
bfd/cpu-arm.c
binutils/ChangeLog
binutils/doc/binutils.texi
gas/ChangeLog
gas/testsuite/gas/aarch64/cpu-cortex-a76ae.d
gas/testsuite/gas/aarch64/cpu-cortex-a77.d
gas/testsuite/gas/arm/cpu-cortex-a76ae.d
gas/testsuite/gas/arm/cpu-cortex-a77.d

index 065017754533731ee5200b5767cf2d1199b07154..24aa783e1a754d0ffcfa44acc3c2b5b5b07ba7b4 100644 (file)
@@ -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
index eb88d0ef8611315de59f86b6eb8b470729b54eec..d51f2e3bde328653af7898e05f1cf260886d1a53 100644 (file)
@@ -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--;)
     {
index 853a118d4d47c6660bc7673e82b618d306bae786..6d77e1222dd2750ddda40203bb49c51bcb59b62c 100644 (file)
@@ -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--;)
     {
index b6bb667d0270b2993fe09d09d2273a6e5e1c5266..dfa5f1f22c81eaa13c951957de3f78e6fa4c25b8 100644 (file)
@@ -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
index 483b72f443eef0accbd55a34f0bce83afc1291f8..6024301562da514b4c01940af5518b0e4a3fd538 100644 (file)
@@ -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}.
index a299d024d95b756290698480743fbe7583e8e5de..74dbaa00c0c1ef304432e7a42f89dd076db0de06 100644 (file)
@@ -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.
index 7f7cf2952c6a5601bb1102e6f12d5e25a7618e61..5870e307bf4563d3de743af0aa94816355512303 100644 (file)
@@ -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
 
 #...
index caff73fe0763373bb63c69f9d27c52631417a82c..4a4af8fe3be7577bf38a4753c5fe1f4296be234f 100644 (file)
@@ -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
 
 #...
index 7f7cf2952c6a5601bb1102e6f12d5e25a7618e61..b3cb849e5f3a97c42e8de1b1cbfb922e14f9dbf3 100644 (file)
@@ -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
 
 #...
index caff73fe0763373bb63c69f9d27c52631417a82c..090edcc6d0d0a00955d4c60fa82c68f16c73fd43 100644 (file)
@@ -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
 
 #...