summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ8MAN8 <[email protected]>2023-11-28 16:22:05 +0800
committerMeco Man <[email protected]>2023-12-23 15:00:23 +0800
commit9328ad3215e908025528d92d9b32ead205aec07e (patch)
tree756186e72a8e1977b6ca150e70e434f6f64d76e9
parent71dad1ccf2ea20a9a4ba964e892c15bbe1856a27 (diff)
update .ld and SConstruct files
-rw-r--r--bsp/raspberry-pico/SConstruct2
-rw-r--r--bsp/raspberry-pico/link.ld10
2 files changed, 11 insertions, 1 deletions
diff --git a/bsp/raspberry-pico/SConstruct b/bsp/raspberry-pico/SConstruct
index bb72242f84..49b94d7c60 100644
--- a/bsp/raspberry-pico/SConstruct
+++ b/bsp/raspberry-pico/SConstruct
@@ -16,7 +16,7 @@ DefaultEnvironment(tools=[])
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
- CXX = rtconfig.CXX,
+ CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc',
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
diff --git a/bsp/raspberry-pico/link.ld b/bsp/raspberry-pico/link.ld
index f073344f2c..d997d973d5 100644
--- a/bsp/raspberry-pico/link.ld
+++ b/bsp/raspberry-pico/link.ld
@@ -87,6 +87,8 @@ SECTIONS
__rt_init_start = .;
KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .;
+
+ . = ALIGN(4);
/* Pull all c'tors into .text */
*crtbegin.o(.ctors)
@@ -102,7 +104,15 @@ SECTIONS
*(.dtors)
*(.eh_frame*)
+
+ PROVIDE(__ctors_start__ = .);
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ PROVIDE(__ctors_end__ = .);
+
. = ALIGN(4);
+
+ _etext = .;
} > FLASH
.rodata : {