mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj, cmd/link, runtime: lots of TLS cleanup
It's particularly nice to get rid of the android special cases in the linker. Change-Id: I516363af7ce8a6b2f196fe49cb8887ac787a6dad Reviewed-on: https://go-review.googlesource.com/14197 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
1ef9b5a5b9
commit
a5cb76243a
15 changed files with 27 additions and 132 deletions
|
|
@ -129,24 +129,6 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
|
|||
p.From.Offset = 0
|
||||
}
|
||||
}
|
||||
|
||||
if ctxt.Flag_shared != 0 {
|
||||
// Shared libraries use R_ARM_TLS_IE32 instead of
|
||||
// R_ARM_TLS_LE32, replacing the link time constant TLS offset in
|
||||
// runtime.tlsg with an address to a GOT entry containing the
|
||||
// offset. Rewrite $runtime.tlsg(SB) to runtime.tlsg(SB) to
|
||||
// compensate.
|
||||
if ctxt.Tlsg == nil {
|
||||
ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0)
|
||||
}
|
||||
|
||||
if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && p.From.Sym == ctxt.Tlsg {
|
||||
p.From.Type = obj.TYPE_MEM
|
||||
}
|
||||
if p.To.Type == obj.TYPE_ADDR && p.To.Name == obj.NAME_EXTERN && p.To.Sym == ctxt.Tlsg {
|
||||
p.To.Type = obj.TYPE_MEM
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prog.mark
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue