From: David Chase Date: Thu, 23 Apr 2020 23:52:31 +0000 (-0400) Subject: cmd/internal/obj: add IsAsm flag X-Git-Tag: go1.15beta1~410 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f5fcc9b8e08aa94c1f8ad2b91f447e32940a5435;p=gostls13.git cmd/internal/obj: add IsAsm flag This allows more exciting changes to compiler-generated assembly language that might not be correct for tricky hand-crafted assembly (e.g., nop padding breaking tables of call or branch instructions). Updates #35881 Change-Id: I842b811796076c160180a364564f2844604df3fb Reviewed-on: https://go-review.googlesource.com/c/go/+/229708 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- diff --git a/src/cmd/asm/main.go b/src/cmd/asm/main.go index a927de854b..9ca9797a45 100644 --- a/src/cmd/asm/main.go +++ b/src/cmd/asm/main.go @@ -41,6 +41,7 @@ func main() { ctxt.Flag_dynlink = *flags.Dynlink ctxt.Flag_shared = *flags.Shared || *flags.Dynlink ctxt.Flag_go115newobj = *flags.Go115Newobj + ctxt.IsAsm = true switch *flags.Spectre { default: log.Printf("unknown setting -spectre=%s", *flags.Spectre) diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index 046ad53ac7..c7bab6a2ca 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -675,7 +675,8 @@ type Link struct { InParallel bool // parallel backend phase in effect Framepointer_enabled bool - UseBASEntries bool // Use Base Address Selection Entries in location lists and PC ranges + UseBASEntries bool // use Base Address Selection Entries in location lists and PC ranges + IsAsm bool // is the source assembly language, which may contain surprising idioms (e.g., call tables) // state for writing objects Text []*LSym