mirror of
https://github.com/golang/go
synced 2024-11-22 08:34:40 -07:00
cmd/[568]l: do not generate PT_TLS on openbsd
The OpenBSD ld.so(1) does not currently support PT_TLS and refuses to load ELF binaries that contain PT_TLS sections. Do not emit PT_TLS sections - we will handle this appropriately in runtime/cgo instead. R=golang-dev, minux.ma, iant CC=golang-dev https://golang.org/cl/6846064
This commit is contained in:
parent
d0283ab62a
commit
e6ca125f14
@ -1015,7 +1015,10 @@ asmb(void)
|
||||
phsh(ph, sh);
|
||||
|
||||
// .tbss (optional) and TLS phdr
|
||||
if(tlsoffset != 0) {
|
||||
// Do not emit PT_TLS for OpenBSD since ld.so(1) does
|
||||
// not currently support it. This is handled
|
||||
// appropriately in runtime/cgo.
|
||||
if(tlsoffset != 0 && HEADTYPE != Hopenbsd) {
|
||||
ph = newElfPhdr();
|
||||
ph->type = PT_TLS;
|
||||
ph->flags = PF_R;
|
||||
|
@ -1116,7 +1116,10 @@ asmb(void)
|
||||
/*
|
||||
* Thread-local storage segment (really just size).
|
||||
*/
|
||||
if(tlsoffset != 0) {
|
||||
// Do not emit PT_TLS for OpenBSD since ld.so(1) does
|
||||
// not currently support it. This is handled
|
||||
// appropriately in runtime/cgo.
|
||||
if(tlsoffset != 0 && HEADTYPE != Hopenbsd) {
|
||||
ph = newElfPhdr();
|
||||
ph->type = PT_TLS;
|
||||
ph->flags = PF_R;
|
||||
|
@ -1179,7 +1179,10 @@ asmb(void)
|
||||
/*
|
||||
* Thread-local storage segment (really just size).
|
||||
*/
|
||||
if(tlsoffset != 0) {
|
||||
// Do not emit PT_TLS for OpenBSD since ld.so(1) does
|
||||
// not currently support it. This is handled
|
||||
// appropriately in runtime/cgo.
|
||||
if(tlsoffset != 0 && HEADTYPE != Hopenbsd) {
|
||||
ph = newElfPhdr();
|
||||
ph->type = PT_TLS;
|
||||
ph->flags = PF_R;
|
||||
|
Loading…
Reference in New Issue
Block a user