]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: stop overwriting symbol types in loadlibfull
authorCherry Zhang <cherryyz@google.com>
Sat, 25 Apr 2020 21:27:34 +0000 (17:27 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 27 Apr 2020 21:18:16 +0000 (21:18 +0000)
symGroupType was needed for dodata. Now that we have converted
dodata to using the loader, stop overwriting it.

Change-Id: Ie94109c0b35dd2f71a19ebb38f8cf20b6a37c624
Reviewed-on: https://go-review.googlesource.com/c/go/+/229994
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/main.go

index a43aff22ee8c36c5475a72679347b4cb8d759b98..96e3e8870c11f2148c9f0237022ec2797355d474 100644 (file)
@@ -2824,7 +2824,7 @@ func addToTextp(ctxt *Link) {
        ctxt.Textp = textp
 }
 
-func (ctxt *Link) loadlibfull(symGroupType []sym.SymKind) {
+func (ctxt *Link) loadlibfull() {
 
        // Load full symbol contents, resolve indexed references.
        ctxt.loader.LoadFull(ctxt.Arch, ctxt.Syms)
@@ -2890,20 +2890,6 @@ func (ctxt *Link) loadlibfull(symGroupType []sym.SymKind) {
                }
        }
 
-       // For now, overwrite symbol type with its "group" type, as dodata
-       // expected. Once we converted dodata, this will probably not be
-       // needed.
-       for i, t := range symGroupType {
-               if t != sym.Sxxx {
-                       s := ctxt.loader.Syms[i]
-                       if s == nil {
-                               panic(fmt.Sprintf("nil sym for symGroupType t=%s entry %d", t.String(), i))
-                       }
-                       s.Type = t
-               }
-       }
-       symGroupType = nil
-
        if ctxt.Debugvlog > 1 {
                // loadlibfull is likely a good place to dump.
                // Only dump under -v=2 and above.
index bbd6f1c66369c9728f5aae4c64cec7fe8492365d..6bcf27421556faf773e48780f0d3fdc2b9db3d87 100644 (file)
@@ -301,7 +301,7 @@ func Main(arch *sys.Arch, theArch Arch) {
        bench.Start("dodata")
        ctxt.dodata2(symGroupType)
        bench.Start("loadlibfull")
-       ctxt.loadlibfull(symGroupType) // XXX do it here for now
+       ctxt.loadlibfull() // XXX do it here for now
        bench.Start("address")
        order := ctxt.address()
        bench.Start("dwarfcompress")