File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
lib/ExecutionEngine/RuntimeDyld
test/ExecutionEngine/JITLink/AArch32 Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -369,7 +369,19 @@ class RuntimeDyldCheckerExprEval {
369
369
uint64_t SymbolAddr = PCtx.IsInsideLoad
370
370
? Checker.getSymbolLocalAddr (Symbol)
371
371
: Checker.getSymbolRemoteAddr (Symbol);
372
- uint64_t NextPC = SymbolAddr + InstSize;
372
+
373
+ uint64_t PCOffset = 0 ;
374
+ auto TT = Checker.getTripleForSymbol (Checker.getTargetFlag (Symbol));
375
+ switch (TT.getArch ()) {
376
+ case Triple::ArchType::arm:
377
+ // ARM mode adds an offset of 4 bytes to PC
378
+ PCOffset = 4 ;
379
+ break ;
380
+ default :
381
+ PCOffset = 0 ;
382
+ }
383
+
384
+ uint64_t NextPC = SymbolAddr + InstSize + PCOffset;
373
385
374
386
return std::make_pair (EvalResult (NextPC), RemainingExpr);
375
387
}
Original file line number Diff line number Diff line change 28
28
# CHECK-INSTR: 4: ebfffffe bl
29
29
# CHECK-INSTR: 0000000c <call_target_arm>
30
30
# CHECK-INSTR: 00000010 <call_target_thumb>
31
- # ARM branch offset is 8, because it accounts for an additional prefetch
32
- # instruction that increments PC even though it is implicit
33
- # jitlink-check: decode_operand(call_site + 0, 0) = call_target_arm - (call_site + 8)
31
+ # jitlink-check: decode_operand(call_site + 0, 0) = call_target_arm - next_pc(call_site)
34
32
# jitlink-check: decode_operand(call_site + 4, 0) = call_target_thumb - (call_site + 12)
35
33
.globl call_site
36
34
.type call_site,%function
@@ -62,7 +60,7 @@ call_target_thumb:
62
60
# CHECK-INSTR: 00000014 <jump24_site>:
63
61
# CHECK-INSTR: 14: eafffffe b
64
62
# CHECK-INSTR: 00000018 <jump24_target>
65
- # jitlink-check: decode_operand(jump24_site, 0) = jump24_target - (jump24_site + 8 )
63
+ # jitlink-check: decode_operand(jump24_site, 0) = jump24_target - next_pc (jump24_site)
66
64
.globl jump24_site
67
65
.type jump24_site,%function
68
66
.p2align 2
Original file line number Diff line number Diff line change 30
30
# CHECK-INSTR: f7ff fffe bl
31
31
# We decode the operand with index 2, because bl generates two leading implicit
32
32
# predicate operands that we have to skip in order to decode the call_target operand
33
- # jitlink-check: decode_operand(call_site, 2) = call_target_thumb - (call_site + 4 )
33
+ # jitlink-check: decode_operand(call_site, 2) = call_target_thumb - next_pc (call_site)
34
34
.globl call_site
35
35
.type call_site,%function
36
36
.p2align 1
You can’t perform that action at this time.
0 commit comments