2 /// Create
a secure app
and import library using CMSE.
3 /// Create
a non-secure app that refers symbols in the import library.
5 // RUN
: rm
-rf
%t && split-file
%s
%t && cd
%t
6 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
--triple
=thumbv8m.main cmse-implib.s
-o implib.o
-I
%S
/Inputs
/
7 // RUN
: llvm-mc
-arm-add-build-attributes
-filetype
=obj
--triple
=thumbv8m.main cmse-secure-app.s
-o secureapp.o
8 /// Create the secure app
and import library.
9 // RUN
: ld.lld
-e secure_entry
--section-start
.gnu.sgstubs=0x1000000 --section-start SECURE1=0x10 --section-start SECURE2=0x2000000 --cmse-implib implib.o secureapp.o --out-implib=implib.lib -o secureapp --gc-sections
10 // RUN
: llvm-readelf
-s implib.lib | FileCheck
%s
11 // RUN
: llvm-objdump
-d
--no-show-raw-insn secureapp | FileCheck
%s
--check-prefix
=DISS
14 // DISS-LABEL
: <__acle_se_entry1
>:
17 // DISS-LABEL
: <entry1
>:
18 // DISS-NEXT
: 1000000: sg
19 // DISS-LABEL
: b.w
{{.*}} <__acle_se_entry1>
21 // DISS-LABEL
: <entry2
>:
22 // DISS-NEXT
: 1000008: sg
23 // DISS-LABEL
: b.w
{{.*}} <__acle_se_entry2>
25 // DISS-LABEL
: <__acle_se_entry2
>:
26 // DISS-NEXT
: 2000000: nop
28 // CHECK
: Symbol table
'.symtab' contains
{{.*}} entries:
29 // CHECK-NEXT
: Num
: Value Size Type Bind Vis Ndx Name
30 // CHECK-NEXT
: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
31 // CHECK-NEXT
: 1: 01000001 8 FUNC GLOBAL DEFAULT
ABS entry1
32 // CHECK-NEXT
: 2: 01000009 8 FUNC GLOBAL DEFAULT
ABS entry2
35 .include "arm-cmse-macros.s"
38 .section SECURE1, "ax"
40 cmse_veneer entry1
, function
, global
, function
, global
43 .section SECURE2, "ax"
45 cmse_veneer entry2
, function
, global
, function
, global
47 //--- cmse-secure-app.s
55 .size secure_entry, .-secure_entry