Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Merge #297
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bors[bot] and hug-dev authored Oct 1, 2020
2 parents 046c8f5 + c599230 commit 96525a6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions link.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 96525a6

Please sign in to comment.