From 1606c8809118eafea42db264fc1bb4e0349fa015 Mon Sep 17 00:00:00 2001 From: luojia65 Date: Tue, 26 Apr 2022 16:36:50 +0800 Subject: [PATCH] rt: fix veneer limit position in linker script add description and hints on linker behavior at symbol `__veneer_limit` Co-authored-by: Adam Greig --- cortex-m-rt/link.x.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in index deff3769..4461646a 100644 --- a/cortex-m-rt/link.x.in +++ b/cortex-m-rt/link.x.in @@ -144,8 +144,12 @@ SECTIONS __veneer_base = .; *(.gnu.sgstubs*) . = ALIGN(32); - __veneer_limit = .; } > FLASH + /* Place `__veneer_limit` outside the `.gnu.sgstubs` section because veneers are + * always inserted last in the section, which would otherwise be _after_ the `__veneer_limit` symbol. + */ + . = ALIGN(32); + __veneer_limit = .; /* ### .bss */ .bss (NOLOAD) : ALIGN(4)