]> Cypherpunks repositories - gostls13.git/commit
cmd/asm: allow def/ref of func ABI when compiling runtime
authorThan McIntosh <thanm@google.com>
Wed, 7 Oct 2020 16:31:05 +0000 (12:31 -0400)
committerThan McIntosh <thanm@google.com>
Mon, 19 Oct 2020 11:25:35 +0000 (11:25 +0000)
commitdd58239dd20f7002b3e219a477514b91dd0cc5fc
treecec7a6682be941a73be7f810f38463ba3a4f9fb3
parent9499a2e10840e3878bff06e7f9a3bdaa56c5ca45
cmd/asm: allow def/ref of func ABI when compiling runtime

Function symbols defined and referenced by assembly source currently
always default to ABI0; this patch adds preliminary support for
accepting an explicit ABI selector clause for func defs/refs. This
functionality is currently only enabled when compiling runtime-related
packages (runtime, syscall, reflect). Examples:

  TEXT ·DefinedAbi0Symbol<ABI0>(SB),NOSPLIT,$0
        RET

  TEXT ·DefinedAbi1Symbol<ABIInternal>(SB),NOSPLIT,$0
        CALL    ·AbiZerolSym<ABI0>(SB)
...
        JMP     ·AbiInternalSym<ABIInternal>(SB)
        RET

Also included is a small change to the code in the compiler that reads
the symabis file emitted by the assembler.

New behavior is currently gated under GOEXPERIMENT=regabi.

Updates #27539, #40724.

Change-Id: Ia22221fe26df0fa002191cfb13bdfaaa38d7df38
Reviewed-on: https://go-review.googlesource.com/c/go/+/260477
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
src/cmd/asm/internal/asm/endtoend_test.go
src/cmd/asm/internal/asm/expr_test.go
src/cmd/asm/internal/asm/line_test.go
src/cmd/asm/internal/asm/operand_test.go
src/cmd/asm/internal/asm/parse.go
src/cmd/asm/internal/asm/pseudo_test.go
src/cmd/asm/main.go
src/cmd/compile/internal/gc/main.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/util.go
src/cmd/internal/objabi/path.go