51 lines · plain
1// REQUIRES: aarch642// RUN: rm -rf %t && split-file %s %t && cd %t3 4// RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o 1.o5// RUN: llvm-mc -triple=aarch64 -filetype=obj pauth-bti-gcs.s -o 2.o6// RUN: llvm-mc -triple=aarch64 -filetype=obj pauth-bti-pac.s -o 3.o7// RUN: ld.lld -r 1.o 2.o 3.o -o merged.o8// RUN: llvm-readelf -n merged.o | FileCheck %s --check-prefix=NOTE9 10/// This test merges three object files with AArch64 build attributes.11/// All contain identical PAuth ABI info (platform/version), which must be preserved.12/// Only BTI is common across all three in the AND feature set, so the merged output13/// must show BTI only. PAC and GCS are present in subsets and should not appear.14 15// NOTE: Displaying notes found in: .note.gnu.property16// NOTE-NEXT: Owner Data size Description17// NOTE-NEXT: GNU 0x00000028 NT_GNU_PROPERTY_TYPE_0 (property note)18// NOTE-NEXT: Properties: aarch64 feature: BTI19// NOTE-NEXT: AArch64 PAuth ABI core info: platform 0x31 (unknown), version 0x1320 21// CHECK: .note.gnu.property22// CHECK-NOT: .ARM.attributes23 24.aeabi_subsection aeabi_pauthabi, required, uleb12825.aeabi_attribute Tag_PAuth_Platform, 4926.aeabi_attribute Tag_PAuth_Schema, 1927.aeabi_subsection aeabi_feature_and_bits, optional, uleb12828.aeabi_attribute Tag_Feature_BTI, 129.aeabi_attribute Tag_Feature_PAC, 130.aeabi_attribute Tag_Feature_GCS, 131 32 33//--- pauth-bti-gcs.s34.aeabi_subsection aeabi_pauthabi, required, uleb12835.aeabi_attribute Tag_PAuth_Platform, 4936.aeabi_attribute Tag_PAuth_Schema, 1937.aeabi_subsection aeabi_feature_and_bits, optional, uleb12838.aeabi_attribute Tag_Feature_BTI, 139.aeabi_attribute Tag_Feature_PAC, 040.aeabi_attribute Tag_Feature_GCS, 141 42 43//--- pauth-bti-pac.s44.aeabi_subsection aeabi_pauthabi, required, uleb12845.aeabi_attribute Tag_PAuth_Platform, 4946.aeabi_attribute Tag_PAuth_Schema, 1947.aeabi_subsection aeabi_feature_and_bits, optional, uleb12848.aeabi_attribute Tag_Feature_BTI, 149.aeabi_attribute Tag_Feature_PAC, 150.aeabi_attribute Tag_Feature_GCS, 051