[lld] [llvm] [lld][AArch64][Build Attributes] Add support for AArch64 Build Attributes (PR #144082)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 18 07:57:44 PDT 2025
================
@@ -0,0 +1,50 @@
+// REQUIRES: aarch64
+// RUN: llvm-mc -triple=aarch64_be %s -filetype=obj -o %t.o
+// RUN: ld.lld %t.o --shared -o %t.so
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+
+/// The Build attributes section appearing in the output of
+/// llvm-mc should not appear in the output of lld, because
+/// AArch64 build attributes are being transformed into .gnu.properties.
+
+/// Test mc -> big endian, lld -> little endian
+// RUN: llvm-mc -triple=aarch64_be %s -filetype=obj -o %t.o
+// RUN: ld.lld %t.o --shared -o %t.so
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+// RUN: ld.lld %t.o -o %t
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+// RUN: ld.lld -r %t.o -o %t2.o
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+
+/// Test mc -> little endian, lld -> big endian
+// RUN: llvm-mc -triple=aarch64 %s -filetype=obj -o %t.o
+// RUN: ld.lld --EB %t.o --shared -o %t.so
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+// RUN: ld.lld --EB %t.o -o %t
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+// RUN: ld.lld --EB -r %t.o -o %t2.o
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+
+/// Test mc -> big endian, lld -> big endian
+// RUN: llvm-mc -triple=aarch64_be %s -filetype=obj -o %t.o
+// RUN: ld.lld --EB %t.o --shared -o %t.so
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+// RUN: ld.lld --EB %t.o -o %t
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+// RUN: ld.lld --EB -r %t.o -o %t2.o
+// RUN: llvm-readelf -n %t.so | FileCheck %s --check-prefix=NOTE
+
+// NOTE: Displaying notes found in: .note.gnu.property
----------------
smithp35 wrote:
When support for relocatable links is added we could add a test to check the output build attributes.
https://github.com/llvm/llvm-project/pull/144082
More information about the llvm-commits
mailing list