arm64/arm64asm: recognise new ssbb/pssbb mnemonics from objdump
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Thu, 20 Sep 2018 07:20:31 +0000 (09:20 +0200)
committerDr. Tobias Quathamer <toddy@debian.org>
Fri, 28 Dec 2018 15:11:01 +0000 (15:11 +0000)
Fixes golang/go#27754

Change-Id: I8fcc3bc3c718cf0d93afbd1d383df48316b522d4
Reviewed-on: https://go-review.googlesource.com/136455
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Gbp-Pq: Name 0004-arm64-arm64asm-recognise-new-ssbb-pssbb-mnemonics-fr.patch

src/cmd/vendor/golang.org/x/arch/arm64/arm64asm/objdump_test.go

index 1e7966de7152f622bcad58dc0c5ff0c8bf611585..16d2aea128af1bd5e7dcf94787a0ea67234db33a 100644 (file)
@@ -98,6 +98,13 @@ func allowedMismatchObjdump(text string, inst *Inst, dec ExtInst) bool {
                        return true
                }
        }
+       // New objdump supports some newer mnemonics than this package. This
+       // package should be updated to support the new mnemonics and the sense
+       // of this reversed to continue passing with older objdumps but that
+       // requires internal ARM tooling.
+       if newForm, ok := newMnemonics[text]; ok && newForm == dec.text {
+               return true
+       }
        // GNU objdump misses spaces between operands for some instructions (e.g., "ld1 {v10.2s, v11.2s}, [x23],#16")
        if strings.Replace(text, " ", "", -1) == strings.Replace(dec.text, " ", "", -1) {
                return true
@@ -143,3 +150,8 @@ var oldObjdumpMismatch = map[string]string{
        "strh":  "sturh",
        "prfm":  "prfum",
 }
+
+var newMnemonics = map[string]string{
+       "dsb #0x00": "ssbb",
+       "dsb #0x04": "pssbb",
+}