]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: remove some unneeded code from writeBlock()
authorThan McIntosh <thanm@google.com>
Mon, 6 Jul 2020 13:38:17 +0000 (09:38 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 7 Jul 2020 13:07:46 +0000 (13:07 +0000)
The loader writeBlock() function has code that tries to skip the
initial portion of the input symbols list depending on the address of
the section being written-- this code is dead (skipping is never
triggered) due to similar skipping in the callers; remove this
preamble.

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

index e6ca9779911117cc41d28a35bcb92fe9353f23e1..d9f9ff70d3e0bdee35119c1943e91c381315ca42 100644 (file)
@@ -878,12 +878,6 @@ func writeBlocks(ctxt *Link, out *OutBuf, sem chan int, ldr *loader.Loader, syms
 }
 
 func writeBlock(ctxt *Link, out *OutBuf, ldr *loader.Loader, syms []loader.Sym, addr, size int64, pad []byte) {
-       for i, s := range syms {
-               if ldr.SymValue(s) >= addr && !ldr.AttrSubSymbol(s) {
-                       syms = syms[i:]
-                       break
-               }
-       }
 
        st := ctxt.makeRelocSymState()