reactos/lib/gcc_ssp/gcc_ssp.c
Hermès Bélusca-Maïto 9919d4fa10 Sync to trunk r65566.
svn path=/branches/condrv_restructure/; revision=65567
2014-12-05 21:20:35 +00:00

24 lines
693 B
C

#define FAST_FAIL_STACK_COOKIE_CHECK_FAILURE 2
/* Should be random :-/ */
void * __stack_chk_guard = (void*)0xf00df00d;
#if 0
void __stack_chk_guard_setup()
{
unsigned char * p;
p = (unsigned char *)&__stack_chk_guard; // *** Notice that this takes the address of __stack_chk_guard ***
/* If you have the ability to generate random numbers in your kernel then use them,
otherwise for 32-bit code: */
*p = 0x00000aff; // *** p is &__stack_chk_guard so *p writes to __stack_chk_guard rather than *__stack_chk_guard ***
}
#endif
void __stack_chk_fail()
{
/* Like __fastfail */
__asm__("int $0x29" : : "c"(FAST_FAIL_STACK_COOKIE_CHECK_FAILURE) : "memory");
}