]> Cypherpunks repositories - gostls13.git/commit
cmd/link: don't link sections not named .o
authorAlan Donovan <adonovan@google.com>
Wed, 31 Oct 2018 17:18:17 +0000 (13:18 -0400)
committerAlan Donovan <adonovan@google.com>
Fri, 2 Nov 2018 00:23:21 +0000 (00:23 +0000)
commit484fc06849fa54d168af1d513c37d1b22bf38e7c
treed34a9ac0fd3613799193a0900615d940bf888c8b
parent90df37769d6441ce550443fa7e0c008d38e53455
cmd/link: don't link sections not named .o

For many build systems, modular static analysis is most conveniently
implemented by saving analysis facts (which are analogous to export
data) in an additional section in the archive file, similar to
__PKGDEF. See golang.org/x/tools/go/analysis for an overview.

Because such sections are not object files, the linker must not
attempt to link them. This change causes the linker to skip special
sections whose name does not end with .o (and is short enough not to
be truncated).

Fixes #28429

Change-Id: I830852decf868cb017263308b114f72838032993
Reviewed-on: https://go-review.googlesource.com/c/146297
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/lib.go
src/cmd/link/link_test.go