aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/ld/lib.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2020-04-25 22:08:50 -0400
committerCherry Zhang <cherryyz@google.com>2020-04-28 22:44:41 +0000
commit76c6cce1160996e730d87e620ddb674b1d54f96e (patch)
tree94e1c73c982ea0eba82ca76f2640e489a5cade4c /src/cmd/link/internal/ld/lib.go
parent1adae7fe76d27cb9623cb269bb3ede2372f5eea6 (diff)
downloadgo-76c6cce1160996e730d87e620ddb674b1d54f96e.tar.gz
go-76c6cce1160996e730d87e620ddb674b1d54f96e.zip
[dev.link] cmd/link: convert reloc pass to using the loader when internal linking
Only enabled for AMD64 when internal linking for now. Change-Id: I2aa9ee47c0f7413ea7bbcdd31b8317c14220bba3 Reviewed-on: https://go-review.googlesource.com/c/go/+/230302 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/lib.go')
-rw-r--r--src/cmd/link/internal/ld/lib.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index e1f89858b6..618faf2233 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -282,7 +282,7 @@ type Arch struct {
// This is possible when a TLS IE relocation refers to a local
// symbol in an executable, which is typical when internally
// linking PIE binaries.
- TLSIEtoLE func(s *sym.Symbol, off, size int)
+ TLSIEtoLE func(P []byte, off, size int)
// optional override for assignAddress
AssignAddress func(ldr *loader.Loader, sect *sym.Section, n int, s loader.Sym, va uint64, isTramp bool) (*sym.Section, int, uint64)
@@ -2824,10 +2824,9 @@ func addToTextp(ctxt *Link) {
ctxt.Textp = textp
}
-func (ctxt *Link) loadlibfull(symGroupType []sym.SymKind) {
-
+func (ctxt *Link) loadlibfull(symGroupType []sym.SymKind, needReloc bool) {
// Load full symbol contents, resolve indexed references.
- ctxt.loader.LoadFull(ctxt.Arch, ctxt.Syms)
+ ctxt.loader.LoadFull(ctxt.Arch, ctxt.Syms, needReloc)
// Convert ctxt.Moduledata2 to ctxt.Moduledata, etc
if ctxt.Moduledata2 != 0 {