mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/link: remove some dependence on *Link
In an effort to make relocation application thread-safe remove another dependence on context. Change-Id: Ic53ea122cce72117fcebe56e386b710755f6eb68 Reviewed-on: https://go-review.googlesource.com/c/go/+/220838 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
e9056a6a73
commit
d8b03c4678
5 changed files with 68 additions and 53 deletions
|
|
@ -100,7 +100,7 @@ func trampoline(ctxt *Link, s *sym.Symbol) {
|
|||
if Symaddr(r.Sym) == 0 && (r.Sym.Type != sym.SDYNIMPORT && r.Sym.Type != sym.SUNDEFEXT) {
|
||||
if r.Sym.File != s.File {
|
||||
if !isRuntimeDepPkg(s.File) || !isRuntimeDepPkg(r.Sym.File) {
|
||||
ctxt.ErrorUnresolved(s, r)
|
||||
ctxt.errorUnresolved(ctxt.Syms.ROLookup, s, r)
|
||||
}
|
||||
// runtime and its dependent packages may call to each other.
|
||||
// they are fine, as they will be laid down together.
|
||||
|
|
@ -167,7 +167,7 @@ func relocsym(ctxt *Link, target *Target, s *sym.Symbol) {
|
|||
continue
|
||||
}
|
||||
} else {
|
||||
ctxt.ErrorUnresolved(s, r)
|
||||
ctxt.errorUnresolved(ctxt.Syms.ROLookup, s, r)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
@ -335,7 +335,7 @@ func relocsym(ctxt *Link, target *Target, s *sym.Symbol) {
|
|||
// symbol which isn't in .data. However, as .text has the
|
||||
// same address once loaded, this is possible.
|
||||
if s.Sect.Seg == &Segdata {
|
||||
Xcoffadddynrel(ctxt, s, r)
|
||||
Xcoffadddynrel(target, s, r)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue