1. 14 Nov, 2018 8 commits
  2. 13 Nov, 2018 18 commits
  3. 12 Nov, 2018 14 commits
    • Emmanuel T Odeke's avatar
      net: preserve unexpired context values for LookupIPAddr · 5d392600
      Emmanuel T Odeke authored
      To avoid any cancelation of the parent context from affecting
      lookupGroup operations, Resolver.LookupIPAddr previously used
      an entirely new context created from context.Background().
      However, this meant that all the values in the parent context
      with which LookupIPAddr was invoked were dropped.
      
      This change provides a custom context implementation
      that only preserves values of the parent context by composing
      context.Background() and the parent context. It only falls back
      to the parent context to perform value lookups if the parent
      context has not yet expired.
      This context is never canceled, and has no deadlines.
      
      Fixes #28600
      
      Change-Id: If2f570caa26c65bad638b7102c35c79d5e429fea
      Reviewed-on: https://go-review.googlesource.com/c/148698
      Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      5d392600
    • Filippo Valsorda's avatar
      crypto/tls: don't modify Config.Certificates in BuildNameToCertificate · 70e3b1df
      Filippo Valsorda authored
      The Config does not own the memory pointed to by the Certificate slice.
      Instead, opportunistically use Certificate.Leaf and let the application
      set it if it desires the performance gain.
      
      This is a partial rollback of CL 107627. See the linked issue for the
      full explanation.
      
      Fixes #28744
      
      Change-Id: I33ce9e6712e3f87939d9d0932a06d24e48ba4567
      Reviewed-on: https://go-review.googlesource.com/c/149098Reviewed-by: 's avatarEmmanuel Odeke <emm.odeke@gmail.com>
      Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      70e3b1df
    • Ali Rizvi-Santiago's avatar
      runtime/cgo: added missing includes for errno.h to the windows gcc stubs. · 595bc63e
      Ali Rizvi-Santiago authored
      This adds the includes for errno.h to the windows stubs
      for runtime/cgo so that "errno" is properly declared.
      
      Due to "errno" not being properly declared, the compiler is
      forced to assume it's an external which leaves it up to the
      linker. This is an issue in some implementations as errno
      might be a macro which results in an unresolved symbol error
      during linking.
      
      runtime/cgo/gcc_libinit_windows.c: added include
      runtime/cgo/gcc_windows_386.c: added include
      runtime/cgo/gcc_windows_amd64.c: added include
      
      Change-Id: I77167d02f7409462979135efc55cf50bbc6bd363
      GitHub-Last-Rev: 90da06ee3cbec3f51c6d31185868bb70341ce9d3
      GitHub-Pull-Request: golang/go#28747
      Reviewed-on: https://go-review.googlesource.com/c/149118
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      595bc63e
    • Austin Clements's avatar
      cmd/compile: fix race on initializing Sym symFunc flag · 5cf2b4c2
      Austin Clements authored
      SSA lowering can create PFUNC ONAME nodes when compiling method calls.
      Since we generally initialize the node's Sym to a func when we set its
      class to PFUNC, we did this here, too. Unfortunately, since SSA
      compilation is concurrent, this can cause a race if two function
      compilations try to initialize the same symbol.
      
      Luckily, we don't need to do this at all, since we're actually just
      wrapping an ONAME node around an existing Sym that's already marked as
      a function symbol.
      
      Fixes the linux-amd64-racecompile builder, which was broken by CL
      147158.
      
      Updates #27539.
      
      Change-Id: I8ddfce6e66a08ce53998c5bfa6f5a423c1ffc1eb
      Reviewed-on: https://go-review.googlesource.com/c/149158
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      5cf2b4c2
    • Austin Clements's avatar
      cmd/compile: create "init" symbol earlier · b52db19b
      Austin Clements authored
      We create the "init" symbol and mark it as a function before compiling
      to SSA because SSA can initialize this symbol, but it turns out we do
      it slightly too late. peekitabs, at least, can also create the "init"
      LSym. Move this initialization to just after type-checking.
      
      Fixes the linux-amd64-ssacheck and the android-arm64-wiko-fever
      builders.
      
      Updates #27539.
      
      Change-Id: If145952c79d39f75c93b24e35e67fe026dd08329
      Reviewed-on: https://go-review.googlesource.com/c/149137
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      b52db19b
    • Austin Clements's avatar
      cmd/compile: fix TestFormats · 891f99eb
      Austin Clements authored
      This fixes the linux-amd64-longtest builder, which was broken by CL
      147160.
      
      Updates #27539.
      
      Change-Id: If6e69581ef503bba2449ec9bacaa31f34f59beb1
      Reviewed-on: https://go-review.googlesource.com/c/149157Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      891f99eb
    • Austin Clements's avatar
      cmd/compile, cmd/link: separate stable and internal ABIs · 685aca45
      Austin Clements authored
      This implements compiler and linker support for separating the
      function calling ABI into two ABIs: a stable and an internal ABI. At
      the moment, the two ABIs are identical, but we'll be able to evolve
      the internal ABI without breaking existing assembly code that depends
      on the stable ABI for calling to and from Go.
      
      The Go compiler generates internal ABI symbols for all Go functions.
      It uses the symabis information produced by the assembler to create
      ABI wrappers whenever it encounters a body-less Go function that's
      defined in assembly or a Go function that's referenced from assembly.
      
      Since the two ABIs are currently identical, for the moment this is
      implemented using "ABI alias" symbols, which are just forwarding
      references to the native ABI symbol for a function. This way there's
      no actual code involved in the ABI wrapper, which is good because
      we're not deriving any benefit from it right now. Once the ABIs
      diverge, we can eliminate ABI aliases.
      
      The linker represents these different ABIs internally as different
      versions of the same symbol. This way, the linker keeps us honest,
      since every symbol definition and reference also specifies its
      version. The linker is responsible for resolving ABI aliases.
      
      Fixes #27539.
      
      Change-Id: I197c52ec9f8fc435db8f7a4259029b20f6d65e95
      Reviewed-on: https://go-review.googlesource.com/c/147160
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      685aca45
    • Austin Clements's avatar
      cmd/link: nice error message on ABI mismatch · 1794ee68
      Austin Clements authored
      Currently, if a symbol is only defined under one ABI and referenced
      under another ABI, you simply get a "relocation target X not defined".
      This is confusing because it seems like the symbol is defined.
      
      This CL enhances the error message in this case to be "relocation
      target X not defined for <ABI> (but is defined for <ABI>)".
      
      For #27539.
      
      Change-Id: If857a1882c3fe9af5346797d5295ca1fe50ae565
      Reviewed-on: https://go-review.googlesource.com/c/147159
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      1794ee68
    • Austin Clements's avatar
      cmd/compile: mark function Syms · 16e6cd9a
      Austin Clements authored
      In order to mark the obj.LSyms produced by the compiler with the
      correct ABI, we need to know which types.Syms refer to function
      symbols. This CL adds a flag to types.Syms to mark symbols for
      functions, and sets this flag everywhere we create a PFUNC-class node,
      and in the one place where we directly create function symbols without
      always wrapping them in a PFUNC node (methodSym).
      
      We'll use this information to construct obj.LSyms with correct ABI
      information.
      
      For #27539.
      
      Change-Id: Ie3ac8bf3da013e449e78f6ca85546a055f275463
      Reviewed-on: https://go-review.googlesource.com/c/147158
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      16e6cd9a
    • Austin Clements's avatar
      cmd/internal/obj, cmd/link: record ABIs and aliases in Go obj files · c5718b6b
      Austin Clements authored
      This repurposes the "version" field of a symbol reference in the Go
      object file format to be an ABI field. Currently, this is just 0 or 1
      depending on whether the symbol is static (the linker turns it into a
      different internal version number), so it's already only tenuously a
      symbol version. We change this to be -1 for static symbols and
      otherwise by the ABI number.
      
      This also adds a separate list of ABI alias symbols to be recorded in
      the object file. The ABI aliases must be a separate list and not just
      part of the symbol definitions because it's possible to have a symbol
      defined in one package and the alias "defined" in a different package.
      For example, this can happen if a symbol is defined in assembly in one
      package and stubbed in a different package. The stub triggers the
      generation of the ABI alias, but in a different package from the
      definition.
      
      For #27539.
      
      Change-Id: I015c9fe54690c027de6ef77e22b5585976a01587
      Reviewed-on: https://go-review.googlesource.com/c/147157
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      c5718b6b
    • Austin Clements's avatar
      cmd/go, cmd/dist: collect known cross-package uses of runtime symbols · 07544c7e
      Austin Clements authored
      This extends cmd/go's symabis support to collect known cross-package
      uses of runtime symbols from other "basically runtime" packages in
      std. This avoids having to declare a large number of ABI0 symbols in
      the runtime for a small number of known cross-package references.
      
      For cmd/dist, we use a simpler but less efficient approach and tell
      the compiler to generate ABI wrappers for everything.
      
      Change-Id: Ifaed94efdcff42e7345ab11b4d2fb880fb1a24e8
      Reviewed-on: https://go-review.googlesource.com/c/147257
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      07544c7e
    • Austin Clements's avatar
      cmd/go, cmd/dist: plumb symabis from assembler to compiler · 0f5dfbcf
      Austin Clements authored
      For #27539.
      
      Change-Id: I0e27f142224e820205fb0e65ad03be7eba93da14
      Reviewed-on: https://go-review.googlesource.com/c/146999
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      0f5dfbcf
    • Austin Clements's avatar
      test: minor simplification to run.go · 7f1dd3ae
      Austin Clements authored
      This is a little clearer, and we're about to need the .s file list in
      one more place, so this will cut down on duplication.
      
      Change-Id: I4da8bf03a0469fb97565b0841c40d505657b574e
      Reviewed-on: https://go-review.googlesource.com/c/146998
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      7f1dd3ae
    • Austin Clements's avatar
      cmd/compile: accept and parse symabis · 97e4010f
      Austin Clements authored
      This doesn't yet do anything with this information.
      
      For #27539.
      
      Change-Id: Ia12c905812aa1ed425eedd6ab2f55ec75d81c0ce
      Reviewed-on: https://go-review.googlesource.com/c/147099
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      97e4010f