1 ; This tests for the basic implementation of PPCMachObjectWriter.cpp,
2 ; which is responsible for writing mach-o relocation entries for (PIC)
5 ; RUN: llvm-mc -filetype=obj -relocation-model=pic -mcpu=g4 -triple=powerpc-apple-darwin8 %s -o - | llvm-readobj -relocations | FileCheck -check-prefix=DARWIN-G4-DUMP %s
8 .section __TEXT,__textcoal_nt,coalesced,pure_instructions
9 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
10 .section __TEXT,__text,regular,pure_instructions
27 addis r2, r2, ha16(L_.str-L0$pb)
28 la r3, lo16(L_.str-L0$pb)(r2)
37 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
40 .indirect_symbol _puts
42 bcl 20, 31, L_puts$stub$tmp
45 addis r11, r11, ha16(L_puts$lazy_ptr-L_puts$stub$tmp)
47 lwzu r12, lo16(L_puts$lazy_ptr-L_puts$stub$tmp)(r11)
50 .section __DATA,__la_symbol_ptr,lazy_symbol_pointers
52 .indirect_symbol _puts
53 .long dyld_stub_binding_helper
55 .subsections_via_symbols
56 .section __TEXT,__cstring,cstring_literals
58 .asciz "Hello, world!"
60 ; DARWIN-G4-DUMP:Format: Mach-O 32-bit ppc
61 ; DARWIN-G4-DUMP:Arch: powerpc
62 ; DARWIN-G4-DUMP:AddressSize: 32bit
63 ; DARWIN-G4-DUMP:Relocations [
64 ; DARWIN-G4-DUMP: Section __text {
65 ; DARWIN-G4-DUMP: 0x34 1 2 0 PPC_RELOC_BR24 0 -
66 ; DARWIN-G4-DUMP: 0x30 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main
67 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 _main
68 ; DARWIN-G4-DUMP: 0x2C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main
69 ; DARWIN-G4-DUMP: 0x60 0 2 n/a PPC_RELOC_PAIR 1 _main
71 ; DARWIN-G4-DUMP: Section __picsymbolstub1 {
72 ; DARWIN-G4-DUMP: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main
73 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 _main
74 ; DARWIN-G4-DUMP: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main
75 ; DARWIN-G4-DUMP: 0x18 0 2 n/a PPC_RELOC_PAIR 1 _main
77 ; DARWIN-G4-DUMP: Section __la_symbol_ptr {
78 ; DARWIN-G4-DUMP: 0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper