]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: create Target in order to make relocsym threadsafe
authorJeremy Faller <jeremy@golang.org>
Tue, 25 Feb 2020 01:59:02 +0000 (20:59 -0500)
committerJeremy Faller <jeremy@golang.org>
Fri, 28 Feb 2020 21:04:36 +0000 (21:04 +0000)
commite9056a6a7388a0124209fe2a69a083b8a34d416c
tree536c4a9c309153b694874c20003e1d652ff4288d
parent99eb14a7f4a58843cb23452d069e651b66db337f
[dev.link] cmd/link: create Target in order to make relocsym threadsafe

In its current form, relocsym requires the Link context -- largely in a
readonly state. Rather than passing around such heavy-weight object to
the function, this CL separates out the link target. From here, the
number of touchpoints (and thread unsafe portions) of relocing symbols
can be mentally reasoned about.

(NB: My personal intent is to make this more universal -- passing only
the necessary variables/state to reloc functions. This is a taste to see
if we like this form.)

Change-Id: Id9177d03267fedf0bb572a9d61bc07b64309c3b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/220837
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/dwarf2.go
src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/sym.go
src/cmd/link/internal/ld/target.go [new file with mode: 0644]