]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libgcc/config/aarch64/aarch64-asm.h
1 /* AArch64 asm definitions.
2 Copyright (C) 2023-2024 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published
8 by the Free Software Foundation; either version 3, or (at your
9 option) any later version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
25 #include "auto-target.h"
27 #define L(label) .L ## label
29 /* Marking variant PCS symbol references is important for PLT calls
30 otherwise it is for documenting the PCS in the symbol table. */
31 #ifdef HAVE_AS_VARIANT_PCS
32 # define variant_pcs(name) .variant_pcs name
34 # define variant_pcs(name)
37 /* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code. */
38 #define FEATURE_1_AND 0xc0000000
39 #define FEATURE_1_BTI 1
40 #define FEATURE_1_PAC 2
42 /* Supported features based on the code generation options. */
43 #if defined(__ARM_FEATURE_BTI_DEFAULT)
44 # define BTI_FLAG FEATURE_1_BTI
45 # define BTI_C hint 34
51 #if __ARM_FEATURE_PAC_DEFAULT & 3
52 # define PAC_FLAG FEATURE_1_PAC
53 # define PACIASP hint 25; .cfi_window_save
54 # define AUTIASP hint 29; .cfi_window_save
61 /* Add a NT_GNU_PROPERTY_TYPE_0 note. */
62 #define GNU_PROPERTY(type, value) \
63 .section .note.gnu.property, "a"; \
75 #if defined(__linux__) || defined(__FreeBSD__)
76 /* Do not require executable stack. */
77 .section
.note
.GNU
-stack
, "", %progbits
80 /* Add GNU property note if built with branch protection. */
81 # if (BTI_FLAG|PAC_FLAG) != 0
82 GNU_PROPERTY (FEATURE_1_AND
, BTI_FLAG
|PAC_FLAG
)
86 #define ENTRY_ALIGN(name, align) \
88 .type name,%function; \
94 #define ENTRY(name) ENTRY_ALIGN(name, 16)