aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-08-22 22:50:27 -0400
committerRuss Cox <rsc@golang.org>2017-08-26 00:52:37 +0000
commit4aff713ddb28ff242588616ccc60c2aa9f654a5c (patch)
treedf73de43ddd59493a2273608cca2e5b89cca2adb
parent08c54565dc238f9686f1a81171073cad8bf51647 (diff)
downloadgo-4aff713ddb28ff242588616ccc60c2aa9f654a5c.tar.gz
go-4aff713ddb28ff242588616ccc60c2aa9f654a5c.zip
[dev.boringcrypto.go1.8] cmd/link: work around DWARF symbol bug
The DWARF code is mishandling the case when the host object files define multiple (distinct) symbols with the same name. They are mapped to the same DWARF debug symbol, which then appears on the dwarfp list multiple times, which then breaks the code that processes the list. Detect duplicates and skip them, because that's trivial, instead of fixing the underlying problem. See #21566. Change-Id: Ib5a34c891d7c15f4c7bb6239d8f31a1ec767b8bc Reviewed-on: https://go-review.googlesource.com/57943 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/58070 Reviewed-by: Adam Langley <agl@golang.org>
-rw-r--r--src/cmd/link/internal/ld/data.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go
index aca8973a85..2e5db616cd 100644
--- a/src/cmd/link/internal/ld/data.go
+++ b/src/cmd/link/internal/ld/data.go
@@ -1836,6 +1836,11 @@ func (ctxt *Link) dodata() {
datsize = Rnd(datsize, int64(sect.Align))
sect.Vaddr = uint64(datsize)
for _, s := range dwarfp[i:] {
+ // Syms can (incorrectly) appear twice on the list. Ignore repeats.
+ // See golang.org/issue/21566.
+ if s.Type == obj.SRODATA {
+ continue
+ }
if s.Type != obj.SDWARFINFO {
break
}