Skip to content

Commit

Permalink
cmd/internal/obj: add IsAsm flag
Browse files Browse the repository at this point in the history
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 <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
  • Loading branch information
dr2chase committed Apr 24, 2020
1 parent 6677a2a commit f5fcc9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cmd/asm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/internal/obj/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f5fcc9b

Please sign in to comment.