cmd/internal/obj/x86, cmd/internal/ld, cmd/6l: 6g/asm -dynlink accesses global data via a GOT

Change-Id: I49862e177045369d6c94d6a58afbdace4f13cc96
Reviewed-on: https://go-review.googlesource.com/8237
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2015-03-30 00:49:25 +00:00 committed by Ian Lance Taylor
parent 969f10140c
commit 84207a2500
13 changed files with 292 additions and 7 deletions

View file

@ -476,8 +476,8 @@ func relocsym(s *LSym) {
}
// r->sym can be null when CALL $(constant) is transformed from absolute PC to relative PC call.
case R_CALL, R_PCREL:
if Linkmode == LinkExternal && r.Sym != nil && r.Sym.Type != SCONST && r.Sym.Sect != Ctxt.Cursym.Sect {
case R_CALL, R_GOTPCREL, R_PCREL:
if Linkmode == LinkExternal && r.Sym != nil && r.Sym.Type != SCONST && (r.Sym.Sect != Ctxt.Cursym.Sect || r.Type == R_GOTPCREL) {
r.Done = 0
// set up addend for eventual relocation via outer symbol.