diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-29 20:42:03 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-29 20:42:03 +0000 |
commit | ef72107a490b26b59a0edd78c971b4ccdbcc7967 (patch) | |
tree | 6638bb5923a1254e5834e0a077504161928ecb8c /llvm/test/ExecutionEngine | |
parent | ed9abbea865c6a790733792da6b00f4ea7c66a5b (diff) | |
download | bcm5719-llvm-ef72107a490b26b59a0edd78c971b4ccdbcc7967.tar.gz bcm5719-llvm-ef72107a490b26b59a0edd78c971b4ccdbcc7967.zip |
ExecutionEngine: fix a bug in the movt/movw relocator
According to the arm arm specifications, 4 bytes are needed for a shift instead
of 8, this was causing the movt instruction to write to a different register
sometimes.
Patch by Walter Erquinigo!
llvm-svn: 280005
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r-- | llvm/test/ExecutionEngine/RuntimeDyld/ARM/COFF_Thumb.s | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/ARM/COFF_Thumb.s b/llvm/test/ExecutionEngine/RuntimeDyld/ARM/COFF_Thumb.s index 2a128124d0d..14e74cb39ac 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/ARM/COFF_Thumb.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/ARM/COFF_Thumb.s @@ -1,5 +1,5 @@ // RUN: llvm-mc -triple thumbv7-windows-itanium -filetype obj -o %t.obj %s -// RUN: llvm-rtdyld -triple thumbv7-windows -dummy-extern OutputDebugStringA=0x78563412 -dummy-extern ExitProcess=0x54769890 -dummy-extern unnamed_addr=0x00001024 -verify -check %s %t.obj +// RUN: llvm-rtdyld -triple thumbv7-windows -dummy-extern OutputDebugStringW=0x01310060 -dummy-extern OutputDebugStringA=0x78563412 -dummy-extern ExitProcess=0x54769890 -dummy-extern unnamed_addr=0x00001024 -verify -check %s %t.obj .text .syntax unified @@ -104,4 +104,20 @@ rel10: rel11: .secrel32 relocations @ IMAGE_REL_ARM_SECREL # rtdyld-check: *{4}rel11 = relocations - section_addr(COFF_Thumb.s.tmp.obj, .data) +rel12: @ IMAGE_REL_ARM_MOV32T + movw r0, :lower16:__imp_OutputDebugStringW +# rtdyld-check: decode_operand(rel12, 1) = (__imp_OutputDebugStringW&0x0000ffff) + movt r0, :upper16:__imp_OutputDebugStringW +# TODO rtdyld-check: decode_operand(rel12, 1) = (__imp_OutputDebugStringW&0xffff0000>>16) + bx r0 + trap + .data + + .p2align 2 +__imp_OutputDebugStringW: +@ rel13: + .long OutputDebugStringW @ IMAGE_REL_ARM_ADDR32 +# rtdyld-check: *{4}__imp_OutputDebugStringW = 0x01310060 + + .p2align 2 |