GAS/MIPS: add "--defsym r6=" for default when it's r6

Message ID 20231114062201.1499958-1-yunqiang.su@cipunited.com
State Accepted
Headers
Series GAS/MIPS: add "--defsym r6=" for default when it's r6 |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

YunQiang Su Nov. 14, 2023, 6:22 a.m. UTC
  In mips.exp, `mips_arch_create` is used to create an test arch,
and it will try to create a `default` arch.
When our gas is configured as mips32r6/mips64r6, the '--defsym r6='
option is missing when create `default`.
Let's add it back.
---
 gas/testsuite/gas/mips/mips.exp | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Nick Clifton Nov. 15, 2023, 1:45 p.m. UTC | #1
Hi YunQiang Su,

> In mips.exp, `mips_arch_create` is used to create an test arch,
> and it will try to create a `default` arch.
> When our gas is configured as mips32r6/mips64r6, the '--defsym r6='
> option is missing when create `default`.

Patch approved and applied.

Cheers
   Nick
  

Patch

diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 86753e57b79..0611273cac6 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -161,6 +161,12 @@  proc mips_arch_create {arch gprsize extends props as_flags objdump_flags
 
 	    set archdata(displayname) "default = $arch"
     	    set archdata(as_flags) ""
+	    if { [string compare $arch mips32r6] == 0
+		 ||  [string compare $arch mips64r6] == 0} {
+		set archdata(as_flags) "--defsym r6="
+	    } else {
+		set archdata(as_flags) ""
+	    }
 	    set archdata(objdump_flags) ""
 
 	    set mips_arches(default) [array get archdata]