diff options
author | 2020-10-01 23:27:09 +0000 | |
---|---|---|
committer | 2020-10-01 23:27:09 +0000 | |
commit | 7ac8f7826048cf95b51fe6efdf91af9166439830 (patch) | |
tree | 1f1e64238320f861145ebf8693816674c608d895 /cortex-m-rt | |
parent | 109a832a4460236cd224d872d07665a745d6435b (diff) | |
parent | eff906561a44464e88e40ab6b9f99b1a79f3d7fa (diff) | |
download | cortex-m-7ac8f7826048cf95b51fe6efdf91af9166439830.tar.gz cortex-m-7ac8f7826048cf95b51fe6efdf91af9166439830.tar.zst cortex-m-7ac8f7826048cf95b51fe6efdf91af9166439830.zip |
Merge #297
297: Add a section to place the veneers in memory r=jonas-schievink a=hug-dev
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.
Doing tests locally I could not see any warnings if this section was empty so I think this is fine. It is highly specific to the GNU toolchain so maybe you would want some preprocessing directive and `cfg` options which I am happy to add.
There is documentation for the section name at the end of [this page](https://sourceware.org/binutils/docs/ld/ARM.html).
It needs to be aligned on 32 bytes as a requirement from the Security Attribute Unit.
Co-authored-by: Hugues de Valon <hugues.devalon@arm.com>
Diffstat (limited to 'cortex-m-rt')
-rw-r--r-- | cortex-m-rt/link.x.in | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in index f4f4959..f1a921d 100644 --- a/cortex-m-rt/link.x.in +++ b/cortex-m-rt/link.x.in @@ -110,6 +110,18 @@ SECTIONS . = ALIGN(4); /* Ensure __erodata is aligned if something unaligned is inserted after .rodata */ __erodata = .; + /* ### .gnu.sgstubs + This section contains the TrustZone-M veneers put there by the Arm GNU linker. */ + . = ALIGN(32); /* Security Attribution Unit blocks must be 32 bytes aligned. */ + __veneer_base = ALIGN(4); + .gnu.sgstubs : ALIGN(4) + { + *(.gnu.sgstubs*) + . = ALIGN(4); /* 4-byte align the end (VMA) of this section */ + } > FLASH + . = ALIGN(4); /* Ensure __veneer_limit is aligned if something unaligned is inserted after .gnu.sgstubs */ + __veneer_limit = .; + /* ## Sections in RAM */ /* ### .data */ .data : ALIGN(4) |