An error occurred fetching the project authors.
  1. 05 Dec, 2019 1 commit
  2. 11 Nov, 2019 1 commit
  3. 06 Nov, 2019 1 commit
  4. 05 Nov, 2019 1 commit
    • Matthew Dempsky's avatar
      cmd/compile, cmd/link: add coverage instrumentation for libfuzzer · e341e93c
      Matthew Dempsky authored
      This CL adds experimental coverage instrumentation similar to what
      github.com/dvyukov/go-fuzz produces in its -libfuzzer mode. The
      coverage can be enabled by compiling with -d=libfuzzer. It's intended
      to be used in conjunction with -buildmode=c-archive to produce an ELF
      archive (.a) file that can be linked with libFuzzer. See #14565 for
      example usage.
      
      The coverage generates a unique 8-bit counter for each basic block in
      the original source code, and emits an increment operation. These
      counters are then collected into the __libfuzzer_extra_counters ELF
      section for use by libFuzzer.
      
      Updates #14565.
      
      Change-Id: I239758cc0ceb9ca1220f2d9d3d23b9e761db9bf1
      Reviewed-on: https://go-review.googlesource.com/c/go/+/202117
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      e341e93c
  5. 03 Nov, 2019 1 commit
  6. 28 Oct, 2019 1 commit
  7. 26 Oct, 2019 1 commit
  8. 09 Oct, 2019 2 commits
  9. 01 Oct, 2019 2 commits
  10. 24 Sep, 2019 1 commit
    • Jeremy Faller's avatar
      cmd/link: add notion of multiple compilation units per package · 78a37347
      Jeremy Faller authored
      As we move the debug_line generation into the compiler, we need to
      upgrade the notion of compilationUnit to not just be on a per package
      basis.  That won't be the case as it will be impossible for all
      compilationUnits to have the same set of files names used to build the
      debug_lines table. (For example, assembled files in a package don't know
      about any files but themselves, so the debug_lines table could only
      reference themseves. As such, we need to break the 1:1 relationship
      between compUnit and package.)
      
      Change-Id: I2e517bb6c01de0115bbf777af828a2fe59c09ce8
      Reviewed-on: https://go-review.googlesource.com/c/go/+/189618
      Run-TryBot: Jeremy Faller <jeremy@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      78a37347
  11. 26 Apr, 2019 2 commits
    • Cherry Zhang's avatar
      cmd/link: reduce the size of Reloc struct · 8ef45cf6
      Cherry Zhang authored
      For linking large binaries, the slice of Relocs consumes a large
      amount of memory. We can reduce this memory consumption by
      shrinking the size of the Reloc struct. This CL moves the fields
      used only in external linking or only on PPC64 and S390X to a
      lazily initialized side struct.
      
      Linking k8s.io/kubernetes/cmd/kube-apiserver on Linux/AMD64,
      before:
      inuse_space 1240.25MB total
      438.11MB 35.32% 35.32%   438.11MB 35.32%  cmd/link/internal/objfile.(*objReader).readSlices
      
      after:
      inuse_space 1123.39MB total
      306.85MB 27.31% 55.03%   306.85MB 27.31%  cmd/link/internal/objfile.(*objReader).readSlices
      
      Under GOGC=5 (to simulate system under memory pressure), the max
      RSS reduces from ~2.05G to ~1.83G. Even with external linking the
      max RSS doesn't increase.
      
      Change-Id: I9bb8a8effaed24a8b3c4b1cfb93e6992b8740f91
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173437
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      8ef45cf6
    • Russ Cox's avatar
      cmd/link: make it easy to find binary versions · d6b06f02
      Russ Cox authored
      It is useful to be able to dig the Go version out of a binary,
      even a stripped binary. rsc.io/goversion does this for x86
      binaries by disassembling the binary to find runtime/proc.go's
      startup-time reference to runtime.buildVersion's address.
      That approach is quite fragile: the implementation doesn't
      work for non-x86 and must be updated as the generated
      code changes.
      
      rsc.io/goversion finds the module version string by looking
      for random 16-byte framing around the actual string.
      This is less fragile but fairly kludgy and requires scanning
      the entire data segment.
      
      cmd/buildid finds the build ID by looking for an ELF note
      or else falling back to scanning the beginning of the text
      segment for a magic string. This has proved quite reliable
      and doesn't require scanning much of the binary.
      
      This CL makes it possible to find the Go and module versions
      using a scan more like the build ID scan: a symbol early in
      the writable data segment starts with a magic number and
      then has pointers to the two string variables.
      
      Setting up for "go version <binary>".
      
      For #31624.
      
      Change-Id: I78ea8c52fe1686b5cc5a829ca5f198104d10ebf0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173342
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d6b06f02
  12. 25 Apr, 2019 1 commit
  13. 19 Apr, 2019 5 commits
    • Cherry Zhang's avatar
      cmd/link: mmap object data · dbe32284
      Cherry Zhang authored
      This resurrects CL 121198, except that this time we map read-only.
      
      In case that we need to apply relocations to the symbol's
      content that is backed by read-only memory, we do our own copy-
      on-write. This can happen if we failed to mmap the output file,
      or we build for Wasm.
      
      Memory profile for building k8s.io/kubernetes/cmd/kube-apiserver
      on Linux/AMD64:
      
      Old (before this sequence of CLs):
      inuse_space 1598.75MB total
      669.87MB 41.90% 41.90%   669.87MB 41.90%  cmd/link/internal/objfile.(*objReader).readSlices
      
      New:
      inuse_space 1280.45MB total
      441.18MB 34.46% 34.46%   441.18MB 34.46%  cmd/link/internal/objfile.(*objReader).readSlices
      
      Change-Id: I6b4d29d6eee9828089ea3120eb38c212db21330b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170741
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      dbe32284
    • Cherry Zhang's avatar
      cmd/link: apply relocations later · f957a7e3
      Cherry Zhang authored
      Move the phase of applying relocations later, after the sections
      and segments are written to the mmap'd output region. Then apply
      relocations directly in the output region, instead of the input.
      So the input slices we read in don't need to be modified.
      
      This is in preparation for mmap'ing input files read-only.
      
      Change-Id: If9c80657b4469da36aec5a9ab6acf664f5af8fa0
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170739
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      f957a7e3
    • Cherry Zhang's avatar
      cmd/link: apply DWARF relocations while doing compression · 248444d5
      Cherry Zhang authored
      We are preparing for applying relocations to the output buffer.
      However, for DWARF compression, relocations need to be applied
      before compression, but we don't have an output buffer at that
      time. We also cannot delay DWARF compression to when we mmap the
      output file, because we need the size of the DWARF sections to
      compute the file size.
      
      Instead of applying all the relocations together, we apply
      relocations in DWARF sections one symbol at a time, right before
      it is writing out for compression. As the symbol content may be
      in read-only memory (in the future), we use a temporary buffer
      for applying the relocations, and immediately write it out.
      
      If compression is not used, relocations are still applied all
      together.
      
      This is in preparation for mmap'ing input files read-only.
      
      Change-Id: Iae6d2dd71313897d5054bcc458d3bb78075b30c3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/171397
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      248444d5
    • Cherry Zhang's avatar
      cmd/link: apply R_DWARFFILEREF later · 15a31bd9
      Cherry Zhang authored
      Apply R_DWARFFILEREF relocations later, along with other
      relocations, so that we don't modify symbols' contents before
      they are written to the output buffer.
      
      This is in preparation for mmap'ing input files read-only.
      
      Change-Id: I8e9ffb2f05acf8f198589b8770f277beb3847541
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170740
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      15a31bd9
    • Cherry Zhang's avatar
      cmd/link: mmap output file · b2f94d3e
      Cherry Zhang authored
      Use mmap for writing most of the output file content,
      specifically, the sections and segments. After layout, we
      already know the sizes and file offsets for the sections and
      segments. So we can just write the bytes by copying to a mmap'd
      backing store.
      
      The writing of the output file is split into two parts. The first
      part writes the sections and segments to the mmap'd region. The
      second part writes some extra content, for which we don't know
      the size, so we use direct file IO.
      
      This is in preparation for mmap'ing input files read-only.
      
      Change-Id: I9f3b4616a9f96bfd5c940d74c50aacd6d330f7d2
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170738
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      b2f94d3e
  14. 17 Apr, 2019 1 commit
    • erifan01's avatar
      cmd/link: increase the reserved space for ELF relocations · 3b37ff45
      erifan01 authored
      Currently the offset values of ELF relocations and Macho relocations
      are 256 and 512 respectively, which means that the space reserved for
      ELF relocations is only 256. But AARCH64 has more than 256 ELF relocation
      types, in fact the maximum AARCH64 ELF relocation type recorded in file
      src/debug/elf/elf.go is 1032 currently. So this CL increases the offset
      of Macho relocations to 2048 to leave enough space for AARCH64 ELF
      relocations.
      
      Change-Id: I784ac38aeb3e102ac7825f6d621086849c8d3146
      Reviewed-on: https://go-review.googlesource.com/c/go/+/172497
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3b37ff45
  15. 16 Apr, 2019 1 commit
  16. 29 Mar, 2019 1 commit
  17. 27 Mar, 2019 1 commit
  18. 21 Mar, 2019 1 commit
  19. 18 Mar, 2019 1 commit
    • Keith Randall's avatar
      cmd/compile: reorganize init functions · d949d0b9
      Keith Randall authored
      Instead of writing an init function per package that does the same
      thing for every package, just write that implementation once in the
      runtime. Change the compiler to generate a data structure that encodes
      the required initialization operations.
      
      Reduces cmd/go binary size by 0.3%+.  Most of the init code is gone,
      including all the corresponding stack map info. The .inittask
      structures that replace them are quite a bit smaller.
      
      Most usefully to me, there is no longer an init function in every -S output.
      (There is an .inittask global there, but it's much less distracting.)
      
      After this CL we could change the name of the "init.ializers" function
      back to just "init".
      
      Update #6853
      
      R=go1.13
      
      Change-Id: Iec82b205cc52fe3ade4d36406933c97dbc9c01b1
      Reviewed-on: https://go-review.googlesource.com/c/go/+/161337
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      d949d0b9
  20. 15 Mar, 2019 1 commit
  21. 09 Mar, 2019 1 commit
    • Clément Chigot's avatar
      cmd/link: enable DWARF with external linker on aix/ppc64 · 3cf89e50
      Clément Chigot authored
      In order to allow DWARF with ld, the symbol table is adapted.
      In internal linkmode, each package is considered as a .FILE. However,
      current version of ld is crashing on a few programs because of
      relocations between DWARF symbols. Considering all packages as part of
      one .FILE seems to bypass this bug.
      As it might be fixed in a future release, the size of each package
      in DWARF sections is still retrieved and can be used when it's fixed.
      Moreover, it's improving internal linkmode which should have done it
      anyway.
      
      Change-Id: If3d023fe118b24b9f0f46d201a4849eee8d5e333
      Reviewed-on: https://go-review.googlesource.com/c/go/+/164006
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3cf89e50
  22. 06 Mar, 2019 2 commits
  23. 27 Feb, 2019 3 commits
  24. 17 Dec, 2018 1 commit
  25. 11 Dec, 2018 1 commit
  26. 02 Dec, 2018 1 commit
  27. 27 Nov, 2018 2 commits
  28. 26 Nov, 2018 2 commits