File: arm-cmse-implib.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (114 lines) | stat: -rw-r--r-- 5,799 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// REQUIRES: arm
/// Test that addresses of secure gateways in an old import library are maintained in new import libraries.

// RUN: rm -rf %t && split-file %s %t && cd %t
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.base app -o app.o
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.base implib-v1 -I %S/Inputs -o 1.o
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj --triple=thumbv8m.base implib-v2 -I %S/Inputs -o 2.o

// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o 1 app.o --out-implib=1.lib --cmse-implib 1.o
// RUN: llvm-readelf -s 1 1.lib | FileCheck %s --check-prefixes=CHECK1

// RUN: ld.lld -Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 -o 2 app.o --out-implib=2.lib --in-implib=1.lib --cmse-implib 2.o
// RUN: llvm-readelf -s 2 2.lib | FileCheck %s --check-prefixes=CHECK2

//--- app

	.align	2
	.global	secure_entry
	.type	secure_entry, %function
secure_entry:
	nop
	.size	secure_entry, .-secure_entry

//--- implib-v1

    .include "arm-cmse-macros.s"

    .syntax unified
    .text

  cmse_veneer foo, function, global, function, global
  cmse_veneer bar, function, weak, function, global
  cmse_no_veneer no_veneer1, function, weak, function, global
  cmse_no_veneer no_veneer2, function, weak, function, weak

//--- implib-v2

    .include "arm-cmse-macros.s"

    .syntax unified
    .text

  cmse_veneer baz, function, weak, function, global
  cmse_veneer foo, function, global, function, global
  cmse_veneer bar, function, weak, function, global
  cmse_veneer qux, function, global, function, global
  cmse_no_veneer no_veneer1, function, weak, function, global
  cmse_no_veneer no_veneer2, function, weak, function, weak

/// Executable 1
// CHECK1:      File:
// CHECK1:      Symbol table '.symtab' contains 13 entries:
// CHECK1-NEXT:    Num:    Value  Size Type    Bind   Vis       Ndx Name
// CHECK1-NEXT:      0: 00000000     0 NOTYPE  LOCAL  DEFAULT   UND
// CHECK1-NEXT:      1: 00020000     0 NOTYPE  LOCAL  DEFAULT     2 $t
// CHECK1-NEXT:      2: 00008000     0 NOTYPE  LOCAL  DEFAULT     1 $t.0
// CHECK1-NEXT:      3: 00008004     0 NOTYPE  LOCAL  DEFAULT     1 $t.0
// CHECK1-NEXT:      4: 00008001     2 FUNC    GLOBAL DEFAULT     1 secure_entry
// CHECK1-NEXT:      5: 00020001     8 FUNC    GLOBAL DEFAULT     2 foo
// CHECK1-NEXT:      6: 00008005     2 FUNC    GLOBAL DEFAULT     1 __acle_se_foo
// CHECK1-NEXT:      7: 00020009     8 FUNC    WEAK   DEFAULT     2 bar
// CHECK1-NEXT:      8: 00008009     2 FUNC    GLOBAL DEFAULT     1 __acle_se_bar
// CHECK1-NEXT:      9: 0000800d     8 FUNC    WEAK   DEFAULT     1 no_veneer1
// CHECK1-NEXT:     10: 00008013     2 FUNC    GLOBAL DEFAULT     1 __acle_se_no_veneer1
// CHECK1-NEXT:     11: 00008015     8 FUNC    WEAK   DEFAULT     1 no_veneer2
// CHECK1-NEXT:     12: 0000801b     2 FUNC    WEAK   DEFAULT     1 __acle_se_no_veneer2


