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 : {