mirror of
https://github.com/golang/go
synced 2024-11-26 00:57:56 -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);
|
phsh(ph, sh);
|
||||||
|
|
||||||
// .tbss (optional) and TLS phdr
|
// .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 = newElfPhdr();
|
||||||
ph->type = PT_TLS;
|
ph->type = PT_TLS;
|
||||||
ph->flags = PF_R;
|
ph->flags = PF_R;
|
||||||
|
@ -1116,7 +1116,10 @@ asmb(void)
|
|||||||
/*
|
/*
|
||||||
* Thread-local storage segment (really just size).
|
* 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 = newElfPhdr();
|
||||||
ph->type = PT_TLS;
|
ph->type = PT_TLS;
|
||||||
ph->flags = PF_R;
|
ph->flags = PF_R;
|
||||||
|
@ -1179,7 +1179,10 @@ asmb(void)
|
|||||||
/*
|
/*
|
||||||
* Thread-local storage segment (really just size).
|
* 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 = newElfPhdr();
|
||||||
ph->type = PT_TLS;
|
ph->type = PT_TLS;
|
||||||
ph->flags = PF_R;
|
ph->flags = PF_R;
|
||||||
|
Loading…
Reference in New Issue
Block a user