From 7dbd40babff7998a16b8e71fb583a082be4bb547 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Thu, 25 Jun 2020 22:38:14 -0400 Subject: [PATCH] [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 --- src/cmd/link/internal/ld/pcln.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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)) -- 2.48.1