<Compile Include="..\..\Common\JitInterface\CorInfoTypes.VarInfo.cs" Link="JitInterface\CorInfoTypes.VarInfo.cs" />
<Compile Include="..\..\Common\JitInterface\SystemVStructClassificator.cs" Link="JitInterface\SystemVStructClassificator.cs" />
<Compile Include="..\..\Common\TypeSystem\Interop\InteropTypes.cs" Link="Interop\InteropTypes.cs" />
+ <Compile Include="..\ILCompiler.Reflection.ReadyToRun\PEReaderExtensions.cs" Link="Reflection\PEReaderExtensions.cs" />
<Compile Include="Compiler\AssemblyExtensions.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\DeferredTillPhaseNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\ManifestAssemblyMvidHeaderNode.cs" />
{
return PEExportTable.Parse(reader);
}
+
+ /// <summary>
+ /// Check whether the file is a ReadyToRun image and returns the RVA of its ReadyToRun header if positive.
+ /// </summary>
+ /// <param name="reader">PEReader representing the executable to check for the presence of ReadyToRun header</param>
+ /// <param name="rva">RVA of the ReadyToRun header if available, 0 when not</param>
+ /// <returns>true when the PEReader represents a ReadyToRun image, false otherwise</returns>
+ public static bool TryGetReadyToRunHeader(this PEReader reader, out int rva)
+ {
+ return reader.GetExportTable().TryGetValue("RTR_HEADER", out rva);
+ }
}
}
if ((peReader.PEHeaders.CorHeader.Flags & CorFlags.ILLibrary) == 0)
{
- return TryLocateNativeReadyToRunHeader(peReader, out _);
+ return peReader.TryGetReadyToRunHeader(out _);
}
else
{
return customMethods;
}
- private static bool TryLocateNativeReadyToRunHeader(PEReader reader, out int readyToRunHeaderRVA)
- {
- PEExportTable exportTable = reader.GetExportTable();
-
- return exportTable.TryGetValue("RTR_HEADER", out readyToRunHeaderRVA);
- }
-
private bool TryLocateNativeReadyToRunHeader()
{
- _composite = TryLocateNativeReadyToRunHeader(CompositeReader, out _readyToRunHeaderRVA);
+ _composite = CompositeReader.TryGetReadyToRunHeader(out _readyToRunHeaderRVA);
return _composite;
}
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29123.88
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31612.314
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "crossgen2", "crossgen2\crossgen2.csproj", "{9B928D3E-06AB-45E5-BF79-F374F0AE3B98}"
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.Diagnostics", "ILCompiler.Diagnostics\ILCompiler.Diagnostics.csproj", "{3EACD929-4725-4173-A845-734936BBDF87}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILCompiler.Reflection.ReadyToRun", "ILCompiler.Reflection.ReadyToRun\ILCompiler.Reflection.ReadyToRun.csproj", "{0BB34BA1-1B3A-445C-9C04-0D710D1983F0}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Checked|Any CPU = Checked|Any CPU
{3EACD929-4725-4173-A845-734936BBDF87}.Release|x64.Build.0 = Release|Any CPU
{3EACD929-4725-4173-A845-734936BBDF87}.Release|x86.ActiveCfg = Release|Any CPU
{3EACD929-4725-4173-A845-734936BBDF87}.Release|x86.Build.0 = Release|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Checked|x64.ActiveCfg = Debug|x64
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Checked|x64.Build.0 = Debug|x64
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Checked|x86.Build.0 = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Debug|x64.ActiveCfg = Debug|x64
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Debug|x64.Build.0 = Debug|x64
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Debug|x86.Build.0 = Debug|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Release|x64.ActiveCfg = Release|x64
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Release|x64.Build.0 = Release|x64
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Release|x86.ActiveCfg = Release|Any CPU
+ {0BB34BA1-1B3A-445C-9C04-0D710D1983F0}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
using Internal.TypeSystem;
using Internal.TypeSystem.Ecma;
+using ILCompiler.Reflection.ReadyToRun;
+
namespace ILCompiler
{
internal class Program
try
{
var module = _typeSystemContext.GetModuleFromPath(inputFile.Value);
+ if ((module.PEReader.PEHeaders.CorHeader.Flags & (CorFlags.ILLibrary | CorFlags.ILOnly)) == (CorFlags)0
+ && module.PEReader.TryGetReadyToRunHeader(out int _))
+ {
+ Console.WriteLine(SR.IgnoringCompositeImage, inputFile.Value);
+ continue;
+ }
_allInputFilePaths.Add(inputFile.Key, inputFile.Value);
inputFilePaths.Add(inputFile.Key, inputFile.Value);
_referenceableModules.Add(module);
<data name="ManagedCppNotSupported" xml:space="preserve">
<value>Error: managed C++ is not supported: '{0}'</value>
</data>
+ <data name="IgnoringCompositeImage" xml:space="preserve">
+ <value>Ignoring composite native image: '{0}'</value>
+ </data>
<data name="VerifyTypeAndFieldLayoutOption" xml:space="preserve">
<value>Verify that struct type layout and field offsets match between compile time and runtime. Use only for diagnostic purposes.</value>
</data>