first attempt at enabling stack protector support

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.
This commit is contained in:
Rich Felker committed 2012-04-24 18:07:59 -04:00
1 parent 848d30a1e5
commit 60872cf9c9
3 files changed
+28

No files matched your search

+14
View File
@@ -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();
}