]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.link] all: merge branch 'master' into dev.link
authorCherry Zhang <cherryyz@google.com>
Fri, 27 Mar 2020 17:39:19 +0000 (13:39 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 27 Mar 2020 17:39:19 +0000 (13:39 -0400)
The only merge conflict is the addition of -spectre flag on
master and the addition of -go115newobj flag on dev.link.
Resolved trivially.

Change-Id: I5b46c2b25e140d6c3d8cb129acbd7a248ff03bb9

1  2 
src/cmd/asm/internal/flags/flags.go
src/cmd/asm/main.go
src/cmd/compile/internal/gc/main.go
src/cmd/internal/obj/link.go

index 14d4b87fd208f6c74b56edd79c90b11249429518,618b08cc36e9298752a64709e0a61c76b4a819bf..e8535ae9ac9d92497ba4b9d6377204d1d32398f6
@@@ -23,9 -23,9 +23,10 @@@ var 
        Dynlink    = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries")
        AllErrors  = flag.Bool("e", false, "no limit on number of errors reported")
        SymABIs    = flag.Bool("gensymabis", false, "write symbol ABI information to output file, don't assemble")
 -      Newobj     = flag.Bool("newobj", false, "use new object file format")
 +      Importpath = flag.String("p", "", "set expected package import to path")
++      Spectre    = flag.String("spectre", "", "enable spectre mitigations in `list` (all, ret)")
  
 -      Spectre = flag.String("spectre", "", "enable spectre mitigations in `list` (all, ret)")
 +      Go115Newobj = flag.Bool("go115newobj", true, "use new object file format")
  )
  
  var (
index 9a0e87f36ba2f0f9058ea67e54a04de45b0dd778,21c8bd963a437ee9aca98a403f207e8684d4e1a7..a927de854b3e4015ee5511d3e42cce196974d664
@@@ -40,7 -40,20 +40,20 @@@ func main() 
        }
        ctxt.Flag_dynlink = *flags.Dynlink
        ctxt.Flag_shared = *flags.Shared || *flags.Dynlink
 -      ctxt.Flag_newobj = *flags.Newobj
 +      ctxt.Flag_go115newobj = *flags.Go115Newobj
+       switch *flags.Spectre {
+       default:
+               log.Printf("unknown setting -spectre=%s", *flags.Spectre)
+               os.Exit(2)
+       case "":
+               // nothing
+       case "index":
+               // known to compiler; ignore here so people can use
+               // the same list with -gcflags=-spectre=LIST and -asmflags=-spectrre=LIST
+       case "all", "ret":
+               ctxt.Retpoline = true
+       }
        ctxt.Bso = bufio.NewWriter(os.Stdout)
        defer ctxt.Bso.Flush()
  
index 27ed4ee3ccea2cf540b7e99328d47cac1fbec0d0,81d31c2007c4e089bec9f172474851bed07eccee..d04c09c93e66cc323b85ead23115a006d0da3f8b
@@@ -285,7 -314,7 +314,7 @@@ func Main(archInit func(*Arch)) 
        // Record flags that affect the build result. (And don't
        // record flags that don't, since that would cause spurious
        // changes in the binary.)
-       recordFlags("B", "N", "l", "msan", "race", "shared", "dynlink", "dwarflocationlists", "dwarfbasentries", "smallframes", "go115newobj")
 -      recordFlags("B", "N", "l", "msan", "race", "shared", "dynlink", "dwarflocationlists", "dwarfbasentries", "smallframes", "spectre", "newobj")
++      recordFlags("B", "N", "l", "msan", "race", "shared", "dynlink", "dwarflocationlists", "dwarfbasentries", "smallframes", "spectre", "go115newobj")
  
        if smallFrames {
                maxStackVarSize = 128 * 1024
index 0070adaac392395ad31410d175720e0f6764f001,d1cc536a8c1827dc13dc3771ed0f59d2fec5c53e..9dd821d532a84b5f26c28ec17d142b339a6e6503
@@@ -652,7 -652,8 +652,8 @@@ type Link struct 
        Flag_linkshared    bool
        Flag_optimize      bool
        Flag_locationlists bool
 -      Flag_newobj        bool // use new object file format
 +      Flag_go115newobj   bool // use new object file format
+       Retpoline          bool // emit use of retpoline stubs for indirect jmp/call
        Bso                *bufio.Writer
        Pathname           string
        hashmu             sync.Mutex       // protects hash, funchash