[lld] [lld:MachO] Allow independent override of weak symbols aliased via .set (PR #167825)
Jez Ng via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 20 19:06:06 PST 2025
================
@@ -0,0 +1,97 @@
+# REQUIRES: x86
+# RUN: rm -rf %t; split-file %s %t
+# RUN: mkdir -p %t/bin
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/weak.o %t/weak.s
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/strong_a.o %t/strong_a.s
+# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/strong_b.o %t/strong_b.s
+
+# --- Test Case 1: No overrides
+# RUN: %lld %t/weak.o -o %t/bin/alone -e _s
+# RUN: llvm-nm -am %t/bin/alone | FileCheck --check-prefix=NM_ALONE %s
+
+# NM_ALONE: [[P_ADDR:[0-9a-f]+]] (__TEXT,__const) weak external _placeholder_int
----------------
int3 wrote:
since these are numbers, we can use the numeric substitutions instead. the other test files follow this pattern
```suggestion
# NM_ALONE: [[#%x,P_ADDR:]] (__TEXT,__const) weak external _placeholder_int
```
https://github.com/llvm/llvm-project/pull/167825
More information about the llvm-commits
mailing list