]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: remove symbol movement workaround in dodata
authorCherry Zhang <cherryyz@google.com>
Sat, 25 Apr 2020 18:25:18 +0000 (14:25 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 27 Apr 2020 13:56:20 +0000 (13:56 +0000)
It is supposed to work around symbol movement in machosymorder.
But machosymorder doesn't actually move symbols around.

Change-Id: Ibdc2ad41aaa8cd49e865088aa1ddb7ab399736cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/230279
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/data.go

index 4b3bc2ce02aee8cb8869e5357b132701141bec2d..5ab7661d604e58241fdf95c74fa2c2211253839a 100644 (file)
@@ -1893,18 +1893,6 @@ func (state *dodataState) allocateDwarfSections2(ctxt *Link) {
 }
 
 func (state *dodataState) dodataSect2(ctxt *Link, symn sym.SymKind, syms []loader.Sym) (result []loader.Sym, maxAlign int32) {
-       if ctxt.HeadType == objabi.Hdarwin {
-               // Some symbols may no longer belong in syms
-               // due to movement in machosymorder.
-               newSyms := make([]loader.Sym, 0, len(syms))
-               for _, s := range syms {
-                       if state.symType(s) == symn {
-                               newSyms = append(newSyms, s)
-                       }
-               }
-               syms = newSyms
-       }
-
        var head, tail loader.Sym
        ldr := ctxt.loader
        for _, s := range syms {