for (int i = 0; i < RuntimeFunctionCount; i++)
{
int startRva = NativeReader.ReadInt32(_readyToRunReader.Image, ref curOffset);
+ if (_readyToRunReader.Machine == Machine.ArmThumb2)
+ {
+ // The low bit of this address is set since the function contains thumb code.
+ // Clear this bit in order to get the "real" RVA of the start of the function.
+ startRva = (int)(startRva & ~1);
+ }
int endRva = -1;
if (_readyToRunReader.Machine == Machine.Amd64)
{
return null;
}
- private static bool InputArchitectureSupported(Machine machine)
- {
- return machine != Machine.ArmThumb2; // CoreDisTools often fails to decode when disassembling ARM images (see https://github.com/dotnet/runtime/issues/10959)
- }
-
// TODO: Fix R2RDump issue where an R2R image cannot be dissassembled with the x86 CoreDisTools
// For the short term, we want to error out with a decent message explaining the unexpected error
// Issue https://github.com/dotnet/runtime/issues/10928
if (_options.Disasm)
{
- if (InputArchitectureSupported(r2r.Machine) && DisassemblerArchitectureSupported())
+ if (DisassemblerArchitectureSupported())
{
disassembler = new Disassembler(r2r, _options);
}