diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index 83d66eab42..cfdf2af849 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -19,7 +19,6 @@ import ( "cmd/compile/internal/inline" "cmd/compile/internal/ir" "cmd/compile/internal/objw" - "cmd/compile/internal/staticdata" "cmd/compile/internal/typebits" "cmd/compile/internal/typecheck" "cmd/compile/internal/types" @@ -2057,8 +2056,15 @@ func MarkUsedIfaceMethod(n *ir.CallExpr) { // of the method for matching. r := obj.Addrel(ir.CurFunc.LSym) // We use a separate symbol just to tell the linker the method name. - // (The symbol itself is not needed in the final binary.) - r.Sym = staticdata.StringSym(src.NoXPos, dot.Sel.Name) + // (The symbol itself is not needed in the final binary. Do not use + // staticdata.StringSym, which creates a content addessable symbol, + // which may have trailing zero bytes. This symbol doesn't need to + // be deduplicated anyway.) + name := dot.Sel.Name + var nameSym obj.LSym + nameSym.WriteString(base.Ctxt, 0, len(name), name) + objw.Global(&nameSym, int32(len(name)), obj.RODATA) + r.Sym = &nameSym r.Type = objabi.R_USEGENERICIFACEMETHOD return }