mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/link: create symbol updated lazily in amd64 adddynrel
Tweak the code in the amd64 version of adddynrel to avoid creating a symbol updated for the symbol being processed until it's clear we need to alter its relocations. This should help performance for the PIE+internal linking scenario. Reviewed-on: https://go-review.googlesource.com/c/go/+/229866 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Change-Id: Id25adfd81a5bbd2dde0f80a83b976397ba6abfb5 Reviewed-on: https://go-review.googlesource.com/c/go/+/230026 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
027055240f
commit
42cca1a7fe
2 changed files with 11 additions and 6 deletions
|
|
@ -684,10 +684,6 @@ func dynrelocsym2(ctxt *Link, s loader.Sym) {
|
|||
relocs := ldr.Relocs(s)
|
||||
for ri := 0; ri < relocs.Count(); ri++ {
|
||||
r := relocs.At2(ri)
|
||||
// FIXME: the call to Adddynrel2 below is going to wind up
|
||||
// eagerly promoting the symbol to external, which is not great--
|
||||
// it would improve things for internal/PIE if we could
|
||||
// create the symbol updater lazily.
|
||||
if ctxt.BuildMode == BuildModePIE && ctxt.LinkMode == LinkInternal {
|
||||
// It's expected that some relocations will be done
|
||||
// later by relocsym (R_TLS_LE, R_ADDROFF), so
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue