Set the glibc thread's pointer_guard (XCC)
[akaros.git] / tools / compilers / gcc-glibc / glibc-2.19-akaros / sysdeps / akaros / tls.c
index 831b217..d50acab 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <sys/tls.h>
 #include <parlib/vcore.h>
 #include <ldsodefs.h>
@@ -27,6 +28,8 @@ void *allocate_tls(void)
        tcbhead_t *head = (tcbhead_t*)tcb;
        head->tcb = tcb;
        head->self = tcb;
+       head->pointer_guard = THREAD_SELF->header.pointer_guard;
+       head->stack_guard = THREAD_SELF->header.stack_guard;
 #endif
        return tcb;
 }