Skip to content

Commit 2be2456

Browse files
committed
feat(wb0): add __libc_init_array support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent c4eaf59 commit 2be2456

File tree

1 file changed

+32
-0
lines changed
  • variants/STM32WB0x/WB05KZV_WB05TZF_WB09KEV_WB09TEF

1 file changed

+32
-0
lines changed

variants/STM32WB0x/WB05KZV_WB05TZF_WB09KEV_WB09TEF/ldscript.ld

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ SECTIONS
102102
*(.glue_7) /* glue arm to thumb code */
103103
*(.glue_7t) /* glue thumb to arm code */
104104

105+
KEEP (*(.init))
106+
KEEP (*(.fini))
107+
105108
. = ALIGN(4);
106109
_etext = .;
107110
} >FLASH
@@ -127,6 +130,35 @@ SECTIONS
127130
__exidx_end = .;
128131
} >FLASH
129132

133+
.preinit_array (READONLY) :
134+
{
135+
. = ALIGN(4);
136+
PROVIDE_HIDDEN (__preinit_array_start = .);
137+
KEEP (*(.preinit_array*))
138+
PROVIDE_HIDDEN (__preinit_array_end = .);
139+
. = ALIGN(4);
140+
} >FLASH
141+
142+
.init_array (READONLY) :
143+
{
144+
. = ALIGN(4);
145+
PROVIDE_HIDDEN (__init_array_start = .);
146+
KEEP (*(SORT(.init_array.*)))
147+
KEEP (*(.init_array*))
148+
PROVIDE_HIDDEN (__init_array_end = .);
149+
. = ALIGN(4);
150+
} >FLASH
151+
152+
.fini_array (READONLY) :
153+
{
154+
. = ALIGN(4);
155+
PROVIDE_HIDDEN (__fini_array_start = .);
156+
KEEP (*(SORT(.fini_array.*)))
157+
KEEP (*(.fini_array*))
158+
PROVIDE_HIDDEN (__fini_array_end = .);
159+
. = ALIGN(4);
160+
} >FLASH
161+
130162
/* used by the startup to initialize data */
131163
_sidata = LOADADDR(.data);
132164

0 commit comments

Comments
 (0)