Skip to content

Commit ccc76db

Browse files
mwhudsondavecheney
authored andcommitted
cmd/internal/ld: fix R_TLS handling now Xsym is not read from object 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 <[email protected]> Run-TryBot: Dave Cheney <[email protected]>
1 parent 1b4025f commit ccc76db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: src/cmd/internal/ld/data.go

+8
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,14 @@ func relocsym(s *LSym) {
372372
}
373373

374374
case obj.R_TLS:
375+
if Linkmode == LinkExternal && Iself && HEADTYPE != obj.Hopenbsd {
376+
r.Done = 0
377+
r.Sym = Ctxt.Tlsg
378+
r.Xsym = Ctxt.Tlsg
379+
r.Xadd = r.Add
380+
o = r.Add
381+
break
382+
}
375383
if Linkmode == LinkInternal && Iself && Thearch.Thechar == '5' {
376384
// On ELF ARM, the thread pointer is 8 bytes before
377385
// the start of the thread-local data block, so add 8

0 commit comments

Comments
 (0)