[llvm] [TargetLowering][COFF] Allow GlobalAlias in lowerRelativeReference (PR #220674)
Andy Lim via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 12:05:06 PDT 2026
================
@@ -9,3 +9,10 @@ declare void @f()
; X64: .quad f at IMGREL
@fp = global i64 sub nsw (i64 ptrtoint (ptr @f to i64), i64 ptrtoint (ptr @__ImageBase to i64)), align 8
+
+ at target = internal global i32 42
+ at alias = hidden alias i32, ptr @target
+
+; X64: .quad alias at IMGREL
----------------
andysjlim wrote:
I'm not super familiar with the codebase and asked AI for assistance here. I have converted the test cases to 32-bit RVAs (.long) and added an llvm-readobj -r check to verify that `IMAGE_REL_AMD64_ADDR32NB` is emitted in the object file. I also added test cases for function aliases and addends. Hope this makes more sense in producing working Windows image-relative relocations.
https://github.com/llvm/llvm-project/pull/220674
More information about the llvm-commits
mailing list