cpu: k60: remove ssp code
This commit is contained in:
parent
7b1a1e9d81
commit
277189ef05
|
@ -18,6 +18,5 @@ export COMMON_STARTUP = $(KINETIS_COMMON)
|
|||
|
||||
# add the CPU specific system calls implementations for the linker
|
||||
export UNDEF += $(BINDIR)/cpu/vectors.o
|
||||
export UNDEF += $(BINDIR)/cpu/ssp.o
|
||||
|
||||
include $(RIOTMAKE)/arch/cortexm.inc.mk
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Eistec AB
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser General
|
||||
* Public License v2.1. See the file LICENSE in the top level directory for more
|
||||
* details.
|
||||
*/
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
/**
|
||||
* @ingroup cpu_k60
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Implementation of stack smashing protection helper functions used by GCC's -fstack-protector
|
||||
*
|
||||
* @author Joakim Nohlgård <joakim.nohlgard@eistec.se>
|
||||
*/
|
||||
|
||||
void *__stack_chk_guard = 0;
|
||||
|
||||
void __stack_chk_guard_setup(void)
|
||||
{
|
||||
unsigned char *p;
|
||||
p = (unsigned char *) &__stack_chk_guard;
|
||||
|
||||
/* TODO: This should be replaced by a random number to use as a canary value */
|
||||
p[0] = 0;
|
||||
p[1] = 0;
|
||||
p[2] = '\n';
|
||||
p[3] = 255;
|
||||
}
|
||||
|
||||
/*
|
||||
* Arrange so that the __stack_chk_guard_setup function is called during
|
||||
* early init.
|
||||
*/
|
||||
void __attribute__((section(".preinit_array")))(*preinit__stack_chk_guard_setup[])(void) = {__stack_chk_guard_setup};
|
||||
|
||||
/**
|
||||
* @brief Handler for stack smashing protection failure.
|
||||
*
|
||||
* This is called if the SSP checks fail, which means that the stack has been
|
||||
* corrupted.
|
||||
*/
|
||||
void __attribute__((noreturn)) __stack_chk_fail(void)
|
||||
{
|
||||
__asm__ volatile ("bkpt #1");
|
||||
|
||||
while (1);
|
||||
}
|
||||
/** @} */
|
Loading…
Reference in New Issue