mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link/internal/ld: skip TLS section on Android
We don't use the TLS section on android, and dropping it avoids complaints about underalignment from the Android Q linker. Updates #29674 Change-Id: I91dabf2a58e6eb1783872639a6a144858db09cef Reviewed-on: https://go-review.googlesource.com/c/go/+/169618 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f24e1099cb
commit
90a3ce02dc
1 changed files with 15 additions and 10 deletions
|
|
@ -453,6 +453,10 @@ func (ctxt *Link) loadlib() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The Android Q linker started to complain about underalignment of the our TLS
|
||||||
|
// section. We don't actually use the section on android, so dont't
|
||||||
|
// generate it.
|
||||||
|
if objabi.GOOS != "android" {
|
||||||
tlsg := ctxt.Syms.Lookup("runtime.tlsg", 0)
|
tlsg := ctxt.Syms.Lookup("runtime.tlsg", 0)
|
||||||
|
|
||||||
// runtime.tlsg is used for external linking on platforms that do not define
|
// runtime.tlsg is used for external linking on platforms that do not define
|
||||||
|
|
@ -465,6 +469,7 @@ func (ctxt *Link) loadlib() {
|
||||||
}
|
}
|
||||||
tlsg.Attr |= sym.AttrReachable
|
tlsg.Attr |= sym.AttrReachable
|
||||||
ctxt.Tlsg = tlsg
|
ctxt.Tlsg = tlsg
|
||||||
|
}
|
||||||
|
|
||||||
var moduledata *sym.Symbol
|
var moduledata *sym.Symbol
|
||||||
if ctxt.BuildMode == BuildModePlugin {
|
if ctxt.BuildMode == BuildModePlugin {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue