]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link, cmd/internal/goobj2: mmap object file in -newobj mode
authorCherry Zhang <cherryyz@google.com>
Fri, 27 Sep 2019 18:49:44 +0000 (14:49 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 9 Oct 2019 21:00:08 +0000 (21:00 +0000)
commit0d7404c8527dc45469644c0f6b4becfd59c2a4d9
treeba52a03cc10c74748ee7a9c0389b56cf41b486f3
parent24950952759cb26144333b0a47eae7da44808eec
[dev.link] cmd/link, cmd/internal/goobj2: mmap object file in -newobj mode

With the old object file format, we use mmap (if supported) to
read object files and back symbol data with mapped read-only
memory.

Do the same with the new object file format. This also
significantly reduces number of syscalls made to read object
files.

Currently we still do mmap in object file level, not archive
level. This is probably ok, as there shouldn't be many archives
that contain more than one object. If this is a problem we can
change that later.

Change-Id: Icae3ef14d8ed6adbee1b5b48d420e2af22fd9604
Reviewed-on: https://go-review.googlesource.com/c/go/+/197797
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/internal/goobj2/objfile.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/objfile/objfile2.go