Skip to content

Commit

Permalink
cmd/internal/ld: fix R_TLS handling now Xsym is not read from object …
Browse files Browse the repository at this point in the history
…file

I think this should fix the arm build. A proper fix involves making the handling
of tlsg less fragile, I'll try that tomorrow.

Update #10557

Change-Id: I9b1b666737fb40aebb6f284748509afa8483cce5
Reviewed-on: https://go-review.googlesource.com/9272
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Dave Cheney <dave@cheney.net>
  • Loading branch information
mwhudson authored and davecheney committed Apr 24, 2015
1 parent 1b4025f commit ccc76db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cmd/internal/ld/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ func relocsym(s *LSym) {
}

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' {
// On ELF ARM, the thread pointer is 8 bytes before
// the start of the thread-local data block, so add 8
Expand Down

0 comments on commit ccc76db

Please sign in to comment.