summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-22 21:14:43 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-22 21:14:43 +0000
commitc459ce0fde82ae429a4e666ef610ee7cf993026d (patch)
tree082a0c27401b1c808011f524ac48284b258eb287 /libgo
parent47d6df078c0a608f7b018a9026de05b6079e8189 (diff)
downloadgcc-c459ce0fde82ae429a4e666ef610ee7cf993026d.tar.gz
runtime: Mark runtime_goexit function as noinline.
If the compiler inlines this function into kickoff, it may reuse the TLS block address to load g. However, this is not necessarily correct, as the call to g->entry in kickoff may cause the TLS address to change. If the wrong value is loaded for g->status in runtime_goexit, it may cause a runtime panic. By marking the function as noinline we prevent the compiler from reusing the TLS address. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215484 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/proc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 4195aff76a7..87cd3edac00 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -1894,6 +1894,7 @@ runtime_gosched0(G *gp)
// Need to mark it as nosplit, because it runs with sp > stackbase (as runtime_lessstack).
// Since it does not return it does not matter. But if it is preempted
// at the split stack check, GC will complain about inconsistent sp.
+void runtime_goexit(void) __attribute__ ((noinline));
void
runtime_goexit(void)
{