cmd/link: generate dynamic relocs for internal PIE

This reuses the machinery built for dynamic loading of shared
libraries. The significant difference with PIE is we generate
dynamic relocations for known internal symbols, not just
dynamic external symbols.

Part of adding PIE internal linking on linux/amd64.

Change-Id: I4afa24070bfb61f94f8d3648f2433d5343bac3fe
Reviewed-on: https://go-review.googlesource.com/28539
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
David Crawshaw 2016-09-05 23:49:53 -04:00
parent 276803d611
commit 81ee93679d
9 changed files with 117 additions and 106 deletions

View file

@ -95,7 +95,7 @@ type Arch struct {
Openbsddynld string
Dragonflydynld string
Solarisdynld string
Adddynrel func(*Link, *Symbol, *Reloc)
Adddynrel func(*Link, *Symbol, *Reloc) bool
Archinit func(*Link)
Archreloc func(*Link, *Reloc, *Symbol, *int64) int
Archrelocvariant func(*Link, *Reloc, *Symbol, int64) int64