1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -r -expand-relocs | FileCheck %s 2 3 .data 4 .long undef 5 .long (undef + 4) 6 7 .globl local_a_ext 8local_a_ext: 9 .long local_a_ext 10 11local_a: 12 .long 0 13local_a_elt: 14 .long 0 15local_b: 16 .long local_b - local_c + 245 17 .long 0 18local_c: 19 .long 0 20 21 22 .long local_a_elt + 1 23 .long local_a_elt + 10 24 .short local_a_elt + 20 25 .byte local_a_elt + 89 26 27 .const 28 29 .long 30bar: 31 .long local_a_elt - bar + 33 32 33L0: 34 .long L0 35 .long L1 36 37 .text 38_f0: 39L1: 40 jmp 0xbabecafe 41 jmp L0 42 jmp L1 43 ret 44 45 .objc_class_name_A=0 46 .globl .objc_class_name_A 47 48 .text 49 .globl _f1 50 .weak_definition _f1 51_f1: 52 .data 53 .long _f1 54 .long _f1 + 4 55 56// CHECK: Relocations [ 57// CHECK-NEXT: Section __text { 58// CHECK-NEXT: Relocation { 59// CHECK-NEXT: Offset: 0x6 60// CHECK-NEXT: PCRel: 1 61// CHECK-NEXT: Length: 2 62// CHECK-NEXT: Extern: 0 63// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 64// CHECK-NEXT: Symbol: 0x3 65// CHECK-NEXT: Scattered: 0 66// CHECK-NEXT: } 67// CHECK-NEXT: Relocation { 68// CHECK-NEXT: Offset: 0x1 69// CHECK-NEXT: PCRel: 1 70// CHECK-NEXT: Length: 2 71// CHECK-NEXT: Extern: 0 72// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 73// CHECK-NEXT: Symbol: 0x0 74// CHECK-NEXT: Scattered: 0 75// CHECK-NEXT: } 76// CHECK-NEXT: } 77// CHECK-NEXT: Section __data { 78// CHECK-NEXT: Relocation { 79// CHECK-NEXT: Offset: 0x2F 80// CHECK-NEXT: PCRel: 0 81// CHECK-NEXT: Length: 2 82// CHECK-NEXT: Extern: 1 83// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 84// CHECK-NEXT: Symbol: _f1 85// CHECK-NEXT: Scattered: 0 86// CHECK-NEXT: } 87// CHECK-NEXT: Relocation { 88// CHECK-NEXT: Offset: 0x2B 89// CHECK-NEXT: PCRel: 0 90// CHECK-NEXT: Length: 2 91// CHECK-NEXT: Extern: 1 92// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 93// CHECK-NEXT: Symbol: _f1 94// CHECK-NEXT: Scattered: 0 95// CHECK-NEXT: } 96// CHECK-NEXT: Relocation { 97// CHECK-NEXT: Offset: 0x2A 98// CHECK-NEXT: PCRel: 0 99// CHECK-NEXT: Length: 0 100// CHECK-NEXT: Extern: N/A 101// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 102// CHECK-NEXT: Symbol: 0x1D 103// CHECK-NEXT: Scattered: 1 104// CHECK-NEXT: } 105// CHECK-NEXT: Relocation { 106// CHECK-NEXT: Offset: 0x28 107// CHECK-NEXT: PCRel: 0 108// CHECK-NEXT: Length: 1 109// CHECK-NEXT: Extern: N/A 110// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 111// CHECK-NEXT: Symbol: 0x1D 112// CHECK-NEXT: Scattered: 1 113// CHECK-NEXT: } 114// CHECK-NEXT: Relocation { 115// CHECK-NEXT: Offset: 0x24 116// CHECK-NEXT: PCRel: 0 117// CHECK-NEXT: Length: 2 118// CHECK-NEXT: Extern: N/A 119// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 120// CHECK-NEXT: Symbol: 0x1D 121// CHECK-NEXT: Scattered: 1 122// CHECK-NEXT: } 123// CHECK-NEXT: Relocation { 124// CHECK-NEXT: Offset: 0x20 125// CHECK-NEXT: PCRel: 0 126// CHECK-NEXT: Length: 2 127// CHECK-NEXT: Extern: N/A 128// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 129// CHECK-NEXT: Symbol: 0x1D 130// CHECK-NEXT: Scattered: 1 131// CHECK-NEXT: } 132// CHECK-NEXT: Relocation { 133// CHECK-NEXT: Offset: 0x14 134// CHECK-NEXT: PCRel: 0 135// CHECK-NEXT: Length: 2 136// CHECK-NEXT: Extern: N/A 137// CHECK-NEXT: Type: GENERIC_RELOC_LOCAL_SECTDIFF (4) 138// CHECK-NEXT: Symbol: 0x21 139// CHECK-NEXT: Scattered: 1 140// CHECK-NEXT: } 141// CHECK-NEXT: Relocation { 142// CHECK-NEXT: Offset: 0x0 143// CHECK-NEXT: PCRel: 0 144// CHECK-NEXT: Length: 2 145// CHECK-NEXT: Extern: N/A 146// CHECK-NEXT: Type: GENERIC_RELOC_PAIR (1) 147// CHECK-NEXT: Symbol: 0x29 148// CHECK-NEXT: Scattered: 1 149// CHECK-NEXT: } 150// CHECK-NEXT: Relocation { 151// CHECK-NEXT: Offset: 0x8 152// CHECK-NEXT: PCRel: 0 153// CHECK-NEXT: Length: 2 154// CHECK-NEXT: Extern: 0 155// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 156// CHECK-NEXT: Symbol: 0x2 157// CHECK-NEXT: Scattered: 0 158// CHECK-NEXT: } 159// CHECK-NEXT: Relocation { 160// CHECK-NEXT: Offset: 0x4 161// CHECK-NEXT: PCRel: 0 162// CHECK-NEXT: Length: 2 163// CHECK-NEXT: Extern: 1 164// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 165// CHECK-NEXT: Symbol: undef 166// CHECK-NEXT: Scattered: 0 167// CHECK-NEXT: } 168// CHECK-NEXT: Relocation { 169// CHECK-NEXT: Offset: 0x0 170// CHECK-NEXT: PCRel: 0 171// CHECK-NEXT: Length: 2 172// CHECK-NEXT: Extern: 1 173// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 174// CHECK-NEXT: Symbol: undef 175// CHECK-NEXT: Scattered: 0 176// CHECK-NEXT: } 177// CHECK-NEXT: } 178// CHECK-NEXT: Section __const { 179// CHECK-NEXT: Relocation { 180// CHECK-NEXT: Offset: 0x8 181// CHECK-NEXT: PCRel: 0 182// CHECK-NEXT: Length: 2 183// CHECK-NEXT: Extern: 0 184// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 185// CHECK-NEXT: Symbol: 0x1 186// CHECK-NEXT: Scattered: 0 187// CHECK-NEXT: } 188// CHECK-NEXT: Relocation { 189// CHECK-NEXT: Offset: 0x4 190// CHECK-NEXT: PCRel: 0 191// CHECK-NEXT: Length: 2 192// CHECK-NEXT: Extern: 0 193// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0) 194// CHECK-NEXT: Symbol: 0x3 195// CHECK-NEXT: Scattered: 0 196// CHECK-NEXT: } 197// CHECK-NEXT: Relocation { 198// CHECK-NEXT: Offset: 0x0 199// CHECK-NEXT: PCRel: 0 200// CHECK-NEXT: Length: 2 201// CHECK-NEXT: Extern: N/A 202// CHECK-NEXT: Type: GENERIC_RELOC_LOCAL_SECTDIFF (4) 203// CHECK-NEXT: Symbol: 0x1D 204// CHECK-NEXT: Scattered: 1 205// CHECK-NEXT: } 206// CHECK-NEXT: Relocation { 207// CHECK-NEXT: Offset: 0x0 208// CHECK-NEXT: PCRel: 0 209// CHECK-NEXT: Length: 2 210// CHECK-NEXT: Extern: N/A 211// CHECK-NEXT: Type: GENERIC_RELOC_PAIR (1) 212// CHECK-NEXT: Symbol: 0x40 213// CHECK-NEXT: Scattered: 1 214// CHECK-NEXT: } 215// CHECK-NEXT: } 216// CHECK-NEXT:] 217