From: Cherry Zhang Date: Fri, 26 Jun 2020 02:38:14 +0000 (-0400) Subject: [dev.link] cmd/link: remove special dynlinkingGo case in pclntab pass X-Git-Tag: go1.16beta1~1378^2~71 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7dbd40babff7998a16b8e71fb583a082be4bb547;p=gostls13.git [dev.link] cmd/link: remove special dynlinkingGo case in pclntab pass 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 TryBot-Result: Gobot Gobot Reviewed-by: Jeremy Faller --- diff --git a/src/cmd/link/internal/ld/pcln.go b/src/cmd/link/internal/ld/pcln.go index 5bbfbb02c1..b23313d9e5 100644 --- a/src/cmd/link/internal/ld/pcln.go +++ b/src/cmd/link/internal/ld/pcln.go @@ -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))