/// Import library 1
// CHECK1:      File:
// CHECK1:      Symbol table '.symtab' contains 5 entries:
// CHECK1-NEXT:    Num:    Value  Size Type    Bind   Vis       Ndx Name
// CHECK1-NEXT:      0: 00000000     0 NOTYPE  LOCAL  DEFAULT   UND
// CHECK1-NEXT:      1: 0000800d     8 FUNC    WEAK   DEFAULT   ABS no_veneer1
// CHECK1-NEXT:      2: 00008015     8 FUNC    WEAK   DEFAULT   ABS no_veneer2
// CHECK1-NEXT:      3: 00020001     8 FUNC    GLOBAL DEFAULT   ABS foo
// CHECK1-NEXT:      4: 00020009     8 FUNC    WEAK   DEFAULT   ABS bar

/// Executable 2
// CHECK2:      File:
// CHECK2:      Symbol table '.symtab' contains 17 entries:
// CHECK2-NEXT:    Num:    Value  Size Type    Bind   Vis       Ndx Name
// CHECK2-NEXT:      0: 00000000     0 NOTYPE  LOCAL  DEFAULT   UND
// CHECK2-NEXT:      1: 00020000     0 NOTYPE  LOCAL  DEFAULT     2 $t
// CHECK2-NEXT:      2: 00008000     0 NOTYPE  LOCAL  DEFAULT     1 $t.0
// CHECK2-NEXT:      3: 00008004     0 NOTYPE  LOCAL  DEFAULT     1 $t.0
// CHECK2-NEXT:      4: 00008001     2 FUNC    GLOBAL DEFAULT     1 secure_entry
// CHECK2-NEXT:      5: 00020011     8 FUNC    WEAK   DEFAULT     2 baz
// CHECK2-NEXT:      6: 00008005     2 FUNC    GLOBAL DEFAULT     1 __acle_se_baz
// CHECK2-NEXT:      7: 00020001     8 FUNC    GLOBAL DEFAULT     2 foo
// CHECK2-NEXT:      8: 00008009     2 FUNC    GLOBAL DEFAULT     1 __acle_se_foo
// CHECK2-NEXT:      9: 00020009     8 FUNC    WEAK   DEFAULT     2 bar
// CHECK2-NEXT:     10: 0000800d     2 FUNC    GLOBAL DEFAULT     1 __acle_se_bar
// CHECK2-NEXT:     11: 00020019     8 FUNC    GLOBAL DEFAULT     2 qux
// CHECK2-NEXT:     12: 00008011     2 FUNC    GLOBAL DEFAULT     1 __acle_se_qux
// CHECK2-NEXT:     13: 00008015     8 FUNC    WEAK   DEFAULT     1 no_veneer1
// CHECK2-NEXT:     14: 0000801b     2 FUNC    GLOBAL DEFAULT     1 __acle_se_no_veneer1
// CHECK2-NEXT:     15: 0000801d     8 FUNC    WEAK   DEFAULT     1 no_veneer2
// CHECK2-NEXT:     16: 00008023     2 FUNC    WEAK   DEFAULT     1 __acle_se_no_veneer2


/// Note that foo retains its address from Import library 1 (0x000020001)
/// New entry functions, baz and qux, use addresses not used by Import library 1.
/// Import library 2
// CHECK2:      File:
// CHECK2:      Symbol table '.symtab' contains 7 entries:
// CHECK2-NEXT:    Num:    Value  Size Type    Bind   Vis       Ndx Name
// CHECK2-NEXT:      0: 00000000     0 NOTYPE  LOCAL  DEFAULT   UND
// CHECK2-NEXT:      1: 00008015     8 FUNC    WEAK   DEFAULT   ABS no_veneer1
// CHECK2-NEXT:      2: 0000801d     8 FUNC    WEAK   DEFAULT   ABS no_veneer2
// CHECK2-NEXT:      3: 00020001     8 FUNC    GLOBAL DEFAULT   ABS foo
// CHECK2-NEXT:      4: 00020009     8 FUNC    WEAK   DEFAULT   ABS bar
// CHECK2-NEXT:      5: 00020011     8 FUNC    WEAK   DEFAULT   ABS baz
// CHECK2-NEXT:      6: 00020019     8 FUNC    GLOBAL DEFAULT   ABS qux