[llvm] [MC][COFF][AArch64] Treat ARM64EC/X as ARM64 for relocations (PR #86019)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 20 15:05:37 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mc
Author: Billy Laws (bylaws)
<details>
<summary>Changes</summary>
Since ARM64EC/X objects use regular ARM64 relocations, any special handling must be done for them too.
---
Full diff: https://github.com/llvm/llvm-project/pull/86019.diff
1 Files Affected:
- (modified) llvm/lib/MC/WinCOFFObjectWriter.cpp (+2-2)
``````````diff
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index f265fafa59e744..3c9ff71b6b0622 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -266,7 +266,7 @@ WinCOFFWriter::WinCOFFWriter(WinCOFFObjectWriter &OWriter,
// limited range for the immediate offset (+/- 1 MB); create extra offset
// label symbols with regular intervals to allow referencing a
// non-temporary symbol that is close enough.
- UseOffsetLabels = Header.Machine == COFF::IMAGE_FILE_MACHINE_ARM64;
+ UseOffsetLabels = COFF::isAnyArm64(Header.Machine);
}
COFFSymbol *WinCOFFWriter::createSymbol(StringRef Name) {
@@ -954,7 +954,7 @@ void WinCOFFWriter::recordRelocation(MCAssembler &Asm,
Reloc.Data.Type == COFF::IMAGE_REL_I386_REL32) ||
(Header.Machine == COFF::IMAGE_FILE_MACHINE_ARMNT &&
Reloc.Data.Type == COFF::IMAGE_REL_ARM_REL32) ||
- (Header.Machine == COFF::IMAGE_FILE_MACHINE_ARM64 &&
+ (COFF::isAnyArm64(Header.Machine) &&
Reloc.Data.Type == COFF::IMAGE_REL_ARM64_REL32))
FixedValue += 4;
``````````
</details>
https://github.com/llvm/llvm-project/pull/86019
More information about the llvm-commits
mailing list