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
|
|
@ -362,11 +362,6 @@ func relocsym(s *LSym) {
|
|||
Diag("unreachable sym in relocation: %s %s", s.Name, r.Sym.Name)
|
||||
}
|
||||
|
||||
// Android emulates runtime.tlsg as a regular variable.
|
||||
if r.Type == obj.R_TLS && goos == "android" {
|
||||
r.Type = obj.R_ADDR
|
||||
}
|
||||
|
||||
switch r.Type {
|
||||
default:
|
||||
switch siz {
|
||||
|
|
@ -385,26 +380,6 @@ func relocsym(s *LSym) {
|
|||
Diag("unknown reloc %d", r.Type)
|
||||
}
|
||||
|
||||
case obj.R_TLS:
|
||||
if Linkmode == LinkExternal && Iself && HEADTYPE != obj.Hopenbsd {
|
||||
r.Done = 0
|
||||
r.Sym = Ctxt.Tlsg
|
||||
r.Xsym = Ctxt.Tlsg
|
||||
r.Xadd = r.Add
|
||||
o = r.Add
|
||||
break
|
||||
}
|
||||
if Linkmode == LinkInternal && Iself && Thearch.Thechar == '5' {
|
||||
panic("should no longer get here")
|
||||
break
|
||||
}
|
||||
|
||||
r.Done = 0
|
||||
o = 0
|
||||
if Thearch.Thechar != '6' {
|
||||
o = r.Add
|
||||
}
|
||||
|
||||
case obj.R_TLS_LE:
|
||||
if Linkmode == LinkExternal && Iself && HEADTYPE != obj.Hopenbsd {
|
||||
r.Done = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue