2014-12-27 02:22:05 +08:00
|
|
|
// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -r -expand-relocs | FileCheck %s
|
2009-08-26 21:58:10 +08:00
|
|
|
|
|
|
|
.data
|
|
|
|
.long undef
|
|
|
|
.long (undef + 4)
|
|
|
|
|
|
|
|
.globl local_a_ext
|
|
|
|
local_a_ext:
|
|
|
|
.long local_a_ext
|
|
|
|
|
|
|
|
local_a:
|
|
|
|
.long 0
|
2010-03-19 11:18:12 +08:00
|
|
|
local_a_elt:
|
2009-08-26 21:58:10 +08:00
|
|
|
.long 0
|
|
|
|
local_b:
|
|
|
|
.long local_b - local_c + 245
|
|
|
|
.long 0
|
|
|
|
local_c:
|
|
|
|
.long 0
|
|
|
|
|
|
|
|
|
|
|
|
.long local_a_elt + 1
|
|
|
|
.long local_a_elt + 10
|
|
|
|
.short local_a_elt + 20
|
|
|
|
.byte local_a_elt + 89
|
|
|
|
|
|
|
|
.const
|
|
|
|
|
|
|
|
.long
|
2010-03-19 11:18:12 +08:00
|
|
|
bar:
|
2009-08-26 21:58:10 +08:00
|
|
|
.long local_a_elt - bar + 33
|
|
|
|
|
2010-03-19 11:18:12 +08:00
|
|
|
L0:
|
|
|
|
.long L0
|
|
|
|
.long L1
|
|
|
|
|
|
|
|
.text
|
|
|
|
_f0:
|
|
|
|
L1:
|
2010-09-17 23:21:50 +08:00
|
|
|
jmp 0xbabecafe
|
2010-03-19 11:18:12 +08:00
|
|
|
jmp L0
|
|
|
|
jmp L1
|
|
|
|
ret
|
|
|
|
|
2010-05-06 03:01:05 +08:00
|
|
|
.objc_class_name_A=0
|
|
|
|
.globl .objc_class_name_A
|
|
|
|
|
2010-05-08 05:44:23 +08:00
|
|
|
.text
|
|
|
|
.globl _f1
|
|
|
|
.weak_definition _f1
|
|
|
|
_f1:
|
|
|
|
.data
|
|
|
|
.long _f1
|
2010-05-11 07:15:20 +08:00
|
|
|
.long _f1 + 4
|
2010-05-08 05:44:23 +08:00
|
|
|
|
2014-12-27 02:22:05 +08:00
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section __text {
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x6
|
|
|
|
// CHECK-NEXT: PCRel: 1
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 0
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x3
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x1
|
|
|
|
// CHECK-NEXT: PCRel: 1
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 0
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x0
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Section __data {
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x2F
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 1
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: _f1
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x2B
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 1
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: _f1
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x2A
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 0
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x1D
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x28
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 1
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x1D
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x24
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x1D
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x20
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x1D
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x14
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_LOCAL_SECTDIFF (4)
|
|
|
|
// CHECK-NEXT: Symbol: 0x21
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x0
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_PAIR (1)
|
|
|
|
// CHECK-NEXT: Symbol: 0x29
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x8
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 0
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x2
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x4
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 1
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: undef
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x0
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 1
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: undef
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Section __const {
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x8
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 0
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x1
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x4
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: 0
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_VANILLA (0)
|
|
|
|
// CHECK-NEXT: Symbol: 0x3
|
|
|
|
// CHECK-NEXT: Scattered: 0
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x0
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_LOCAL_SECTDIFF (4)
|
|
|
|
// CHECK-NEXT: Symbol: 0x1D
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Relocation {
|
|
|
|
// CHECK-NEXT: Offset: 0x0
|
|
|
|
// CHECK-NEXT: PCRel: 0
|
|
|
|
// CHECK-NEXT: Length: 2
|
|
|
|
// CHECK-NEXT: Extern: N/A
|
|
|
|
// CHECK-NEXT: Type: GENERIC_RELOC_PAIR (1)
|
|
|
|
// CHECK-NEXT: Symbol: 0x40
|
|
|
|
// CHECK-NEXT: Scattered: 1
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT:]
|