update .ld and SConstruct files

This commit is contained in:
Z8MAN8 2023-11-28 16:22:05 +08:00 committed by Meco Man
parent 71dad1ccf2
commit 9328ad3215
2 changed files with 11 additions and 1 deletions

View File

@ -16,7 +16,7 @@ DefaultEnvironment(tools=[])
env = Environment(tools = ['mingw'], env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS, CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
CXX = rtconfig.CXX, CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc', AR = rtconfig.AR, ARFLAGS = '-rc',
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH) env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

View File

@ -87,6 +87,8 @@ SECTIONS
__rt_init_start = .; __rt_init_start = .;
KEEP(*(SORT(.rti_fn*))) KEEP(*(SORT(.rti_fn*)))
__rt_init_end = .; __rt_init_end = .;
. = ALIGN(4);
/* Pull all c'tors into .text */ /* Pull all c'tors into .text */
*crtbegin.o(.ctors) *crtbegin.o(.ctors)
@ -102,7 +104,15 @@ SECTIONS
*(.dtors) *(.dtors)
*(.eh_frame*) *(.eh_frame*)
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
. = ALIGN(4); . = ALIGN(4);
_etext = .;
} > FLASH } > FLASH
.rodata : { .rodata : {