1 RUN: llvm-readobj -r %p/Inputs/trivial.obj.coff-i386 \ 2 RUN: | FileCheck %s -check-prefix COFF 3 RUN: llvm-readobj -r %p/Inputs/trivial.obj.elf-i386 \ 4 RUN: | FileCheck %s -check-prefix ELF 5 RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-i386 \ 6 RUN: | FileCheck %s -check-prefix MACHO-I386 7 RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-x86-64 \ 8 RUN: | FileCheck %s -check-prefix MACHO-X86-64 9 RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-ppc \ 10 RUN: | FileCheck %s -check-prefix MACHO-PPC 11 RUN: llvm-readobj -r %p/Inputs/trivial.obj.macho-ppc64 \ 12 RUN: | FileCheck %s -check-prefix MACHO-PPC64 13 RUN: llvm-readobj -r -expand-relocs %p/Inputs/trivial.obj.macho-arm \ 14 RUN: | FileCheck %s -check-prefix MACHO-ARM 15 16 COFF: Relocations [ 17 COFF-NEXT: Section (1) .text { 18 COFF-NEXT: 0x4 IMAGE_REL_I386_DIR32 .data 19 COFF-NEXT: 0x9 IMAGE_REL_I386_REL32 _puts 20 COFF-NEXT: 0xE IMAGE_REL_I386_REL32 _SomeOtherFunction 21 COFF-NEXT: } 22 COFF-NEXT: ] 23 24 ELF: Relocations [ 25 ELF-NEXT: Section (2) .rel.text { 26 ELF-NEXT: 0xC R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 0x0 27 ELF-NEXT: 0x12 R_386_GOTOFF .L.str 0x0 28 ELF-NEXT: 0x1A R_386_PLT32 puts 0x0 29 ELF-NEXT: 0x1F R_386_PLT32 SomeOtherFunction 0x0 30 ELF-NEXT: } 31 ELF-NEXT: ] 32 33 MACHO-I386: Relocations [ 34 MACHO-I386-NEXT: Section __text { 35 MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction 36 MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts 37 MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 - 38 MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 - 39 MACHO-I386-NEXT: } 40 MACHO-I386-NEXT: ] 41 42 MACHO-X86-64: Relocations [ 43 MACHO-X86-64-NEXT: Section __text { 44 MACHO-X86-64-NEXT: 0xE 1 2 1 X86_64_RELOC_BRANCH 0 _SomeOtherFunction 45 MACHO-X86-64-NEXT: 0x9 1 2 1 X86_64_RELOC_BRANCH 0 _puts 46 MACHO-X86-64-NEXT: 0x4 1 2 1 X86_64_RELOC_SIGNED 0 L_.str 47 MACHO-X86-64-NEXT: } 48 MACHO-X86-64-NEXT:] 49 50 MACHO-PPC: Relocations [ 51 MACHO-PPC-NEXT: Section __text { 52 MACHO-PPC-NEXT: 0x24 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 - 53 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 - 54 MACHO-PPC-NEXT: 0x1C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 - 55 MACHO-PPC-NEXT: 0x58 0 2 n/a PPC_RELOC_PAIR 1 - 56 MACHO-PPC-NEXT: 0x18 1 2 0 PPC_RELOC_BR24 0 - 57 MACHO-PPC-NEXT: } 58 MACHO-PPC-NEXT: Section __picsymbolstub1 { 59 MACHO-PPC-NEXT: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 - 60 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 - 61 MACHO-PPC-NEXT: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 - 62 MACHO-PPC-NEXT: 0x20 0 2 n/a PPC_RELOC_PAIR 1 - 63 MACHO-PPC-NEXT: } 64 MACHO-PPC-NEXT: Section __la_symbol_ptr { 65 MACHO-PPC-NEXT: 0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper 66 MACHO-PPC-NEXT: } 67 MACHO-PPC-NEXT: ] 68 69 MACHO-PPC64: Relocations [ 70 MACHO-PPC64-NEXT: Section __text { 71 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 - 72 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 - 73 MACHO-PPC64-NEXT: 0x1C 0 2 n/a 1 - 74 MACHO-PPC64-NEXT: 0x58 0 2 n/a 1 - 75 MACHO-PPC64-NEXT: 0x18 1 2 0 0 - 76 MACHO-PPC64-NEXT: } 77 MACHO-PPC64-NEXT: Section __picsymbolstub1 { 78 MACHO-PPC64-NEXT: 0x14 0 2 n/a 1 - 79 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 - 80 MACHO-PPC64-NEXT: 0xC 0 2 n/a 1 - 81 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 - 82 MACHO-PPC64-NEXT: } 83 MACHO-PPC64-NEXT: Section __la_symbol_ptr { 84 MACHO-PPC64-NEXT: 0x0 0 3 1 0 dyld_stub_binding_helper 85 MACHO-PPC64-NEXT: } 86 MACHO-PPC64-NEXT: ] 87 88 89 MACHO-ARM: Relocations [ 90 MACHO-ARM-NEXT: Section __text { 91 MACHO-ARM-NEXT: Relocation { 92 MACHO-ARM-NEXT: Offset: 0x38 93 MACHO-ARM-NEXT: PCRel: 0 94 MACHO-ARM-NEXT: Length: 2 95 MACHO-ARM-NEXT: Extern: N/A 96 MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2) 97 MACHO-ARM-NEXT: Symbol: - 98 MACHO-ARM-NEXT: Scattered: 1 99 MACHO-ARM-NEXT: } 100 MACHO-ARM-NEXT: Relocation { 101 MACHO-ARM-NEXT: Offset: 0x0 102 MACHO-ARM-NEXT: PCRel: 0 103 MACHO-ARM-NEXT: Length: 2 104 MACHO-ARM-NEXT: Extern: N/A 105 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1) 106 MACHO-ARM-NEXT: Symbol: - 107 MACHO-ARM-NEXT: Scattered: 1 108 MACHO-ARM-NEXT: } 109 MACHO-ARM-NEXT: Relocation { 110 MACHO-ARM-NEXT: Offset: 0x20 111 MACHO-ARM-NEXT: PCRel: 1 112 MACHO-ARM-NEXT: Length: 2 113 MACHO-ARM-NEXT: Extern: 1 114 MACHO-ARM-NEXT: Type: ARM_RELOC_BR24 (5) 115 MACHO-ARM-NEXT: Symbol: _g 116 MACHO-ARM-NEXT: Scattered: 0 117 MACHO-ARM-NEXT: } 118 MACHO-ARM-NEXT: Relocation { 119 MACHO-ARM-NEXT: Offset: 0x1C 120 MACHO-ARM-NEXT: PCRel: 0 121 MACHO-ARM-NEXT: Length: 1 122 MACHO-ARM-NEXT: Extern: 1 123 MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8) 124 MACHO-ARM-NEXT: Symbol: _g 125 MACHO-ARM-NEXT: Scattered: 0 126 MACHO-ARM-NEXT: } 127 MACHO-ARM-NEXT: Relocation { 128 MACHO-ARM-NEXT: Offset: 0x0 129 MACHO-ARM-NEXT: PCRel: 0 130 MACHO-ARM-NEXT: Length: 1 131 MACHO-ARM-NEXT: Extern: 0 132 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1) 133 MACHO-ARM-NEXT: Symbol: - 134 MACHO-ARM-NEXT: Scattered: 0 135 MACHO-ARM-NEXT: } 136 MACHO-ARM-NEXT: Relocation { 137 MACHO-ARM-NEXT: Offset: 0x18 138 MACHO-ARM-NEXT: PCRel: 0 139 MACHO-ARM-NEXT: Length: 0 140 MACHO-ARM-NEXT: Extern: 1 141 MACHO-ARM-NEXT: Type: ARM_RELOC_HALF (8) 142 MACHO-ARM-NEXT: Symbol: _g 143 MACHO-ARM-NEXT: Scattered: 0 144 MACHO-ARM-NEXT: } 145 MACHO-ARM-NEXT: Relocation { 146 MACHO-ARM-NEXT: Offset: 0x0 147 MACHO-ARM-NEXT: PCRel: 0 148 MACHO-ARM-NEXT: Length: 0 149 MACHO-ARM-NEXT: Extern: 0 150 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1) 151 MACHO-ARM-NEXT: Symbol: - 152 MACHO-ARM-NEXT: Scattered: 0 153 MACHO-ARM-NEXT: } 154 MACHO-ARM-NEXT: Relocation { 155 MACHO-ARM-NEXT: Offset: 0xC 156 MACHO-ARM-NEXT: PCRel: 0 157 MACHO-ARM-NEXT: Length: 2 158 MACHO-ARM-NEXT: Extern: N/A 159 MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2) 160 MACHO-ARM-NEXT: Symbol: - 161 MACHO-ARM-NEXT: Scattered: 1 162 MACHO-ARM-NEXT: } 163 MACHO-ARM-NEXT: Relocation { 164 MACHO-ARM-NEXT: Offset: 0x0 165 MACHO-ARM-NEXT: PCRel: 0 166 MACHO-ARM-NEXT: Length: 2 167 MACHO-ARM-NEXT: Extern: N/A 168 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1) 169 MACHO-ARM-NEXT: Symbol: - 170 MACHO-ARM-NEXT: Scattered: 1 171 MACHO-ARM-NEXT: } 172 MACHO-ARM-NEXT: } 173 MACHO-ARM-NEXT: ] 174