set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
-# See definition of run_ld_link_tests in testsuite/lib/ld-lib.exp for more
-# details.
-# set aarch64elflinktests {
-# {"Build bti-plt-so for PLT tests"
-# "-shared" ""
-# "-I$srcdir/$subdir -defsym __property_bti__=1"
-# {bti-plt-so.s} {} "libbti-plt-so.so"}
-# }
-
-# if [check_shared_lib_support] {
-# run_ld_link_tests $aarch64elflinktests
-# }
-
foreach t $test_list {
# We need to strip the ".d", but can leave the dirname.
run_dump_test [file rootname $t] \
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+
+ .text
+ .globl _start
+ .type _start,@function
+_start:
+ bl foo
+ bl bar
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+
+ .text
+ .globl foo2
+ .type foo2,@function
+foo2:
+ bl foo_2
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
--- /dev/null
+# name: EABI build attributes: some files missing Tag_Feature_BTI, but -z force-bti generates PLT with BTI.
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-bti-via-gnu-props.s
+# source: ba-aarch64-1-bti-2.s
+# as: -defsym __property_bti__=1
+# ld: -shared -T bti-plt.ld -z force-bti -z bti-report=warning
+#warning: \A[^\n]*ba-aarch64-1-void\.o: warning: BTI is required by -z force-bti, but this input object file lacks the necessary property note\.
+# objdump: -dr -j .plt
+
+[^:]*: *file format elf64-.*aarch64
+
+Disassembly of section \.plt:
+
+[0-9]+ <\.plt>:
+.*: d503245f bti c
+.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9400e11 ldr x17, \[x16, #24\]
+.*: 91006210 add x16, x16, #0x18
+.*: d61f0220 br x17
+.*: d503201f nop
+.*: d503201f nop
+
+[0-9]+ <foo_1@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401211 ldr x17, \[x16, #32\]
+.*: 91008210 add x16, x16, #0x20
+.*: d61f0220 br x17
+
+[0-9]+ <foo_2@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401611 ldr x17, \[x16, #40\]
+.*: 9100a210 add x16, x16, #0x28
+.*: d61f0220 br x17
+
+[0-9]+ <foo@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401a11 ldr x17, \[x16, #48\]
+.*: 9100c210 add x16, x16, #0x30
+.*: d61f0220 br x17
+
+[0-9]+ <bar@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401e11 ldr x17, \[x16, #56\]
+.*: 9100e210 add x16, x16, #0x38
+.*: d61f0220 br x17
+
+[0-9]+ <foo_3@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9402211 ldr x17, \[x16, #64\]
+.*: 91010210 add x16, x16, #0x40
+.*: d61f0220 br x17
--- /dev/null
+# name: EABI build attributes: some files missing Tag_Feature_BTI, but -z force-bti means that the output has Tag_Feature_BTI=0x1
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-bti-via-gnu-props.s
+# source: ba-aarch64-1-bti-2.s
+# as: -defsym __property_bti__=1
+# ld: -shared -T bti-plt.ld -z force-bti -z bti-report=warning
+#warning: .*ba-aarch64-1-void\.o: warning: BTI is required by -z force-bti.*
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: BTI
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+# name: EABI build attributes: a input object without build attributes or GNU properties, but -z force-bti means that the output has Tag_Feature_BTI=0x1
+# source: ba-aarch64-1-void.s
+# as:
+# ld: -shared -T bti-plt.ld -z force-bti -z bti-report=warning
+#warning: .*ba-aarch64-1-void\.o: warning: BTI is required by -z force-bti.*
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: BTI
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+31
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
--- /dev/null
+# name: EABI build attributes: all files with BTI GNU property means that output also has Tag_Feature_BTI=0x1
+# source: ba-aarch64-1-bti-via-gnu-props.s
+# as: -defsym __property_bti__=1
+# ld: -shared -T bti-plt.ld
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: BTI
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+# name: EABI build attributes: some files missing Tag_Feature_BTI does not trigger generation of PLT with BTI.
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-bti-2.s
+# as:
+# ld: -shared -T bti-plt.ld
+# objdump: -dr -j .plt
+
+[^:]*: *file format elf64-.*aarch64
+
+Disassembly of section \.plt:
+
+[0-9]+ <\.plt>:
+.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9400e11 ldr x17, \[x16, #24\]
+.*: 91006210 add x16, x16, #0x18
+.*: d61f0220 br x17
+.*: d503201f nop
+.*: d503201f nop
+.*: d503201f nop
+
+[0-9]+ <foo_1@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401211 ldr x17, \[x16, #32\]
+.*: 91008210 add x16, x16, #0x20
+.*: d61f0220 br x17
+
+[0-9]+ <foo_2@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401611 ldr x17, \[x16, #40\]
+.*: 9100a210 add x16, x16, #0x28
+.*: d61f0220 br x17
+
+[0-9]+ <foo@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401a11 ldr x17, \[x16, #48\]
+.*: 9100c210 add x16, x16, #0x30
+.*: d61f0220 br x17
+
+[0-9]+ <bar@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401e11 ldr x17, \[x16, #56\]
+.*: 9100e210 add x16, x16, #0x38
+.*: d61f0220 br x17
--- /dev/null
+# name: EABI build attributes: some files missing Tag_Feature_BTI means that the output has Tag_Feature_BTI=0x0
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-bti-2.s
+# as:
+# ld: -shared -T bti-plt.ld
+# readelf: --arch-specific --notes
+
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+31
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+0 .*
--- /dev/null
+# name: EABI build attributes: all files with Tag_Feature_BTI=0x1 generates PLT with BTI.
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-bti-2.s
+# as:
+# ld: -shared -T bti-plt.ld
+# objdump: -dr -j .plt
+
+[^:]*: *file format elf64-.*aarch64
+
+Disassembly of section \.plt:
+
+[0-9]+ <\.plt>:
+.*: d503245f bti c
+.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9400e11 ldr x17, \[x16, #24\]
+.*: 91006210 add x16, x16, #0x18
+.*: d61f0220 br x17
+.*: d503201f nop
+.*: d503201f nop
+
+[0-9]+ <foo_2@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401211 ldr x17, \[x16, #32\]
+.*: 91008210 add x16, x16, #0x20
+.*: d61f0220 br x17
+
+[0-9]+ <foo@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401611 ldr x17, \[x16, #40\]
+.*: 9100a210 add x16, x16, #0x28
+.*: d61f0220 br x17
+
+[0-9]+ <bar@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401a11 ldr x17, \[x16, #48\]
+.*: 9100c210 add x16, x16, #0x30
+.*: d61f0220 br x17
--- /dev/null
+# name: EABI build attributes: all files with Tag_Feature_BTI=0x1 means that output also has Tag_Feature_BTI=0x1
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-bti-2.s
+# as:
+# ld: -shared -T bti-plt.ld
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: BTI
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+31
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
--- /dev/null
+ .text
+ .globl foo3
+ .type foo3,@function
+foo3:
+ bl foo_3
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
--- /dev/null
+# name: EABI build attributes: EABI build attributes: some files with build attribute Tag_Feature_BTI=0x1 and others with equivalent GNU property means that output also has Tag_Feature_BTI=0x1
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-bti-via-gnu-props.s
+# source: ba-aarch64-1-bti-2.s
+# as: -defsym __property_bti__=1
+# ld: -shared -T bti-plt.ld
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: BTI
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_GCS, 1
+
+ .text
+ .globl _start
+ .type _start,@function
+_start:
+ bl foo
+ bl bar
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_GCS, 1
+
+ .text
+ .globl foo2
+ .type foo2,@function
+foo2:
+ bl foo_2
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
--- /dev/null
+# name: EABI build attributes: some files missing Tag_Feature_GCS, but -z gcs=always means that GCS is required.
+# source: ba-aarch64-1-gcs-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-gcs-via-gnu-props.s
+# source: ba-aarch64-1-gcs-2.s
+# as: -defsym __property_gcs__=1
+# ld: -shared -z gcs=always -z gcs-report=warning
+#warning: .*ba-aarch64-1-void\.o: warning: GCS is required by -z gcs.*
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: GCS
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+0 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+ +Tag_Feature_GCS:[ ]+1 .*
--- /dev/null
+# name: EABI build attributes: all files with GCS GNU property means that output also has Tag_Feature_GCS=0x1
+# source: ba-aarch64-1-gcs-via-gnu-props.s
+# as: -defsym __property_gcs__=1
+# ld: -shared
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: GCS
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+0 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+ +Tag_Feature_GCS:[ ]+1 .*
--- /dev/null
+# name: EABI build attributes: some files missing Tag_Feature_GCS means that the output has Tag_Feature_GCS=0x0
+# source: ba-aarch64-1-gcs-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-gcs-2.s
+# as:
+# ld: -shared -z gcs=implicit -z gcs-report=warning
+# readelf: --arch-specific --notes
+
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+31
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+# name: EABI build attributes: all files with Tag_Feature_GCS=0x1 means that output also has Tag_Feature_GCS=0x1
+# source: ba-aarch64-1-gcs-1.s
+# source: ba-aarch64-1-gcs-2.s
+# as:
+# ld: -shared
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: GCS
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+31
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_GCS:[ ]+1 .*
--- /dev/null
+ .text
+ .globl foo3
+ .type foo3,@function
+foo3:
+ bl foo_3
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 0
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_GCS, 0
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_PAC, 1
+
+ .text
+ .globl _start
+ .type _start,@function
+_start:
+ bl foo
+ bl bar
\ No newline at end of file
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_PAC, 1
+
+ .text
+ .globl foo2
+ .type foo2,@function
+foo2:
+ bl foo_2
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
--- /dev/null
+# name: EABI build attributes: all files with Tag_Feature_PAC=0x1 and '-z pac-plt' does generate PLT with PAC.
+# source: ba-aarch64-1-pac-1.s
+# source: ba-aarch64-1-pac-2.s
+# as: -defsym __property_pac__=1
+# ld: -shared -T bti-plt.ld -z pac-plt
+# objdump: -dr -j .plt
+
+[^:]*: *file format elf64-.*aarch64
+
+Disassembly of section \.plt:
+
+[0-9]+ <\.plt>:
+.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9400e11 ldr x17, \[x16, #24\]
+.*: 91006210 add x16, x16, #0x18
+.*: d61f0220 br x17
+.*: d503201f nop
+.*: d503201f nop
+.*: d503201f nop
+
+[0-9]+ <foo_2@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401211 ldr x17, \[x16, #32\]
+.*: 91008210 add x16, x16, #0x20
+.*: d503219f autia1716
+.*: d61f0220 br x17
+.*: d503201f nop
+
+[0-9]+ <foo@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401611 ldr x17, \[x16, #40\]
+.*: 9100a210 add x16, x16, #0x28
+.*: d503219f autia1716
+.*: d61f0220 br x17
+.*: d503201f nop
+
+[0-9]+ <bar@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401a11 ldr x17, \[x16, #48\]
+.*: 9100c210 add x16, x16, #0x30
+.*: d503219f autia1716
+.*: d61f0220 br x17
+.*: d503201f nop
--- /dev/null
+# name: EABI build attributes: all files with Tag_Feature_PAC=0x1 and '-z pac-plt' means that output has Tag_Feature_PAC=0x1
+# source: ba-aarch64-1-pac-1.s
+# source: ba-aarch64-1-pac-2.s
+# as: -defsym __property_pac__=1
+# ld: -shared -T bti-plt.ld -z pac-plt
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: PAC
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+0 .*
+ +Tag_Feature_PAC:[ ]+1 .*
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+# name: EABI build attributes: all files with Tag_Feature_PAC=0x1 but no '-z pac-plt' does not generate PLT with PAC.
+# source: ba-aarch64-1-pac-1.s
+# source: ba-aarch64-1-pac-2.s
+# as: -defsym __property_pac__=1
+# ld: -shared -T bti-plt.ld
+# objdump: -dr -j .plt
+
+[^:]*: *file format elf64-.*aarch64
+
+Disassembly of section \.plt:
+
+[0-9]+ <\.plt>:
+.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9400e11 ldr x17, \[x16, #24\]
+.*: 91006210 add x16, x16, #0x18
+.*: d61f0220 br x17
+.*: d503201f nop
+.*: d503201f nop
+.*: d503201f nop
+
+[0-9]+ <foo_2@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401211 ldr x17, \[x16, #32\]
+.*: 91008210 add x16, x16, #0x20
+.*: d61f0220 br x17
+
+[0-9]+ <foo@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401611 ldr x17, \[x16, #40\]
+.*: 9100a210 add x16, x16, #0x28
+.*: d61f0220 br x17
+
+[0-9]+ <bar@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401a11 ldr x17, \[x16, #48\]
+.*: 9100c210 add x16, x16, #0x30
+.*: d61f0220 br x17
--- /dev/null
+# name: EABI build attributes: all files with Tag_Feature_PAC=0x1 but no '-z pac-plt' means that output has Tag_Feature_PAC=0x1
+# source: ba-aarch64-1-pac-1.s
+# source: ba-aarch64-1-pac-2.s
+# as: -defsym __property_pac__=1
+# ld: -shared -T bti-plt.ld
+# readelf: --arch-specific --notes
+
+Displaying notes found in: \.note\.gnu\.property
+ Owner Data size Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties:[ ]+AArch64 feature: PAC
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+0 .*
+ +Tag_Feature_PAC:[ ]+1 .*
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+# name: EABI build attributes: '-z pac-plt' with some files without Tag_Feature_PAC=0x1 generates PLT with PAC.
+# source: ba-aarch64-1-pac-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-pac-2.s
+# as: -defsym __property_pac__=1
+# ld: -shared -T bti-plt.ld -z pac-plt
+# objdump: -dr -j .plt
+
+[^:]*: *file format elf64-.*aarch64
+
+Disassembly of section \.plt:
+
+[0-9]+ <\.plt>:
+.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]!
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9400e11 ldr x17, \[x16, #24\]
+.*: 91006210 add x16, x16, #0x18
+.*: d61f0220 br x17
+.*: d503201f nop
+.*: d503201f nop
+.*: d503201f nop
+
+[0-9]+ <foo_1@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401211 ldr x17, \[x16, #32\]
+.*: 91008210 add x16, x16, #0x20
+.*: d503219f autia1716
+.*: d61f0220 br x17
+.*: d503201f nop
+
+[0-9]+ <foo_2@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401611 ldr x17, \[x16, #40\]
+.*: 9100a210 add x16, x16, #0x28
+.*: d503219f autia1716
+.*: d61f0220 br x17
+.*: d503201f nop
+
+[0-9]+ <foo@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401a11 ldr x17, \[x16, #48\]
+.*: 9100c210 add x16, x16, #0x30
+.*: d503219f autia1716
+.*: d61f0220 br x17
+.*: d503201f nop
+
+[0-9]+ <bar@plt>:
+.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_>
+.*: f9401e11 ldr x17, \[x16, #56\]
+.*: 9100e210 add x16, x16, #0x38
+.*: d503219f autia1716
+.*: d61f0220 br x17
+.*: d503201f nop
--- /dev/null
+# name: EABI build attributes: '-z pac-plt' with some files without Tag_Feature_PAC=0x1 does not set Tag_Feature_PAC=0x1.
+# source: ba-aarch64-1-pac-1.s
+# source: ba-aarch64-1-void.s
+# source: ba-aarch64-1-pac-2.s
+# as: -defsym __property_pac__=1
+# ld: -shared -T bti-plt.ld -z pac-plt
+# readelf: --arch-specific --notes
+
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+0 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+ .text
+ .globl foo3
+ .type foo3,@function
+foo3:
+ bl foo_3
+
+.ifdef __split_gnu_properties__
+.include "gnu-note-properties-selectable-split.inc"
+.else
+.include "gnu-note-properties-selectable-merged.inc"
+.endif
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+.aeabi_attribute Tag_Feature_PAC, 1
+
+.aeabi_subsection aeabi_pauthabi, required, uleb128
+.aeabi_attribute Tag_PAuth_Platform, 0x0
+.aeabi_attribute Tag_PAuth_Schema, 0x1
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+.aeabi_attribute Tag_Feature_PAC, 0
+
+.aeabi_subsection aeabi_pauthabi, required, uleb128
+.aeabi_attribute Tag_PAuth_Platform, 0x0
+.aeabi_attribute Tag_PAuth_Schema, 0x1
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+.aeabi_attribute Tag_Feature_PAC, 1
+
+.aeabi_subsection aeabi_pauthabi, required, uleb128
+.aeabi_attribute Tag_PAuth_Platform, 0x0
+.aeabi_attribute Tag_PAuth_Schema, 0x0
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+.aeabi_attribute Tag_Feature_PAC, 1
+
+.aeabi_subsection aeabi_pauthabi, required, uleb128
+.aeabi_attribute Tag_PAuth_Platform, 0x0
+.aeabi_attribute Tag_PAuth_Schema, 0x0
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+.aeabi_attribute Tag_Feature_PAC, 1
+
+.aeabi_subsection aeabi_pauthabi, required, uleb128
+.aeabi_attribute Tag_PAuth_Platform, 0xdead
+.aeabi_attribute Tag_PAuth_Schema, 0xbeef
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, required, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+.aeabi_attribute Tag_Feature_PAC, 1
+
+.aeabi_subsection aeabi_pauthabi, optional, ntbs
+.aeabi_attribute Tag_PAuth_Platform, "hello"
+.aeabi_attribute Tag_PAuth_Schema, "world"
--- /dev/null
+# name: EABI build attributes: combine non-matching aeabi_pauthabi subsections
+# source: ba-aarch64-1-required-subsection-1.s
+# source: ba-aarch64-1-required-subsection-mismatch-1.s
+# source: ba-aarch64-1-required-subsection-2.s
+# as:
+# ld: -shared
+#error: \A[^\n]*ba-aarch64-1-required-subsection-mismatch-1\.o: error: mismatching value for required object attribute 'Tag_PAuth_Platform' in subsection 'aeabi_pauthabi': 0xdead
+#error: \n[^\n]*ba-aarch64-1-required-subsection-1\.o: info: conflicting value '0' lives here
+#error: \n[^\n]*ba-aarch64-1-required-subsection-mismatch-1\.o: error: mismatching value for required object attribute 'Tag_PAuth_Schema' in subsection 'aeabi_pauthabi': 0xbeef
+#error: \n[^\n]*ba-aarch64-1-required-subsection-1\.o: info: conflicting value '0x1' lives here\Z
--- /dev/null
+# name: EABI build attributes: subsections have different properties from the expected ones
+# source: ba-aarch64-1-required-subsection-1.s
+# source: ba-aarch64-1-required-subsection-mismatch-2.s
+# source: ba-aarch64-1-required-subsection-2.s
+# as:
+# ld: -shared
+#error: \A[^\n]*ba-aarch64-1-required-subsection-mismatch-2\.o: error: <comprehension> property of subsection 'aeabi_feature_and_bits' was incorrectly set. Got 'required', expected 'optional'
+#error: \n[^\n]*ba-aarch64-1-required-subsection-mismatch-2\.o: error: <encoding> property of subsection 'aeabi_pauthabi' was incorrectly set\. Got 'NTBS', expected 'ULEB128'
+#error: \n[^\n]*ba-aarch64-1-required-subsection-mismatch-2\.o: error: <comprehension> property of subsection 'aeabi_pauthabi' was incorrectly set\. Got 'optional', expected 'required'\Z
--- /dev/null
+# name: EABI build attributes: combine matching aeabi_pauthabi subsections, and (platform=0x0, schema=0x1) is accepted.
+# source: ba-aarch64-1-required-subsection-1.s
+# source: ba-aarch64-1-required-subsection-2.s
+# as:
+# ld: -shared
+# readelf: --arch-specific
+
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+33
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+
+ - Name:[ ]+aeabi_pauthabi
+ Scope:[ ]+public
+ Length:[ ]+25
+ Comprehension:[ ]+required
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_PAuth_Platform:[ ]+0 .*
+ +Tag_PAuth_Schema:[ ]+1 .*
--- /dev/null
+# name: EABI build attributes: combine matching aeabi_pauthabi subsections, and (platform=0x0, schema=0x0) is accepted.
+# source: ba-aarch64-1-required-subsection-3.s
+# source: ba-aarch64-1-required-subsection-4.s
+# as:
+# ld: -shared
+# readelf: --arch-specific
+
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+33
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
+ +Tag_Feature_PAC:[ ]+1 .*
+
+ - Name:[ ]+aeabi_pauthabi
+ Scope:[ ]+public
+ Length:[ ]+25
+ Comprehension:[ ]+required
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_PAuth_Platform:[ ]+0 .*
+ +Tag_PAuth_Schema:[ ]+0 .*
--- /dev/null
+# name: EABI build attributes: some files missing Tag_Feature_BTI, but -z force-bti means that the output has Tag_Feature_BTI=0x1
+# source: ba-aarch64-1-bti-1.s
+# source: ba-aarch64-1-unknown-tag.s
+# source: ba-aarch64-1-bti-via-gnu-props.s
+# source: ba-aarch64-1-bti-2.s
+# as: -defsym __property_bti__=1
+# ld: -shared -T bti-plt.ld
+#warning: \A[^\n]*ba-aarch64-1-unknown-tag\.o: warning: cannot merge unknown tag 'Tag_unknown_4' \(=0x1\) in subsection 'aeabi_feature_and_bits'\.
+# readelf: --arch-specific
+
+Subsections:
+ - Name:[ ]+aeabi_feature_and_bits
+ Scope:[ ]+public
+ Length:[ ]+35
+ Comprehension:[ ]+optional
+ Encoding:[ ]+ULEB128
+ Values:
+ +Tag_Feature_BTI:[ ]+1 .*
+ +Tag_Feature_PAC:[ ]+0 .*
+ +Tag_Feature_GCS:[ ]+0 .*
--- /dev/null
+.aeabi_subsection aeabi_feature_and_bits, optional, uleb128
+.aeabi_attribute Tag_Feature_BTI, 1
+.aeabi_attribute 4, 1
--- /dev/null
+ .text
+ .globl foo1
+ .type foo1,@function
+foo1:
+ bl foo_1
--- /dev/null
+OUTPUT_ARCH(aarch64)
+ENTRY(_start)
+SECTIONS
+{
+ PROVIDE(__executable_start = 0x8000);
+ . = SEGMENT_START("text-segment", 0x8000) + SIZEOF_HEADERS;
+ /* Start of the executable code region. */
+ .hash : { *(.hash) }
+ .gnu.hash : { *(.gnu.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ . = 0x10000;
+ .rela.dyn : { *(.rela.ifunc) }
+ .rela.plt : { *(.rela.plt) *(.rela.iplt) }
+ . = 0x18000;
+ .plt : { *(.plt) *(.iplt) }
+ . = 0x20000;
+ .text : { *(.text) }
+ /* Start of the Read Only Data region. */
+ .note.gnu.property : { *(.note.gnu.property) }
+
+ /* Start of the Read Write Data region. */
+ . = ALIGN (CONSTANT (MAXPAGESIZE));
+ .got : { *(.got) *(.got.plt) }
+ /* Start of the metadata region. */
+ .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
+}
--- /dev/null
+ .set NT_GNU_PROPERTY_TYPE_0, 5
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_AND, 0xc0000000
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_BTI, (0x1 << 0)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_PAC, (0x1 << 1)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_GCS, (0x1 << 2)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, 0x0
+.ifndef __mask_property_bti__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_BTI )
+.endif
+.ifndef __mask_property_pac__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_PAC )
+.endif
+.ifndef __mask_property_gcs__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_GCS )
+.endif
+.if GNU_PROPERTY_AARCH64_FEATURE_1_VALUE
+ .section ".note.gnu.property", "a"
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_VALUE
+4:
+ .p2align 3
+5:
+.endif
--- /dev/null
+ .set NT_GNU_PROPERTY_TYPE_0, 5
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_AND, 0xc0000000
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_BTI, (0x1 << 0)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_PAC, (0x1 << 1)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_GCS, (0x1 << 2)
+
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, 0x0
+.ifndef __mask_property_bti__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_BTI )
+.endif
+.ifndef __mask_property_pac__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_PAC )
+.endif
+.ifndef __mask_property_gcs__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_GCS )
+.endif
+
+.if GNU_PROPERTY_AARCH64_FEATURE_1_VALUE
+ .section ".note.gnu.property", "a"
+
+.ifndef __mask_property_bti__
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_BTI
+4:
+ .p2align 3
+5:
+.endif
+
+.ifndef __mask_property_pac__
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_PAC
+4:
+ .p2align 3
+5:
+.endif
+
+.ifndef __mask_property_gcs__
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_GCS
+4:
+ .p2align 3
+5:
+.endif
+
+.endif
--- /dev/null
+ .set NT_GNU_PROPERTY_TYPE_0, 5
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_AND, 0xc0000000
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_BTI, (0x1 << 0)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_PAC, (0x1 << 1)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_GCS, (0x1 << 2)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, 0x0
+.ifdef __property_bti__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_BTI )
+.endif
+.ifdef __property_pac__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_PAC )
+.endif
+.ifdef __property_gcs__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_GCS )
+.endif
+.if GNU_PROPERTY_AARCH64_FEATURE_1_VALUE
+ .section ".note.gnu.property", "a"
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_VALUE
+4:
+ .p2align 3
+5:
+.endif
--- /dev/null
+ .set NT_GNU_PROPERTY_TYPE_0, 5
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_AND, 0xc0000000
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_BTI, (0x1 << 0)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_PAC, (0x1 << 1)
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_GCS, (0x1 << 2)
+
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, 0x0
+.ifndef __mask_property_bti__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_BTI )
+.endif
+.ifndef __mask_property_pac__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_PAC )
+.endif
+.ifndef __mask_property_gcs__
+ .set GNU_PROPERTY_AARCH64_FEATURE_1_VALUE, ( GNU_PROPERTY_AARCH64_FEATURE_1_VALUE | GNU_PROPERTY_AARCH64_FEATURE_1_GCS )
+.endif
+
+.if GNU_PROPERTY_AARCH64_FEATURE_1_VALUE
+ .section ".note.gnu.property", "a"
+
+.ifdef __property_bti__
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_BTI
+4:
+ .p2align 3
+5:
+.endif
+
+.ifdef __property_pac__
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_PAC
+4:
+ .p2align 3
+5:
+.endif
+
+.ifdef __property_gcs__
+ .p2align 3
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long NT_GNU_PROPERTY_TYPE_0 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+ .p2align 3
+2: .long GNU_PROPERTY_AARCH64_FEATURE_1_AND /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long GNU_PROPERTY_AARCH64_FEATURE_1_GCS
+4:
+ .p2align 3
+5:
+.endif
+
+.endif