Gabor Toth | 748b3db | 2024-06-06 13:50:19 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
| 2 | /* |
| 3 | * Copyright (c) 2021, Linaro Limited |
| 4 | */ |
| 5 | |
| 6 | #include <elf_common.h> |
| 7 | |
| 8 | /* |
| 9 | * This macro emits a program property note section identifying |
| 10 | * architecture features which require special handling, mainly for |
| 11 | * use in assembly files in the libraries linked with TA's. |
| 12 | */ |
| 13 | |
| 14 | .macro emit_aarch64_feature_1_and, feat |
| 15 | .pushsection .note.gnu.property, "a" |
| 16 | .align 3 |
| 17 | .long 2f - 1f /* n_namesz */ |
| 18 | .long 6f - 3f /* n_desc_sz */ |
| 19 | .long NT_GNU_PROPERTY_TYPE_0 /* n_type */ |
| 20 | 1: .string "GNU" /* name */ |
| 21 | 2: |
| 22 | .align 3 |
| 23 | 3: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type */ |
| 24 | .long 5f - 4f /* pr_datasz */ |
| 25 | 4: |
| 26 | /* |
| 27 | * This is described with an array of char in the Linux API |
| 28 | * spec but the text and all other usage (including binutils, |
| 29 | * clang and GCC) treat this as a 32 bit value so no swizzling |
| 30 | * is required for big endian. |
| 31 | */ |
| 32 | .long \feat /* property */ |
| 33 | 5: |
| 34 | .align 3 |
| 35 | 6: |
| 36 | .popsection |
| 37 | .endm |