[lld] [LLD][COFF] Prevent to emit relocations for discarded weak wrapped symbols (PR #156214)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 05:10:21 PDT 2025
================
@@ -0,0 +1,16 @@
+; REQUIRES: x86
+
+; Check that 'weak' attribute will be inherited to the wrapped symbols.
+
+; RUN: llc %s -mtriple x86_64-mingw -o %t.o --filetype=obj
+; RUN: ld.lld -m i386pep -shared -o %t.dll %t.o --entry= --wrap fn
+
+declare extern_weak dso_local void @__real_fn() nounwind
+declare dso_local void @fn() nounwind
+declare dso_local void @__wrap_fn() nounwind
----------------
mstorsjo wrote:
Is `__wrap_fn` also treated as weak, as `__real_fn` is weak, or what's the relation here? Wouldn't we otherwise have undefined references as the reference to `fn` gets redirected to `__wrap_fn`?
https://github.com/llvm/llvm-project/pull/156214
More information about the llvm-commits
mailing list