diff options
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/compile/internal/gc/reflect.go | 1 | ||||
| -rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 19 | ||||
| -rw-r--r-- | src/cmd/link/internal/ld/decodesym.go | 4 |
3 files changed, 8 insertions, 16 deletions
diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 8dc1e6cd0b..dda876d65f 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -505,7 +505,6 @@ func dextratypeData(s *Sym, ot int, t *Type) int { ot = dgopkgpath(s, ot, a.pkg) ot = dmethodptr(s, ot, dtypesym(a.mtype)) - ot = dmethodptr(s, ot, dtypesym(a.type_)) ot = dmethodptr(s, ot, a.isym) ot = dmethodptr(s, ot, a.tsym) } diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index 9367375102..9ed9c56f99 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -95,7 +95,7 @@ func deadcode(ctxt *Link) { // and setting those fields to nil. Doing so // would reduce the binary size of typical // programs like cmd/go by ~2%. - d.markMethodType(m) + d.mark(m.mtyp(), m.src) rem = append(rem, m) } else { rem = append(rem, m) @@ -171,18 +171,17 @@ var markextra = []string{ } // methodref holds the relocations from a receiver type symbol to its -// method. There are four relocations, one for each of the fields in -// the reflect.method struct: mtyp, typ, ifn, and tfn. +// method. There are three relocations, one for each of the fields in +// the reflect.method struct: mtyp, ifn, and tfn. type methodref struct { m methodsig src *LSym // receiver type symbol - r [4]*Reloc // R_METHOD relocations to fields of runtime.method + r [3]*Reloc // R_METHOD relocations to fields of runtime.method } func (m methodref) mtyp() *LSym { return m.r[0].Sym } -func (m methodref) typ() *LSym { return m.r[1].Sym } -func (m methodref) ifn() *LSym { return m.r[2].Sym } -func (m methodref) tfn() *LSym { return m.r[3].Sym } +func (m methodref) ifn() *LSym { return m.r[1].Sym } +func (m methodref) tfn() *LSym { return m.r[2].Sym } func (m methodref) isExported() bool { for _, r := range m.m { @@ -233,12 +232,6 @@ func (d *deadcodepass) markMethod(m methodref) { } } -// markMethodType marks just a method's types as reachable. -func (d *deadcodepass) markMethodType(m methodref) { - d.mark(m.mtyp(), m.src) - d.mark(m.typ(), m.src) -} - // init marks all initial symbols as reachable. // In a typical binary, this is INITENTRY. func (d *deadcodepass) init() { diff --git a/src/cmd/link/internal/ld/decodesym.go b/src/cmd/link/internal/ld/decodesym.go index 98590d3677..00e1a79a83 100644 --- a/src/cmd/link/internal/ld/decodesym.go +++ b/src/cmd/link/internal/ld/decodesym.go @@ -350,7 +350,7 @@ func decodetype_methods(s *LSym) []methodsig { if r.Sym != s { panic(fmt.Sprintf("method slice pointer in %q leads to a different symbol", s.Name)) } - off = int(r.Add) // array of reflect.method values - sizeofMethod := 6 * Thearch.Ptrsize + off = int(r.Add) // array of reflect.method values + sizeofMethod := 5 * Thearch.Ptrsize // sizeof reflect.method in program return decode_methodsig(s, off, sizeofMethod, numMethods) } |
