go/src
Cherry Zhang b2f94d3e88 cmd/link: mmap output file
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: Austin Clements <austin@google.com>
2019-04-19 18:24:44 +00:00
..
archive archive/zip: use Modified in FileHeader.FileInfo 2019-04-08 07:55:52 +00:00
bufio bufio: fix emptyFinalToken example to handle multiple Reads 2019-03-02 18:28:10 +00:00
builtin builtin: spec correction for panic() 2019-04-05 00:52:55 +00:00
bytes bytes: optimize ToLower and ToUpper for ASCII-only case 2019-04-09 05:45:34 +00:00
cmd cmd/link: mmap output file 2019-04-19 18:24:44 +00:00
compress cmd/go: further reduce init work 2019-03-31 10:49:55 +00:00
container container/heap: avoid memory leak in example 2019-02-26 23:42:26 +00:00
context all: s/cancelation/cancellation/ 2019-04-16 20:27:15 +00:00
crypto crypto/tls: fix a minor MAC vs padding leak 2019-04-16 23:10:02 +00:00
database/sql all: s/cancelation/cancellation/ 2019-04-16 20:27:15 +00:00
debug debug/dwarf: more graceful handling of unsupported types 2019-03-15 17:33:46 +00:00
encoding encoding/json: remove a bounds check in readValue 2019-04-13 13:14:55 +00:00
errors errors: return false if nil error is passed to As 2019-04-10 15:59:35 +00:00
expvar expvar: improve Map.addKey for large number of keys 2019-04-16 17:18:01 +00:00
flag cmd/go: further reduce init work 2019-03-31 10:49:55 +00:00
fmt fmt: fix spelling mistake in example 2019-03-25 21:03:10 +00:00
go internal/goversion: add new package, move Go 1.x constant there out of go/build 2019-04-19 18:04:35 +00:00
hash hash/fnv: use bits.Mul64 for 128-bit hash 2018-12-10 22:50:48 +00:00
html html/template: prevent test from failing with nil pointer dereference 2019-03-02 01:53:40 +00:00
image image: deprecate ZP and ZR 2019-04-07 03:44:17 +00:00
index/suffixarray index/suffixarray: fix a typo mistake in comments 2018-05-29 12:16:51 +00:00
internal internal/goversion: add new package, move Go 1.x constant there out of go/build 2019-04-19 18:04:35 +00:00
io io: align style of test comments in multi_test.go 2019-02-26 23:01:20 +00:00
log log: expose Writer() method of the standard logger 2019-03-25 01:18:56 +00:00
math all: s/cancelation/cancellation/ 2019-04-16 20:27:15 +00:00
mime mime: add .jpeg for builtin 2019-04-03 18:17:48 +00:00
net net: use DNS over TCP when use-vc is set in resolv.conf 2019-04-18 18:51:13 +00:00
os all: s/cancelation/cancellation/ 2019-04-16 20:27:15 +00:00
path path/filepath: add examples for Base, Dir and IsAbs 2019-03-25 02:57:06 +00:00
plugin cmd/compile: reorganize init functions 2019-03-18 20:10:55 +00:00
reflect all: clean up code with token.IsExported 2019-04-16 14:43:48 +00:00
regexp regexp: add ReplaceAllStringFunc example 2019-02-27 21:48:41 +00:00
runtime runtime: suppress thread event prints in gdb test 2019-04-19 17:12:13 +00:00
sort sort, internal/reflectlite: flesh out reflectlite enough for use by sort 2019-03-27 04:58:23 +00:00
strconv strconv: pre-allocate in appendQuotedWith 2019-04-18 04:30:46 +00:00
strings strings: remove "a copy of the string" from ToUpper/ToLower comments 2019-04-14 16:19:31 +00:00
sync sync: update comment 2019-04-19 16:15:36 +00:00
syscall syscall: skip DirentRepeat test on freebsd 2019-04-16 17:14:50 +00:00
testdata Revert "compress: move benchmark text from src/testdata to src/compress/testdata" 2018-10-01 16:16:21 +00:00
testing testing/quick: simplify explanation of -quickchecks flag 2019-04-18 21:21:21 +00:00
text text/template: allow using -}} with many spaces 2019-03-24 09:06:14 +00:00
time time: optimize Sub 2019-03-19 04:10:33 +00:00
unicode unicode: improve generated comments for categories 2018-11-28 03:12:48 +00:00
unsafe cmd/compile: assume unsafe pointer arithmetic generates non-nil results 2018-11-14 21:01:36 +00:00
vendor {,cmd/}vendor: rerun 'go mod vendor' to prune ignored files 2019-04-19 15:36:19 +00:00
all.bash
all.bat
all.rc
bootstrap.bash bootstrap.bash: make source writable before cleaning 2019-04-19 17:04:30 +00:00
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
go.mod all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
go.sum all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
iostest.bash cmd/dist: build exec wrappers during bootstrap 2019-02-26 17:59:23 +00:00
make.bash cmd,std: add go.mod files 2019-03-11 20:27:41 +00:00
make.bat cmd,std: add go.mod files 2019-03-11 20:27:41 +00:00
Make.dist
make.rc cmd,std: add go.mod files 2019-03-11 20:27:41 +00:00
naclmake.bash all: use consistent shebang line across all shell scripts 2018-08-22 16:41:11 +00:00
nacltest.bash all: use consistent shebang line across all shell scripts 2018-08-22 16:41:11 +00:00
race.bash cmd,runtime: enable race detector on arm64 2018-11-13 16:57:22 +00:00
race.bat cmd/dist: fix compilation on windows 2018-08-25 22:39:17 +00:00
run.bash all: move internal/x to vendor/golang.org/x and revendor using 'go mod vendor' 2019-03-11 20:28:54 +00:00
run.bat build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00
run.rc build: clear GO111MODULE during make.bash etc 2018-11-16 18:54:22 +00:00