From: Cherry Zhang Date: Thu, 2 Apr 2020 19:04:24 +0000 (-0400) Subject: cmd: merge branch 'dev.link' into master X-Git-Tag: go1.15beta1~679 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=48a90d639d578d2b33fdc1903f03e028b4d40fa9;p=gostls13.git cmd: merge branch 'dev.link' into master 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 --- 48a90d639d578d2b33fdc1903f03e028b4d40fa9