[lld] [llvm] [lld][AArch64][Build Attributes] Add support for converting AArch64 Build Attributes to GNU Properties (PR #131990)
Oliver Stannard via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 4 02:23:10 PDT 2025
================
@@ -0,0 +1,157 @@
+### This file replace .note.gnu.property with aarch64 build attributes in order to confirm
+### interoperability.
+
+# REQUIRES: aarch64
+
+# RUN: rm -rf %t && split-file %s %t && cd %t
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu abi-tag1.s -o tag1.o
+# RUN: cp tag1.o tag1a.o
+# RUN: ld.lld -shared tag1.o tag1a.o -o tagok.so
+# RUN: llvm-readelf -n tagok.so | FileCheck --check-prefix OK %s
+
+# OK: AArch64 PAuth ABI core info: platform 0x2a (unknown), version 0x1
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu abi-tag2.s -o tag2.o
+# RUN: not ld.lld tag1.o tag1a.o tag2.o -o /dev/null 2>&1 | FileCheck --check-prefix ERR1 %s
+
+# ERR1: error: incompatible values of AArch64 PAuth core info found
+# ERR1-NEXT: >>> tag1.o: 0x2a000000000000000{{1|2}}00000000000000
+# ERR1-NEXT: >>> tag2.o: 0x2a000000000000000{{1|2}}00000000000000
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu abi-tag-short.s -o short.o
----------------
ostannard wrote:
llvm-mc has tests to check that it generates correct build attributes, but I've not seen any tests to check that the parser rejects malformed attribute sections. Those tests would probably be better written using llvm-readelf, but we should have at least one lld test to make sure that the error gets reported to the user correctly.
https://github.com/llvm/llvm-project/pull/131990
More information about the llvm-commits
mailing list