1
1
/*
2
2
* Macros for asm code. AArch64 version.
3
3
*
4
- * Copyright (c) 2019-2023 , Arm Limited.
4
+ * Copyright (c) 2019-2025 , Arm Limited.
5
5
* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
6
6
*/
7
7
8
8
#ifndef _ASMDEFS_H
9
9
#define _ASMDEFS_H
10
10
11
+ #if defined(__APPLE__ )
12
+ # define SEP %%
13
+ #else
14
+ # define SEP ;
15
+ #endif
16
+
11
17
/* Branch Target Identitication support. */
12
18
#define BTI_C hint 34
13
19
#define BTI_J hint 36
14
20
/* Return address signing support (pac-ret). */
15
- #define PACIASP hint 25; .cfi_window_save
16
- #define AUTIASP hint 29; .cfi_window_save
21
+ #define PACIASP hint 25 SEP .cfi_window_save
22
+ #define AUTIASP hint 29 SEP .cfi_window_save
17
23
18
24
/* GNU_PROPERTY_AARCH64_* macros from elf.h. */
19
25
#define FEATURE_1_AND 0xc0000000
22
28
23
29
/* Add a NT_GNU_PROPERTY_TYPE_0 note. */
24
30
#define GNU_PROPERTY (type , value ) \
25
- .section .note.gnu.property, "a"; \
26
- .p2align 3; \
27
- .word 4; \
28
- .word 16; \
29
- .word 5; \
30
- .asciz "GNU"; \
31
- .word type; \
32
- .word 4; \
33
- .word value; \
34
- .word 0; \
31
+ .section .note.gnu.property, "a" SEP \
32
+ .p2align 3 SEP \
33
+ .word 4 SEP \
34
+ .word 16 SEP \
35
+ .word 5 SEP \
36
+ .asciz "GNU" SEP \
37
+ .word type SEP \
38
+ .word 4 SEP \
39
+ .word value SEP \
40
+ .word 0 SEP \
35
41
.text
36
42
37
43
/* If set then the GNU Property Note section will be added to
@@ -46,23 +52,23 @@ GNU_PROPERTY (FEATURE_1_AND, FEATURE_1_BTI|FEATURE_1_PAC)
46
52
#endif
47
53
48
54
#define ENTRY_ALIGN (name , alignment ) \
49
- .global name; \
50
- .type name,%function; \
51
- .align alignment; \
55
+ .global name SEP \
56
+ .type name,%function SEP \
57
+ .align alignment SEP \
52
58
name: \
53
- .cfi_startproc; \
54
- BTI_C;
59
+ .cfi_startproc SEP \
60
+ BTI_C SEP
55
61
56
62
#define ENTRY (name ) ENTRY_ALIGN(name, 6)
57
63
58
64
#define ENTRY_ALIAS (name ) \
59
- .global name; \
60
- .type name,%function; \
65
+ .global name SEP \
66
+ .type name,%function SEP \
61
67
name:
62
68
63
69
#define END (name ) \
64
- .cfi_endproc; \
65
- .size name, .-name;
70
+ .cfi_endproc SEP \
71
+ .size name, .-name
66
72
67
73
#define L (l ) .L ## l
68
74
0 commit comments