You copied the Doc URL to your clipboard.

Placement of CMSE veneer sections [BETA]

armlink automatically generates all CMSE veneer sections. The linker creates __at sections called Veneer$$CMSE_AT_address for secure gateway veneers that are specified in a user-defined input import library. It produces one normal section Veneer$$CMSE to hold all other secure gateway veneers.

Note

This topic describes a [BETA] feature.

Placement of secure gateway veneers generated from input import libraries

The __at sections are produced as follows:

  • Symbols in the input import library are ordered by their absolute value.
  • The first symbol starts a new __at section that has its required address set to the address of the symbol rounded down to 32-byte boundary.
  • A symbol belongs to the same section as the previous symbol if the following condition holds:

    DOWN(symbol_address) - DOWN(previous_symbol_address + 8 - 1) <= 32

    where DOWN() returns the given address rounded down to a 32-byte boundary.

  • If a symbol does not belong to the same section as the previous symbol a new section is started.

The following examples show how to place secure gateway veneers that are specified in the input import library:

Example 1
        .global entry1
        .type entry1, STT_FUNC
entry1=0x1001

        .global entry2
        .type entry2, STT_FUNC
entry2=0x1039

Symbol entry1 requires a section that spans at least range 0x1000 to 0x101f, and symbol entry2 requires a section that spans at least range 0x1020 to 0x103f. Because there is no space between these two ranges, the linker creates only one __at section for these two secure gateway veneers:

        .section "Veneer$$CMSE_AT_0x00001000", "ax"
        .balign 32

entry1:
        SG
        B.W __acle_se_entry1
        .space 48

entry2:
        SG
        B.W __acle_se_entry2
Example 2
        .global entry1
        .type entry1, STT_FUNC
entry1=0x1019

        .global entry2
        .type entry2, STT_FUNC
entry2=0x1041

Symbol entry1 requires a section that spans at least range 0x1000 to 0x101f, and symbol entry2 requires a section that spans at least range0x1040 to 0x105f. Because there is a space between these two ranges, the linker creates two separate __at sections. Each of them contains one secure gateway veneer:

        .section "Veneer$$CMSE_AT_0x00001000", "ax"
        .balign 32

        .space 24
entry1:
        SG
        B.W __acle_se_entry1

        .section "Veneer$$CMSE_AT_0x00001040", "ax"
        .balign 32

entry2:
        SG
        B.W __acle_se_entry2
        .space 24

The same rules and options that apply to normal __at sections apply to __at sections created for secure gateway veneers. This includes automatic placement of these sections when you specify --autoat.

Placement of secure gateway veneers that are not specified in the input import library

Secure gateway veneers that do not have their addresses specified in an input import library must be placed using a scatter file. All linker generated veneers are placed in a single section called Veneer$$CMSE.

For a non-secure callable region of size 0x1000 bytes with a base address of 0x1000 a suitable example scatter file to match the veneers is:

LOAD_NSCR 0x1000 0x1000
{
    EXEC_NSCR 0x1000 0x1000
    {
        *(Veneer$$CMSE)
    }
}
Was this page helpful? Yes No