diff options
| author | Lang Hames <lhames@gmail.com> | 2014-07-30 03:35:05 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2014-07-30 03:35:05 +0000 |
| commit | 1316365e2cee88687b503d3818987a5fed147463 (patch) | |
| tree | 21fd3153e620b2a893bc138cc21133249f50ff80 /llvm/test/ExecutionEngine/RuntimeDyld/ARM | |
| parent | 005214ce50dd62936cf5834d46a2dd257a7f0b3d (diff) | |
| download | bcm5719-llvm-1316365e2cee88687b503d3818987a5fed147463.tar.gz bcm5719-llvm-1316365e2cee88687b503d3818987a5fed147463.zip | |
[MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.
We now (1) correctly decode the branch immediate, (2) modify the immediate to
corretly treat it as PC-rel, and (3) properly populate the stub entry.
Previously we had been doing each of these wrong.
<rdar://problem/17750739>
llvm-svn: 214285
Diffstat (limited to 'llvm/test/ExecutionEngine/RuntimeDyld/ARM')
| -rw-r--r-- | llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s index 86041835591..d0d30271f0d 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s @@ -1,6 +1,5 @@ -# RUN: llvm-mc -triple=armv7s-apple-ios7.0.0 -relocation-model=pic -filetype=obj -o %t.o %s -# RUN: llvm-rtdyld -triple=armv7s-apple-ios7.0.0 -verify -check=%s %t.o -# RUN: rm %t.o +# RUN: llvm-mc -triple=armv7s-apple-ios7.0.0 -relocation-model=pic -filetype=obj -o %T/foo.o %s +# RUN: llvm-rtdyld -triple=armv7s-apple-ios7.0.0 -verify -check=%s %/T/foo.o .syntax unified .section __TEXT,__text,regular,pure_instructions @@ -17,6 +16,17 @@ insn2: movt r0, :upper16:(foo-(nextPC+8)) nextPC: add r0, pc, r0 + +# Check stub generation by referencing a common symbol, 'baz'. Check both the +# Content of the stub, and the reference to the stub. +# Stub should contain '0xe51ff004' (ldr pc, [pc, #-4]), followed by the target. +# +# rtdyld-check: *{4}(stub_addr(foo.o, __text, baz)) = 0xe51ff004 +# rtdyld-check: *{4}(stub_addr(foo.o, __text, baz) + 4) = baz +# +# rtdyld-check: decode_operand(insn3, 0) = stub_addr(foo.o, __text, baz) - (insn3 + 8) +insn3: + bl baz bx lr .globl foo @@ -24,4 +34,6 @@ nextPC: foo: bx lr + .comm baz, 4, 2 + .subsections_via_symbols |

