Skip to content

Commit 7d3bd2e

Browse files
committed
[MC][COFF][AArch64] Treat ARM64EC/X as ARM64 for relocations
Since ARM64EC/X objects use regular ARM64 relocations, any special handling must be done for them too.
1 parent de0abc0 commit 7d3bd2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/MC/WinCOFFObjectWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ WinCOFFWriter::WinCOFFWriter(WinCOFFObjectWriter &OWriter,
266266
// limited range for the immediate offset (+/- 1 MB); create extra offset
267267
// label symbols with regular intervals to allow referencing a
268268
// non-temporary symbol that is close enough.
269-
UseOffsetLabels = Header.Machine == COFF::IMAGE_FILE_MACHINE_ARM64;
269+
UseOffsetLabels = COFF::isAnyArm64(Header.Machine);
270270
}
271271

272272
COFFSymbol *WinCOFFWriter::createSymbol(StringRef Name) {
@@ -954,7 +954,7 @@ void WinCOFFWriter::recordRelocation(MCAssembler &Asm,
954954
Reloc.Data.Type == COFF::IMAGE_REL_I386_REL32) ||
955955
(Header.Machine == COFF::IMAGE_FILE_MACHINE_ARMNT &&
956956
Reloc.Data.Type == COFF::IMAGE_REL_ARM_REL32) ||
957-
(Header.Machine == COFF::IMAGE_FILE_MACHINE_ARM64 &&
957+
(COFF::isAnyArm64(Header.Machine) &&
958958
Reloc.Data.Type == COFF::IMAGE_REL_ARM64_REL32))
959959
FixedValue += 4;
960960

0 commit comments

Comments
 (0)