Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions os/board/bk7239n/src/components/bk_cli/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
#
############################################################################

-include $(TOPDIR)/Make.defs
-include $(TOPDIR)/.config


CSRCS += cli_main.c cli_misc.c cli_mem.c cli_os.c cli_timer.c

#CSRCS += cli_uart.c cli_gpio.c
Expand Down
14 changes: 0 additions & 14 deletions os/board/bk7239n/src/components/bk_init/components_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,6 @@ void UartDbgInit()
}
#endif

__attribute__((weak)) \
void *__stack_chk_guard = NULL;

// Intialize random stack guard, must after trng start.
void bk_stack_guard_setup(void)
{
BK_LOGI(TAG, "Intialize random stack guard.\r\n");
#if defined(CONFIG_TRNG_SUPPORT)
__stack_chk_guard = (void *)bk_rand();
#endif
}

__attribute__((weak)) \
void __stack_chk_fail (void)
{
Expand Down Expand Up @@ -356,8 +344,6 @@ int components_init(void)
//wdt_init();
#endif

bk_stack_guard_setup();

#if defined(CONFIG_TFM_S_TO_NS_DUMP_ENABLE)
extern void bk_security_to_nosecurity_dump_register_callback(void);
bk_security_to_nosecurity_dump_register_callback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,18 @@ static inline void boot_mem_check(void)
}
}

__attribute__((weak)) \
void *__stack_chk_guard = 0xDEADBEEF;


static void bk_stack_guard_setup(void)
{
BK_LOGI(TAG, "Intialize random stack guard.\r\n");
#if defined(CONFIG_TRNG_SUPPORT)
__stack_chk_guard = (void *)bk_rand();
#endif
}

/*----------------------------------------------------------------------------
Reset Handler called on controller reset
*----------------------------------------------------------------------------*/
Expand Down Expand Up @@ -500,6 +510,12 @@ __FLASH_BOOT_CODE void _start(void)
bk_trng_driver_init();
#endif

/* Initialize __stack_chk_guard before os_start() to avoid false positive
* when -fstack-protector is used.
*/

bk_stack_guard_setup();

#if defined(CONFIG_SWD_DEBUG_MODE)
set_jtag_mode();
#endif
Expand Down