diff --git a/Cpp2IL.Core/InstructionSets/NewArmV8InstructionSet.cs b/Cpp2IL.Core/InstructionSets/NewArmV8InstructionSet.cs index 6a433217..4dd67722 100644 --- a/Cpp2IL.Core/InstructionSets/NewArmV8InstructionSet.cs +++ b/Cpp2IL.Core/InstructionSets/NewArmV8InstructionSet.cs @@ -217,7 +217,8 @@ void AddCall(MethodAnalysisContext context, object? returnRegister2, ulong addre case Arm64Mnemonic.ADRP: //Just handle as a move Add(address, OpCode.Move, ConvertOperand(instruction, 0), ConvertOperand(instruction, 1)); - adrpOffsets[instruction.Op0Reg] = (ulong)instruction.Op1Imm; + var pageAddress = address & ~0xFFFUL; + adrpOffsets[instruction.Op0Reg] = (ulong)((long)pageAddress + instruction.Op1Imm); break; case Arm64Mnemonic.LDP when instruction.Op2Kind == Arm64OperandKind.Memory: //LDP (dest1, dest2, [mem]) - basically just treat as two loads, with the second offset by the length of the first