diff --git a/tlib/src/ssp.cpp b/tlib/src/ssp.cpp new file mode 100644 index 00000000..db1a8d63 --- /dev/null +++ b/tlib/src/ssp.cpp @@ -0,0 +1,23 @@ +//======================================================================= +// Copyright Baptiste Wicht 2013-2016. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +//======================================================================= + +#include +#include + +extern "C" { + +#define STACK_CHK_GUARD 0x595e9fbd94fda766 + +uintptr_t __stack_chk_guard = STACK_CHK_GUARD; + +__attribute__((noreturn)) void __stack_chk_fail(){ + printf("Stack smashing detected \n"); + //TODO printf("pid=%u\n", scheduler::get_pid()); + exit(1); +} + +}