diff options
| author | Lang Hames <lhames@gmail.com> | 2019-04-12 18:07:28 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2019-04-12 18:07:28 +0000 |
| commit | c7c1f21525f88d8efd13a01ece50504d10d012fa (patch) | |
| tree | 473ddd29ee4bcf989024e40101cd1775a1769f73 /llvm/test/ExecutionEngine | |
| parent | e4d6ac5d19401fdd34642df5c015b4ab07f6beb0 (diff) | |
| download | bcm5719-llvm-c7c1f21525f88d8efd13a01ece50504d10d012fa.tar.gz bcm5719-llvm-c7c1f21525f88d8efd13a01ece50504d10d012fa.zip | |
Simplify decoupling between RuntimeDyld/RuntimeDyldChecker, add 'got_addr' util.
This patch reduces the number of functions in the interface between RuntimeDyld
and RuntimeDyldChecker by combining "GetXAddress" and "GetXContent" functions
into "GetXInfo" functions that return a struct describing both the address and
content. The GetStubOffset function is also replaced with a pair of utilities,
GetStubInfo and GetGOTInfo, that fit the new scheme. For RuntimeDyld both of
these functions will return the same result, but for the new JITLink linker
(https://reviews.llvm.org/D58704) these will provide the addresses of PLT stubs
and GOT entries respectively.
For JITLink's use, a 'got_addr' utility has been added to the rtdyld-check
language, and the syntax of 'got_addr' and 'stub_addr' has been changed: both
functions now take two arguments, a 'stub container name' and a target symbol
name. For llvm-rtdyld/RuntimeDyld the stub container name is the object file
name and section name, separated by a slash. E.g.:
rtdyld-check: *{8}(stub_addr(foo.o/__text, y)) = y
For the upcoming llvm-jitlink utility, which creates stubs on a per-file basis
rather than a per-section basis, the container name is just the file name. E.g.:
jitlink-check: *{8}(got_addr(foo.o, y)) = y
llvm-svn: 358295
Diffstat (limited to 'llvm/test/ExecutionEngine')
8 files changed, 25 insertions, 25 deletions
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s index e9f915ece26..ba823fb2d44 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s @@ -51,9 +51,9 @@ ldr1: # adrp instruction and the GOT entry for ptr. ldr encodes the offset of the GOT # entry within the page. The ldr instruction perfroms an implicit shift on the # encoded immediate (imm<<3). -# rtdyld-check: *{8}(stub_addr(foo.o, __text, _ptr)) = _ptr -# rtdyld-check: decode_operand(adrp2, 1) = (stub_addr(foo.o, __text, _ptr)[32:12] - adrp2[32:12]) -# rtdyld-check: decode_operand(ldr2, 2) = stub_addr(foo.o, __text, _ptr)[11:3] +# rtdyld-check: *{8}(stub_addr(foo.o/__text, _ptr)) = _ptr +# rtdyld-check: decode_operand(adrp2, 1) = (stub_addr(foo.o/__text, _ptr)[32:12] - adrp2[32:12]) +# rtdyld-check: decode_operand(ldr2, 2) = stub_addr(foo.o/__text, _ptr)[11:3] .globl _test_adrp_ldr .align 2 _test_got_adrp_ldr: @@ -92,12 +92,12 @@ _subtractor_result: .quad _test_branch_reloc - _foo # Test 32-bit relative ARM64_RELOC_POINTER_TO_GOT -# rtdyld-check: *{4}_pointer_to_got_32_rel = (stub_addr(foo.o, __data, _dummy1) - _pointer_to_got_32_rel) +# rtdyld-check: *{4}_pointer_to_got_32_rel = (stub_addr(foo.o/__data, _dummy1) - _pointer_to_got_32_rel) _pointer_to_got_32_rel: .long _dummy1@got - . # Test 64-bit absolute ARM64_RELOC_POINTER_TO_GOT -# rtdyld-check: *{8}_pointer_to_got_64_abs = stub_addr(foo.o, __data, _dummy1) +# rtdyld-check: *{8}_pointer_to_got_64_abs = stub_addr(foo.o/__data, _dummy1) _pointer_to_got_64_abs: .quad _dummy1@got 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 d3fa5fbed80..d826b37b6b0 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s @@ -22,15 +22,15 @@ nextPC: # 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: *{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) +# rtdyld-check: decode_operand(insn3, 0) = stub_addr(foo.o/__text, baz) - (insn3 + 8) insn3: bl baz # Check stub generation for internal symbols by referencing 'bar'. -# rtdyld-check: *{4}(stub_addr(foo.o, __text, bar) + 4) = bar +# rtdyld-check: *{4}(stub_addr(foo.o/__text, bar) + 4) = bar insn4: bl bar bx lr diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_Thumb_Relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_Thumb_Relocations.s index e2e6e11e7d9..4931b4165f8 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_Thumb_Relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_Thumb_Relocations.s @@ -35,14 +35,14 @@ thumb_caller: # Check that stubs for thumb callers use thumb code (not arm), and that thumb # callees have the low bit set on their addresses. # -# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, thumb_caller_thumb_callee)) = 0xf000f8df -# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, thumb_caller_thumb_callee) + 4) = (thumb_caller_thumb_callee | 0x1) +# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee)) = 0xf000f8df +# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_thumb_callee) + 4) = (thumb_caller_thumb_callee | 0x1) bl thumb_caller_thumb_callee # Check that arm callees do not have the low bit set on their addresses. # -# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, thumb_caller_arm_callee)) = 0xf000f8df -# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, thumb_caller_arm_callee) + 4) = thumb_caller_arm_callee +# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee)) = 0xf000f8df +# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, thumb_caller_arm_callee) + 4) = thumb_caller_arm_callee bl thumb_caller_arm_callee .globl arm_caller @@ -53,8 +53,8 @@ arm_caller: # Check that stubs for arm callers use arm code (not thumb), and that thumb # callees have the low bit set on their addresses. -# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, arm_caller_thumb_callee)) = 0xe51ff004 -# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o, __text, arm_caller_thumb_callee) + 4) = (arm_caller_thumb_callee | 0x1) +# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee)) = 0xe51ff004 +# rtdyld-check: *{4}(stub_addr(MachO_Thumb.o/__text, arm_caller_thumb_callee) + 4) = (arm_caller_thumb_callee | 0x1) bl arm_caller_thumb_callee nop diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s index fc2a277c3d2..18e686706db 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s @@ -44,7 +44,7 @@ bar: sd $4, 8($fp) # Test R_MIPS_26 relocation. -# rtdyld-check: decode_operand(insn1, 0)[27:0] = stub_addr(test_ELF_Mips64N64.o, .text, foo)[27:0] +# rtdyld-check: decode_operand(insn1, 0)[27:0] = stub_addr(test_ELF_Mips64N64.o/.text, foo)[27:0] insn1: .option pic0 jal foo diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s index 942979d645c..46e764477ba 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s @@ -44,7 +44,7 @@ bar: sd $4, 8($fp) # Test R_MIPS_26 relocation. -# rtdyld-check: decode_operand(insn1, 0)[27:0] = stub_addr(test_ELF_N32.o, .text, foo)[27:0] +# rtdyld-check: decode_operand(insn1, 0)[27:0] = stub_addr(test_ELF_N32.o/.text, foo)[27:0] insn1: .option pic0 jal foo diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s index 2a8ddff43dd..40002d44a10 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s @@ -34,7 +34,7 @@ tmp1: .globl bar .type bar,@function bar: -# rtdyld-check: decode_operand(R_MIPS_26, 0)[27:0] = stub_addr(test_ELF_O32.o, .text, foo)[27:0] +# rtdyld-check: decode_operand(R_MIPS_26, 0)[27:0] = stub_addr(test_ELF_O32.o/.text, foo)[27:0] # rtdyld-check: decode_operand(R_MIPS_26, 0)[1:0] = 0 R_MIPS_26: j foo diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s b/llvm/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s index b43c84caf56..852e75bb0ee 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/PowerPC/ppc64_elf.s @@ -25,11 +25,11 @@ bar: stdu 1, -32(1) .cfi_def_cfa_offset 32 .cfi_offset lr, 16 -# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 0)) [15:0] = foo_gep [63:48] -# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 4)) [15:0] = foo_gep [47:32] -# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 12)) [15:0] = foo_gep [31:16] -# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o, .text, foo) + 16)) [15:0] = foo_gep [15:0] -# rtdyld-check: decode_operand(foo_call, 0) = (stub_addr(ppc64_elf.o, .text, foo) - foo_call) >> 2 +# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o/.text, foo) + 0)) [15:0] = foo_gep [63:48] +# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o/.text, foo) + 4)) [15:0] = foo_gep [47:32] +# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o/.text, foo) + 12)) [15:0] = foo_gep [31:16] +# rtdyld-check: (*{4}(stub_addr(ppc64_elf.o/.text, foo) + 16)) [15:0] = foo_gep [15:0] +# rtdyld-check: decode_operand(foo_call, 0) = (stub_addr(ppc64_elf.o/.text, foo) - foo_call) >> 2 foo_call: bl foo nop diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s index f5539fcb367..dc69a150725 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s @@ -24,8 +24,8 @@ insn2: # Test PC-rel GOT relocation. # Verify both the contents of the GOT entry for y, and that the movq instruction # references the correct GOT entry address: -# rtdyld-check: *{8}(stub_addr(test_x86-64.o, __text, y)) = y -# rtdyld-check: decode_operand(insn3, 4) = stub_addr(test_x86-64.o, __text, y) - next_pc(insn3) +# rtdyld-check: *{8}(stub_addr(test_x86-64.o/__text, y)) = y +# rtdyld-check: decode_operand(insn3, 4) = stub_addr(test_x86-64.o/__text, y) - next_pc(insn3) insn3: movq y@GOTPCREL(%rip), %rax |

