-# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t | FileCheck %s \
-# RUN: && lld -flavor darwin -arch armv7 -r -print_atoms %t -o %t2 | FileCheck %s
+# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t | FileCheck %s
+# RUN: lld -flavor darwin -arch armv7 -r -print_atoms %t -o %t2 | FileCheck %s
#
# Test parsing of armv7 relocations.
#
arch: armv7
file-type: MH_OBJECT
flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
-has-UUID: false
-OS: unknown
sections:
- segment: __TEXT
section: __text
attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
alignment: 2
address: 0x0000000000000000
- content: [ 0x00, 0xF0, 0x4A, 0xF8, 0x00, 0xF0, 0x4A, 0xF8,
- 0xFF, 0xF7, 0xFA, 0xFF, 0xFF, 0xF7, 0xFA, 0xFF,
- 0x40, 0xF2, 0x6E, 0x01, 0xC0, 0xF2, 0x00, 0x01,
- 0x40, 0xF2, 0x76, 0x02, 0xC0, 0xF2, 0x00, 0x02,
- 0x40, 0xF2, 0x29, 0x01, 0xC0, 0xF2, 0x00, 0x01,
- 0x79, 0x44, 0x40, 0xF2, 0x98, 0x03, 0xC0, 0xF2,
- 0x00, 0x03, 0x40, 0xF2, 0xA0, 0x04, 0xC0, 0xF2,
- 0x00, 0x04, 0x40, 0xF2, 0x53, 0x03, 0xC0, 0xF2,
- 0x00, 0x03, 0x40, 0xF2, 0x00, 0x05, 0xC0, 0xF2,
- 0x00, 0x05, 0x40, 0xF2, 0x08, 0x06, 0xC0, 0xF2,
- 0x00, 0x06, 0xC0, 0x46, 0x0F, 0x00, 0x00, 0xEB,
- 0x0F, 0x00, 0x00, 0xEB, 0xE7, 0xFF, 0xFF, 0xEB,
- 0xE7, 0xFF, 0xFF, 0xEB, 0x20, 0x10, 0x00, 0xE3,
- 0x00, 0x10, 0x40, 0xE3, 0x28, 0x20, 0x00, 0xE3,
- 0x00, 0x20,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 0x50, 0x00, 0xE3, 0x00, 0x50, 0x40, 0xE3,
0x08, 0x60, 0x00, 0xE3, 0x00, 0x60, 0x40, 0xE3 ]
relocations:
- - offset: 0x00000094
+ - offset: 0x0000009C
type: ARM_RELOC_HALF
length: 1
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000090
+ - offset: 0x00000098
type: ARM_RELOC_HALF
length: 0
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x0000008C
+ - offset: 0x00000094
type: ARM_RELOC_HALF
length: 1
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000088
+ - offset: 0x00000090
type: ARM_RELOC_HALF
length: 0
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000084
+ - offset: 0x0000008C
scattered: true
type: ARM_RELOC_HALF
length: 1
pc-rel: false
- value: 0x00000098
- - offset: 0x000000A0
+ value: 0x000000A0
+ - offset: 0x000000A8
type: ARM_RELOC_PAIR
length: 1
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000080
+ - offset: 0x00000088
scattered: true
type: ARM_RELOC_HALF
length: 0
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000000
type: ARM_RELOC_PAIR
length: 0
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x0000007C
+ - offset: 0x00000084
type: ARM_RELOC_HALF
length: 1
pc-rel: false
extern: false
symbol: 2
- - offset: 0x00000098
+ - offset: 0x000000A0
type: ARM_RELOC_PAIR
length: 1
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000078
+ - offset: 0x00000080
type: ARM_RELOC_HALF
length: 0
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000070
+ - offset: 0x00000078
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 1
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000028
scattered: true
type: ARM_RELOC_PAIR
length: 1
pc-rel: false
- value: 0x00000078
- - offset: 0x0000006C
+ value: 0x00000080
+ - offset: 0x00000074
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 0
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 0
pc-rel: false
- value: 0x00000078
- - offset: 0x00000068
+ value: 0x00000080
+ - offset: 0x00000070
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 1
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000020
scattered: true
type: ARM_RELOC_PAIR
length: 1
pc-rel: false
- value: 0x00000078
- - offset: 0x00000064
+ value: 0x00000080
+ - offset: 0x0000006C
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 0
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 0
pc-rel: false
- value: 0x00000078
- - offset: 0x00000060
+ value: 0x00000080
+ - offset: 0x00000068
type: ARM_RELOC_BR24
length: 2
pc-rel: true
extern: true
symbol: 4
- - offset: 0x0000005C
+ - offset: 0x00000064
type: ARM_RELOC_BR24
length: 2
pc-rel: true
extern: true
symbol: 4
- - offset: 0x00000058
+ - offset: 0x00000060
+ type: ARM_RELOC_BR24
+ length: 2
+ pc-rel: true
+ extern: true
+ symbol: 4
+ - offset: 0x0000005C
scattered: true
type: ARM_RELOC_BR24
length: 2
pc-rel: true
- value: 0x00000098
- - offset: 0x00000054
+ value: 0x000000A0
+ - offset: 0x00000058
type: ARM_RELOC_BR24
length: 2
pc-rel: true
extern: false
symbol: 2
- - offset: 0x0000004E
+ - offset: 0x00000052
type: ARM_RELOC_HALF
length: 3
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x0000004A
+ - offset: 0x0000004E
type: ARM_RELOC_HALF
length: 2
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000046
+ - offset: 0x0000004A
type: ARM_RELOC_HALF
length: 3
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000042
+ - offset: 0x00000046
type: ARM_RELOC_HALF
length: 2
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x0000003E
+ - offset: 0x00000042
type: ARM_RELOC_HALF
length: 3
pc-rel: false
extern: false
symbol: 1
- - offset: 0x00000053
+ - offset: 0x00000057
type: ARM_RELOC_PAIR
length: 3
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x0000003A
+ - offset: 0x0000003E
type: ARM_RELOC_HALF
length: 2
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000036
+ - offset: 0x0000003A
scattered: true
type: ARM_RELOC_HALF
length: 3
pc-rel: false
- value: 0x00000098
- - offset: 0x000000A0
+ value: 0x000000A0
+ - offset: 0x000000A8
type: ARM_RELOC_PAIR
length: 3
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000032
+ - offset: 0x00000036
scattered: true
type: ARM_RELOC_HALF
length: 2
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000000
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x0000002E
+ - offset: 0x00000032
type: ARM_RELOC_HALF
length: 3
pc-rel: false
extern: false
symbol: 2
- - offset: 0x00000098
+ - offset: 0x000000A0
type: ARM_RELOC_PAIR
length: 3
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x0000002A
+ - offset: 0x0000002E
type: ARM_RELOC_HALF
length: 2
pc-rel: false
pc-rel: false
extern: false
symbol: 16777215
- - offset: 0x00000024
+ - offset: 0x00000028
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 3
pc-rel: false
- value: 0x00000052
+ value: 0x00000056
- offset: 0x00000028
scattered: true
type: ARM_RELOC_PAIR
length: 3
pc-rel: false
- value: 0x0000002A
- - offset: 0x00000020
+ value: 0x0000002E
+ - offset: 0x00000024
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 2
pc-rel: false
- value: 0x00000052
+ value: 0x00000056
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
- value: 0x0000002A
- - offset: 0x0000001C
+ value: 0x0000002E
+ - offset: 0x00000020
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 3
pc-rel: false
- value: 0x00000098
- - offset: 0x00000076
+ value: 0x000000A0
+ - offset: 0x0000007A
scattered: true
type: ARM_RELOC_PAIR
length: 3
pc-rel: false
- value: 0x0000002A
- - offset: 0x00000018
+ value: 0x0000002E
+ - offset: 0x0000001C
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 2
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
- value: 0x0000002A
- - offset: 0x00000014
+ value: 0x0000002E
+ - offset: 0x00000018
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 3
pc-rel: false
- value: 0x00000098
- - offset: 0x0000006E
+ value: 0x000000A0
+ - offset: 0x00000072
scattered: true
type: ARM_RELOC_PAIR
length: 3
pc-rel: false
- value: 0x0000002A
- - offset: 0x00000010
+ value: 0x0000002E
+ - offset: 0x00000014
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 2
pc-rel: false
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
- value: 0x0000002A
+ value: 0x0000002E
+ - offset: 0x00000010
+ type: ARM_THUMB_RELOC_BR22
+ length: 2
+ pc-rel: true
+ extern: true
+ symbol: 4
- offset: 0x0000000C
type: ARM_THUMB_RELOC_BR22
length: 2
type: ARM_THUMB_RELOC_BR22
length: 2
pc-rel: true
- value: 0x00000098
+ value: 0x000000A0
- offset: 0x00000000
type: ARM_THUMB_RELOC_BR22
length: 2
section: __data
type: S_REGULAR
attributes: [ ]
- address: 0x0000000000000098
+ address: 0x00000000000000A0
content: [ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0xA8, 0xFF, 0xFF, 0xFF,
- 0xA8, 0xFF, 0xFF, 0xFF, 0x4D, 0xFF, 0xFF, 0xFF,
- 0x4D, 0xFF, 0xFF, 0xFF ]
+ 0x04, 0x00, 0x00, 0x00, 0xA4, 0xFF, 0xFF, 0xFF,
+ 0xA4, 0xFF, 0xFF, 0xFF, 0x45, 0xFF, 0xFF, 0xFF,
+ 0x45, 0xFF, 0xFF, 0xFF ]
relocations:
- offset: 0x00000020
scattered: true
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
- value: 0x000000B8
+ value: 0x000000C0
- offset: 0x0000001C
scattered: true
type: ARM_RELOC_SECTDIFF
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
- value: 0x000000B4
+ value: 0x000000BC
- offset: 0x00000018
scattered: true
type: ARM_RELOC_SECTDIFF
length: 2
pc-rel: false
- value: 0x00000054
+ value: 0x00000058
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
- value: 0x000000B0
+ value: 0x000000B8
- offset: 0x00000014
scattered: true
type: ARM_RELOC_SECTDIFF
length: 2
pc-rel: false
- value: 0x00000054
+ value: 0x00000058
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
- value: 0x000000AC
+ value: 0x000000B4
- offset: 0x00000010
type: ARM_RELOC_VANILLA
length: 2
- name: _x
type: N_SECT
sect: 2
- value: 0x0000000000000098
+ value: 0x00000000000000A0
- name: _t1
type: N_SECT
sect: 1
desc: [ N_ARM_THUMB_DEF ]
- value: 0x0000000000000052
+ value: 0x0000000000000056
- name: _foo_arm
type: N_SECT
sect: 1
- value: 0x0000000000000054
-undefined-symbols:
+ value: 0x0000000000000058
+undefined-symbols:
- name: _undef
type: N_UNDF
scope: [ N_EXT ]
value: 0x0000000000000000
-
...
# CHECK: defined-atoms:
# CHECK: offset: 12
# CHECK: target: _undef
# CHECK: addend: 4
-# CHECK: - kind: thumb_movw_funcRel
+# CHECK: - kind: thumb_b22
# CHECK: offset: 16
+# CHECK: target: _undef
+# CHECK-NOT: addend:
+# CHECK: - kind: thumb_movw_funcRel
+# CHECK: offset: 20
# CHECK: target: _x
-# CHECK: addend: -42
+# CHECK: addend: -46
# CHECK: - kind: thumb_movt_funcRel
-# CHECK: offset: 20
+# CHECK: offset: 24
# CHECK: target: _x
-# CHECK: addend: -42
+# CHECK: addend: -46
# CHECK: - kind: thumb_movw_funcRel
-# CHECK: offset: 24
+# CHECK: offset: 28
# CHECK: target: _x
-# CHECK: addend: -34
+# CHECK: addend: -38
# CHECK: - kind: thumb_movt_funcRel
-# CHECK: offset: 28
+# CHECK: offset: 32
# CHECK: target: _x
-# CHECK: addend: -34
+# CHECK: addend: -38
# CHECK: - kind: thumb_movw_funcRel
-# CHECK: offset: 32
+# CHECK: offset: 36
# CHECK: target: _t1
-# CHECK: addend: -42
+# CHECK: addend: -46
# CHECK: - kind: thumb_movt_funcRel
-# CHECK: offset: 36
+# CHECK: offset: 40
# CHECK: target: _t1
-# CHECK: addend: -42
+# CHECK: addend: -46
# CHECK: - kind: thumb_movw
-# CHECK: offset: 42
+# CHECK: offset: 46
# CHECK: target: _x
# CHECK-NOT: addend:
# CHECK: - kind: thumb_movt
-# CHECK: offset: 46
+# CHECK: offset: 50
# CHECK: target: _x
# CHECK-NOT: addend:
# CHECK: - kind: thumb_movw
-# CHECK: offset: 50
+# CHECK: offset: 54
# CHECK: target: _x
# CHECK: addend: 8
# CHECK: - kind: thumb_movt
-# CHECK: offset: 54
+# CHECK: offset: 58
# CHECK: target: _x
# CHECK: addend: 8
# CHECK: - kind: thumb_movw
-# CHECK: offset: 58
+# CHECK: offset: 62
# CHECK: target: _t1
# CHECK-NOT: addend:
# CHECK: - kind: thumb_movt
-# CHECK: offset: 62
+# CHECK: offset: 66
# CHECK: target: _t1
# CHECK-NOT: addend:
# CHECK: - kind: thumb_movw
-# CHECK: offset: 66
+# CHECK: offset: 70
# CHECK: target: _undef
# CHECK-NOT: addend:
# CHECK: - kind: thumb_movt
-# CHECK: offset: 70
+# CHECK: offset: 74
# CHECK: target: _undef
# CHECK-NOT: addend:
# CHECK: - kind: thumb_movw
-# CHECK: offset: 74
+# CHECK: offset: 78
# CHECK: target: _undef
# CHECK: addend: 8
# CHECK: - kind: thumb_movt
-# CHECK: offset: 78
+# CHECK: offset: 82
# CHECK: target: _undef
# CHECK: addend: 8
# CHECK: - name: _t1
# CHECK: offset: 12
# CHECK: target: _undef
# CHECK: addend: 4
-# CHECK: - kind: arm_movw_funcRel
+# CHECK: - kind: arm_b24
# CHECK: offset: 16
+# CHECK: target: _undef
+# CHECK-NOT: addend:
+# CHECK: - kind: arm_movw_funcRel
+# CHECK: offset: 20
# CHECK: target: _x
-# CHECK: addend: -36
+# CHECK: addend: -40
# CHECK: - kind: arm_movt_funcRel
-# CHECK: offset: 20
+# CHECK: offset: 24
# CHECK: target: _x
-# CHECK: addend: -36
+# CHECK: addend: -40
# CHECK: - kind: arm_movw_funcRel
-# CHECK: offset: 24
+# CHECK: offset: 28
# CHECK: target: _x
-# CHECK: addend: -28
+# CHECK: addend: -32
# CHECK: - kind: arm_movt_funcRel
-# CHECK: offset: 28
+# CHECK: offset: 32
# CHECK: target: _x
-# CHECK: addend: -28
+# CHECK: addend: -32
# CHECK: - kind: arm_movw
-# CHECK: offset: 36
+# CHECK: offset: 40
# CHECK: target: _x
# CHECK-NOT: addend:
# CHECK: - kind: arm_movt
-# CHECK: offset: 40
+# CHECK: offset: 44
# CHECK: target: _x
# CHECK-NOT: addend:
# CHECK: - kind: arm_movw
-# CHECK: offset: 44
+# CHECK: offset: 48
# CHECK: target: _x
# CHECK: addend: 8
# CHECK: - kind: arm_movt
-# CHECK: offset: 48
+# CHECK: offset: 52
# CHECK: target: _x
# CHECK: addend: 8
# CHECK: - kind: arm_movw
-# CHECK: offset: 52
+# CHECK: offset: 56
# CHECK: target: _undef
# CHECK-NOT: addend:
# CHECK: - kind: arm_movt
-# CHECK: offset: 56
+# CHECK: offset: 60
# CHECK: target: _undef
# CHECK-NOT: addend:
# CHECK: - kind: arm_movw
-# CHECK: offset: 60
+# CHECK: offset: 64
# CHECK: target: _undef
# CHECK: addend: 8
# CHECK: - kind: arm_movt
-# CHECK: offset: 64
+# CHECK: offset: 68
# CHECK: target: _undef
# CHECK: addend: 8
# CHECK: undefined-atoms:
# bl _x+4
# bl _undef
# bl _undef+4
+# b _undef
# movw r1, :lower16:(_x-L1)
# movt r1, :upper16:(_x-L1)
# movw r2, :lower16:(_x+8-L1)
# bl _x+4
# bl _undef
# bl _undef+4
+# b _undef
# movw r1, :lower16:(_x-L2)
# movt r1, :upper16:(_x-L2)
# movw r2, :lower16:(_x+8-L2)