50 lines · plain
1# RUN: rm -rf %t && mkdir -p %t2# RUN: llvm-mc -triple=i386-apple-macosx10.4 -filetype=obj -o %t/test_i386.o %s3# RUN: llvm-rtdyld -triple=i386-apple-macosx10.4 -verify -check=%s %t/test_i386.o4 5// Put the section used in the test at a non zero address.6 .long 47 8 .section __TEXT,__text2,regular,pure_instructions9 .globl bar10 .align 4, 0x9011bar:12 calll tmp0$pb13tmp0$pb:14 popl %eax15# Test section difference relocation to non-lazy ptr section.16# rtdyld-check: decode_operand(inst1, 4) = x$non_lazy_ptr - tmp0$pb + 817inst1:18 movl (x$non_lazy_ptr-tmp0$pb)+8(%eax), %eax19 movl (%eax), %ebx20 21# Test VANILLA relocation to jump table.22# rtdyld-check: decode_operand(inst2, 0) = bling$stub - next_pc(inst2)23inst2:24 calll bling$stub25 addl %ebx, %eax26 27# Test scattered VANILLA relocations.28inst3:29 movl y+4, %ecx30 addl %ecx, %eax31 retl32 33 .section __IMPORT,__jump_table,symbol_stubs,pure_instructions+self_modifying_code,534bling$stub:35 .indirect_symbol bling36 .ascii "\364\364\364\364\364"37 38 .section __IMPORT,__pointers,non_lazy_symbol_pointers39x$non_lazy_ptr:40 .indirect_symbol x41 .long 042 43 .comm x,4,244 .comm bling,4,245 46 .globl y47.zerofill __DATA,__common,y,8,348 49.subsections_via_symbols50