mirror of https://git.musl-libc.org/git/musl
Browse Source
the code is written to pre-init the thread pointer in static linked programs that pull in __stack_chk_fail or dynamic-linked programs that lookup the symbol. no explicit canary is set; the canary will be whatever happens to be in the thread structure at the offset gcc hard-coded. this can be improved later.rs-1.0
3 changed files with 28 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||||
|
#include "pthread_impl.h" |
||||
|
#include "atomic.h" |
||||
|
|
||||
|
void __init_ssp(void) |
||||
|
{ |
||||
|
#ifndef __PIC__ |
||||
|
__pthread_self_init(); |
||||
|
#endif |
||||
|
} |
||||
|
|
||||
|
void __stack_chk_fail(void) |
||||
|
{ |
||||
|
a_crash(); |
||||
|
} |
||||
Loading…
Reference in new issue