};
/// <summary>
+ /// based on <a href="https://github.com/dotnet/coreclr/blob/master/src/inc/corcompile.h">src/inc/corcompile.h</a> CorCompileImportFlags
+ /// </summary>
+ public enum CORCOMPILE_FIXUP_BLOB_KIND
+ {
+ ENCODE_MODULE_OVERRIDE = 0x80, /* When the high bit is set, override of the module immediately follows */
+ }
+
+ /// <summary>
/// Constants for method and field encoding
/// </summary>
[Flags]
/// <param name="builder"></param>
private void ParseSignature(StringBuilder builder)
{
- uint fixupType = ReadUInt();
+ uint fixupType = ReadByte();
+ bool moduleOverride = (fixupType & (byte)CORCOMPILE_FIXUP_BLOB_KIND.ENCODE_MODULE_OVERRIDE) != 0;
+ // Check first byte for a module override being encoded
+ if (moduleOverride)
+ {
+ builder.Append("ENCODE_MODULE_OVERRIDE @ ");
+ fixupType &= ~(uint)CORCOMPILE_FIXUP_BLOB_KIND.ENCODE_MODULE_OVERRIDE;
+ uint moduleIndex = ReadUInt();
+ builder.Append(string.Format(" Index: {0:X2}", moduleIndex));
+ }
+
switch ((ReadyToRunFixupKind)fixupType)
{
case ReadyToRunFixupKind.READYTORUN_FIXUP_ThisObjDictionaryLookup:
break;
case ReadyToRunFixupKind.READYTORUN_FIXUP_MethodEntry_DefToken:
- ParseMethodDefToken(builder, owningTypeOverride: null);
+ if (!moduleOverride)
+ {
+ ParseMethodDefToken(builder, owningTypeOverride: null);
+ }
builder.Append(" (METHOD_ENTRY_DEF_TOKEN)");
break;
case ReadyToRunFixupKind.READYTORUN_FIXUP_VirtualEntry:
- ParseMethod(builder);
+ if(!moduleOverride)
+ {
+ ParseMethod(builder);
+ }
builder.Append(" (VIRTUAL_ENTRY)");
break;
case ReadyToRunFixupKind.READYTORUN_FIXUP_VirtualEntry_Slot:
{
uint slot = ReadUInt();
- ParseType(builder);
+ if (!moduleOverride)
+ {
+ ParseType(builder);
+ }
+
builder.Append($@" #{slot} (VIRTUAL_ENTRY_SLOT)");
}
break;