fix unused variable warnings
[musl] / src / env / __stack_chk_fail.c
1 #include <string.h>
2 #include <inttypes.h>
3 #include <elf.h>
4 #include "pthread_impl.h"
5 #include "atomic.h"
6
7 uintptr_t __stack_chk_guard;
8
9 void __init_ssp(void *entropy)
10 {
11         pthread_t self = __pthread_self_init();
12         uintptr_t canary;
13         if (entropy) memcpy(&canary, entropy, sizeof canary);
14         else canary = (uintptr_t)&canary * 1103515245;
15         a_cas_l(&__stack_chk_guard, 0, canary);
16         self->canary = __stack_chk_guard;
17 }
18
19 void __stack_chk_fail(void)
20 {
21         a_crash();
22 }