Commit 7bf959c6 authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle Committed by Dave Cheney

cmd/internal/obj: remove Link.Tlsoffset

Nothing uses it any more.

Change-Id: I42ee7222b06b1a79b8b44894f3071752f9166d7a
Reviewed-on: https://go-review.googlesource.com/14193
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarDave Cheney <dave@cheney.net>
parent 5c78589b
......@@ -502,7 +502,6 @@ type Link struct {
Autosize int32
Armsize int32
Pc int64
Tlsoffset int
Diag func(string, ...interface{})
Mode int
Cursym *LSym
......
......@@ -105,66 +105,6 @@ func Linknew(arch *LinkArch) *Link {
log.Fatalf("unknown goos %s", Getgoos())
}
// Record thread-local storage offset.
// TODO(rsc): Move tlsoffset back into the linker.
switch ctxt.Headtype {
default:
log.Fatalf("unknown thread-local storage offset for %s", Headstr(ctxt.Headtype))
case Hplan9, Hwindows:
break
/*
* ELF uses TLS offset negative from FS.
* Translate 0(FS) and 8(FS) into -16(FS) and -8(FS).
* Known to low-level assembly in package runtime and runtime/cgo.
*/
case Hlinux,
Hfreebsd,
Hnetbsd,
Hopenbsd,
Hdragonfly,
Hsolaris:
ctxt.Tlsoffset = -1 * ctxt.Arch.Ptrsize
case Hnacl:
switch ctxt.Arch.Thechar {
default:
log.Fatalf("unknown thread-local storage offset for nacl/%s", ctxt.Arch.Name)
case '5':
ctxt.Tlsoffset = 0
case '6':
ctxt.Tlsoffset = 0
case '8':
ctxt.Tlsoffset = -8
}
/*
* OS X system constants - offset from 0(GS) to our TLS.
* Explained in ../../runtime/cgo/gcc_darwin_*.c.
*/
case Hdarwin:
switch ctxt.Arch.Thechar {
default:
log.Fatalf("unknown thread-local storage offset for darwin/%s", ctxt.Arch.Name)
case '5':
ctxt.Tlsoffset = 0 // dummy value, not needed
case '6':
ctxt.Tlsoffset = 0x8a0
case '7':
ctxt.Tlsoffset = 0 // dummy value, not needed
case '8':
ctxt.Tlsoffset = 0x468
}
}
// On arm, record goarm.
if ctxt.Arch.Thechar == '5' {
p := Getgoarm()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment