From 2a964270479d36bf73c5d8c9b84c480d5c68b1e4 Mon Sep 17 00:00:00 2001 From: Doug Brown Date: Sun, 6 Aug 2023 20:35:27 -0700 Subject: [PATCH] Bypass GCC built-in startup code Nuvoton's sample startup_M251.S file handles enough initialization for my purposes, so I can completely bypass _start and jump directly to main. Note that I also had to add a define to enable clearing of BSS. --- hal/m258ke/nuvoton/startup_M251.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hal/m258ke/nuvoton/startup_M251.S b/hal/m258ke/nuvoton/startup_M251.S index f83c255..c76d0e3 100644 --- a/hal/m258ke/nuvoton/startup_M251.S +++ b/hal/m258ke/nuvoton/startup_M251.S @@ -204,6 +204,8 @@ Reset_Handler: #endif /*__STARTUP_COPY_MULTIPLE */ +#define __STARTUP_CLEAR_BSS + /* This part of work usually is done in C library startup code. Otherwise, * define this macro to enable it in this startup. * @@ -298,6 +300,7 @@ Reset_Handler: movw r1, 0x00000000 str r1, [r0] +#define __START main #ifndef __START #define __START _start #endif