Skip to content

Commit eff9065

Browse files
committed
Add a section to place the veneers in memory
The veneers are for now only generated by the Arm GNU linker when it spots an entry function (one that was decorated with the cmse_nonsecure_entry attribute). Adding this section will allow to configure the SAU to make this section Non-Secure Callable. Signed-off-by: Hugues de Valon <[email protected]>
1 parent 109a832 commit eff9065

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cortex-m-rt/link.x.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ SECTIONS
110110
. = ALIGN(4); /* Ensure __erodata is aligned if something unaligned is inserted after .rodata */
111111
__erodata = .;
112112

113+
/* ### .gnu.sgstubs
114+
This section contains the TrustZone-M veneers put there by the Arm GNU linker. */
115+
. = ALIGN(32); /* Security Attribution Unit blocks must be 32 bytes aligned. */
116+
__veneer_base = ALIGN(4);
117+
.gnu.sgstubs : ALIGN(4)
118+
{
119+
*(.gnu.sgstubs*)
120+
. = ALIGN(4); /* 4-byte align the end (VMA) of this section */
121+
} > FLASH
122+
. = ALIGN(4); /* Ensure __veneer_limit is aligned if something unaligned is inserted after .gnu.sgstubs */
123+
__veneer_limit = .;
124+
113125
/* ## Sections in RAM */
114126
/* ### .data */
115127
.data : ALIGN(4)

0 commit comments

Comments
 (0)