using System.Collections.Generic;
using Internal.Text;
+using Internal.TypeSystem;
using Internal.ReadyToRunConstants;
namespace ILCompiler.DependencyAnalysis.ReadyToRun
{
// This needs to be an empty target pointer since it will be filled in with Module*
// when loaded by CoreCLR
+ int codeDelta = 0;
+ if (factory.Target.Architecture == TargetArchitecture.ARM)
+ {
+ // THUMB_CODE
+ codeDelta = 1;
+ }
dataBuilder.EmitReloc(_delayLoadHelper,
- factory.Target.PointerSize == 4 ? RelocType.IMAGE_REL_BASED_HIGHLOW : RelocType.IMAGE_REL_BASED_DIR64);
+ factory.Target.PointerSize == 4 ? RelocType.IMAGE_REL_BASED_HIGHLOW : RelocType.IMAGE_REL_BASED_DIR64, codeDelta);
}
public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFactory factory)
FrameInfo frameInfo = method.FrameInfos[frameIndex];
// StartOffset of the runtime function
- runtimeFunctionsBuilder.EmitReloc(method, RelocType.IMAGE_REL_BASED_ADDR32NB, delta: frameInfo.StartOffset);
+ int codeDelta = 0;
+ if (Target.Architecture == TargetArchitecture.ARM)
+ {
+ // THUMB_CODE
+ codeDelta = 1;
+ }
+ runtimeFunctionsBuilder.EmitReloc(method, RelocType.IMAGE_REL_BASED_ADDR32NB, delta: frameInfo.StartOffset + codeDelta);
if (!relocsOnly && Target.Architecture == TargetArchitecture.X64)
{
// On Amd64, the 2nd word contains the EndOffset of the runtime function