56 lines · plain
1// REQUIRES: arm2/// Create a secure app and import library using CMSE.3/// Create a non-secure app that refers symbols in the import library.4 5// RUN: rm -rf %t && split-file %s %t && cd %t6// 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.o8/// Create the secure app and import library.9// RUN: ld.lld -e secure_entry --image-base=0 --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-sections10// RUN: llvm-readelf -s implib.lib | FileCheck %s11// RUN: llvm-objdump -d --no-show-raw-insn secureapp | FileCheck %s --check-prefix=DISS12 13 14// DISS-LABEL: <__acle_se_entry1>:15// DISS-NEXT: 10: nop16 17// DISS-LABEL: <entry1>:18// DISS-NEXT: 1000000: sg19// DISS-LABEL: b.w {{.*}} <__acle_se_entry1>20 21// DISS-LABEL: <entry2>:22// DISS-NEXT: 1000008: sg23// DISS-LABEL: b.w {{.*}} <__acle_se_entry2>24 25// DISS-LABEL: <__acle_se_entry2>:26// DISS-NEXT: 2000000: nop27 28// CHECK: Symbol table '.symtab' contains {{.*}} entries:29// CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name30// CHECK-NEXT: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND31// CHECK-NEXT: 1: 01000001 8 FUNC GLOBAL DEFAULT ABS entry132// CHECK-NEXT: 2: 01000009 8 FUNC GLOBAL DEFAULT ABS entry233 34//--- cmse-implib.s35 .include "arm-cmse-macros.s"36 37 .syntax unified38 .section SECURE1, "ax"39 40 cmse_veneer entry1, function, global, function, global41 42 .syntax unified43 .section SECURE2, "ax"44 45 cmse_veneer entry2, function, global, function, global46 47//--- cmse-secure-app.s48 .text49 .align 250 // Main entry point.51 .global secure_entry52 .thumb_func53secure_entry:54 bx lr55 .size secure_entry, .-secure_entry56