Browse files

[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
Run-TryBot: Russ Cox <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Ian Lance Taylor <>
Reviewed-by: Adam Langley <>
  • Loading branch information...
rsc committed Aug 23, 2017
1 parent 08c5456 commit 4aff713ddb28ff242588616ccc60c2aa9f654a5c
Showing with 5 additions and 0 deletions.
  1. +5 −0 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
if s.Type == obj.SRODATA {
if s.Type != obj.SDWARFINFO {

0 comments on commit 4aff713

Please sign in to comment.