From 7aff91cded9d5c342302a9bfe12f79a740ca2370 Mon Sep 17 00:00:00 2001 From: Yaroslav Yamshchikov Date: Sat, 1 Feb 2020 01:57:09 +0300 Subject: [PATCH] crossgen2 ARM support misc (#21109) --- .../Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs | 9 +++++++++ .../ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs index 879d69e..b624439 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs @@ -104,6 +104,11 @@ namespace ILCompiler /// private const int DomainLocalModuleNormalDynamicEntryOffsetOfDataBlobArm64 = 8; + /// + /// CoreCLR DomainLocalModule::NormalDynamicEntry::OffsetOfDataBlob for Arm + /// + private const int DomainLocalModuleNormalDynamicEntryOffsetOfDataBlobArm = 4; + protected override bool CompareKeyToValue(EcmaModule key, ModuleFieldLayout value) { return key == value.Module; @@ -398,6 +403,10 @@ namespace ILCompiler nonGcOffset = DomainLocalModuleNormalDynamicEntryOffsetOfDataBlobArm64; break; + case TargetArchitecture.ARM: + nonGcOffset = DomainLocalModuleNormalDynamicEntryOffsetOfDataBlobArm; + break; + default: throw new NotImplementedException(); } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs index 201d6f7..5c3fce2 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs @@ -42,6 +42,9 @@ namespace ILCompiler.PEWriter case Internal.TypeSystem.TargetArchitecture.ARM64: return Machine.Arm64; + case Internal.TypeSystem.TargetArchitecture.ARM: + return Machine.ArmThumb2; + default: throw new NotImplementedException(target.Architecture.ToString()); } -- 2.7.4