61 lines · plain
1# REQUIRES: reverse_iteration2# RUN: rm -rf %t && mkdir -p %t3# RUN: llvm-mc -triple=armv7s-apple-ios7.0.0 -filetype=obj -o %t/foo.o %s4# RUN: llvm-rtdyld -triple=armv7s-apple-ios7.0.0 -verify -check=%s %t/foo.o5 6 .syntax unified7 .section __TEXT,__text,regular,pure_instructions8 .globl bar9 .align 210bar:11# Check lower 16-bits of section difference relocation12# rtdyld-check: decode_operand(insn1, 1) = (foo$non_lazy_ptr-(nextPC+8))[15:0]13insn1:14 movw r0, :lower16:(foo$non_lazy_ptr-(nextPC+8))15# Check upper 16-bits of section difference relocation16# rtdyld-check: decode_operand(insn2, 2) = (foo$non_lazy_ptr-(nextPC+8))[31:16]17insn2:18 movt r0, :upper16:(foo$non_lazy_ptr-(nextPC+8))19nextPC:20 add r1, r0, r021 22# Check stub generation for external symbols by referencing a common symbol, 'baz'.23# Check both the content of the stub, and the reference to the stub.24# Stub should contain '0xe51ff004' (ldr pc, [pc, #-4]), followed by the target.25#26# rtdyld-check: *{4}(stub_addr(foo.o/__text, baz)) = 0xe51ff00427# rtdyld-check: *{4}(stub_addr(foo.o/__text, baz) + 4) = baz28#29# rtdyld-check: decode_operand(insn3, 0) = stub_addr(foo.o/__text, baz) - (insn3 + 8)30insn3:31 bl baz32 33# Check stub generation for internal symbols by referencing 'bar'.34# rtdyld-check: *{4}(stub_addr(foo.o/__text, bar) + 4) = bar35insn4:36 bl bar37 bx lr38 39# Add 'aaa' to the common symbols to make sure 'baz' isn't at the start of the40# section. This ensures that we test VANILLA relocation addends correctly.41 .comm aaa, 4, 242 .comm baz, 4, 243 .comm foo, 4, 244 45 .section __DATA,__data46 .globl _a47 .align 248# rtdyld-check: *{4}bar_ofs = bar + 449bar_ofs:50 .long bar + 451 52# Check that the symbol pointer section entries are fixed up properly:53# rtdyld-check: *{4}foo$non_lazy_ptr = foo54 .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers55 .align 256foo$non_lazy_ptr:57 .indirect_symbol foo58 .long 059 60.subsections_via_symbols61