mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/8l, cmd/internal/ld, cmd/internal/obj/x86: stop incorrectly using the term "inital exec"
The long comment block in obj6.go:progedit talked about the two code sequences for accessing g as "local exec" and "initial exec", but really they are both forms of local exec. This stuff is confusing enough without using the wrong words for things, so rewrite it to talk about 2-instruction and 1-instruction sequences. Unfortunately the confusion has made it into code, with the R_TLS_IE relocation now doing double duty as meaning actual initial exec when externally linking and boring old local exec when linking internally (half of this is my fault). So this stops using R_TLS_IE in the local exec case. There is a chance this might break plan9 or windows, but I don't think so. Next step is working out what the heck is going on on ARM... Change-Id: I09da4388210cf49dbc99fd25f5172bbe517cee57 Reviewed-on: https://go-review.googlesource.com/9273 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
ada8cdb9f6
commit
264858c46e
5 changed files with 50 additions and 31 deletions
|
|
@ -412,7 +412,13 @@ func relocsym(s *LSym) {
|
|||
break
|
||||
}
|
||||
|
||||
o = int64(Ctxt.Tlsoffset) + r.Add
|
||||
if Iself || Ctxt.Headtype == obj.Hplan9 {
|
||||
o = int64(Ctxt.Tlsoffset) + r.Add
|
||||
} else if Ctxt.Headtype == obj.Hwindows {
|
||||
o = r.Add
|
||||
} else {
|
||||
log.Fatalf("unexpected R_TLS_LE relocation for %s", Headstr(Ctxt.Headtype))
|
||||
}
|
||||
|
||||
case obj.R_TLS_IE:
|
||||
if Linkmode == LinkExternal && Iself && HEADTYPE != obj.Hopenbsd {
|
||||
|
|
@ -426,14 +432,7 @@ func relocsym(s *LSym) {
|
|||
}
|
||||
break
|
||||
}
|
||||
|
||||
if Iself || Ctxt.Headtype == obj.Hplan9 {
|
||||
o = int64(Ctxt.Tlsoffset) + r.Add
|
||||
} else if Ctxt.Headtype == obj.Hwindows {
|
||||
o = r.Add
|
||||
} else {
|
||||
log.Fatalf("unexpected R_TLS_IE relocation for %s", Headstr(Ctxt.Headtype))
|
||||
}
|
||||
log.Fatalf("cannot handle R_TLS_IE when linking internally")
|
||||
|
||||
case obj.R_ADDR:
|
||||
if Linkmode == LinkExternal && r.Sym.Type != obj.SCONST {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue