__stack_chk_fail.c 481 B

12345678910111213141516171819202122232425262728
  1. #include <string.h>
  2. #include <stdint.h>
  3. #include "pthread_impl.h"
  4. uintptr_t __stack_chk_guard;
  5. void __init_ssp(void *entropy)
  6. {
  7. if (entropy) memcpy(&__stack_chk_guard, entropy, sizeof(uintptr_t));
  8. else __stack_chk_guard = (uintptr_t)&__stack_chk_guard * 1103515245;
  9. __pthread_self()->canary = __stack_chk_guard;
  10. }
  11. void __stack_chk_fail(void)
  12. {
  13. a_crash();
  14. }
  15. #ifdef SHARED
  16. __attribute__((__visibility__("hidden")))
  17. void __stack_chk_fail_local(void)
  18. {
  19. a_crash();
  20. }
  21. #endif