]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd: merge branch 'dev.link' into master
authorCherry Zhang <cherryyz@google.com>
Thu, 2 Apr 2020 19:04:24 +0000 (15:04 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 2 Apr 2020 19:51:19 +0000 (15:51 -0400)
In the dev.link branch we continued developing the new object
file format support and the linker improvements described in
https://golang.org/s/better-linker .

The new object file is index-based and provides random access.
The linker maps the object files into read-only memory, and
accesses symbols on-demand using indices, as opposed to reading
all object files sequentially into the heap with the old format.

This work is not done yet. Currently we still convert back to the
old in-memory representation half way through the link process,
but only for symbols that are needed.

At this point, we think it is ready to enable the new object
files and new linker for early testing. Using the new object
files and the new linker, it reduces the linker's memory usage by
~10% and wall-clock run time by ~5%, and more to come.

Currently, both the old and new object file formats are supported.
The new format and new linker are used by default. For feature
gating, as a fallback, the old format and old linker can be used
by setting the compiler/assembler/linker's -go115newobj flag to
false. Note that the flag needs to be specified consistently to
all compilations, i.e.

-gcflags=all=-go115newobj=false -asmflags=all=-go115newobj=false -ldflags=all=-go115newobj=false

In case we need to revert, we can set the flags default to false.
CL 224626 is an example.

cmd/oldlink is a full copy of the old linker. It is invoked if
the old format is requested.

This is a clean merge, as we already merged master branch to
dev.link first.

Change-Id: I8f081eef8c4621362f03ecbcb850d6262b5d3dc6


Trivial merge