]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: remove special dynlinkingGo case in pclntab pass
authorCherry Zhang <cherryyz@google.com>
Fri, 26 Jun 2020 02:38:14 +0000 (22:38 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 26 Jun 2020 14:26:05 +0000 (14:26 +0000)
Now that we removed the "weird thing" about runtime.etext symbol,
we can remove this special case.

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

index 5bbfbb02c12064618eaa0cd5fcc9048e181b4e7e..b23313d9e5c98571399b51e9eaff1c5e0002783a 100644 (file)
@@ -324,16 +324,12 @@ func (ctxt *Link) pclntab() loader.Bitmap {
        }
 
        setAddr := (*loader.SymbolBuilder).SetAddrPlus
-       if ctxt.IsExe() && ctxt.IsInternal() && !ctxt.DynlinkingGo() {
+       if ctxt.IsExe() && ctxt.IsInternal() {
                // Internal linking static executable. At this point the function
                // addresses are known, so we can just use them instead of emitting
                // relocations.
                // For other cases we are generating a relocatable binary so we
                // still need to emit relocations.
-               //
-               // Also not do this optimization when using plugins (DynlinkingGo),
-               // as on darwin it does weird things with runtime.etext symbol.
-               // TODO: remove the weird thing and remove this condition.
                setAddr = func(s *loader.SymbolBuilder, arch *sys.Arch, off int64, tgt loader.Sym, add int64) int64 {
                        if v := ldr.SymValue(tgt); v != 0 {
                                return s.SetUint(arch, off, uint64(v+add))