diff options
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index 0221024d56..79acd73387 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -134,7 +134,9 @@ func (d *deadcodePass) flood() { methods = methods[:0] for i := 0; i < relocs.Count(); i++ { r := relocs.At(i) - if r.Weak() { + // When build with "-linkshared", we can't tell if the interface + // method in itab will be used or not. Ignore the weak attribute. + if r.Weak() && !(d.ctxt.linkShared && d.ldr.IsItab(symIdx)) { continue } t := r.Type() |
