• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: not ld64.lld -arch arm64 %s -r \
2# RUN: 2> %t.err
3# RUN: FileCheck %s < %t.err
4
5
6--- !mach-o
7arch:            arm64
8file-type:       MH_OBJECT
9flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
10sections:
11  - segment:         __TEXT
12    section:         __text
13    type:            S_REGULAR
14    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
15    alignment:       4
16    address:         0x0000000000000000
17    content:         [ 0xFF, 0x83, 0x00, 0xD1, 0xE0, 0x0B, 0x00, 0xF9,
18                       0x08, 0x00, 0x40, 0xB9, 0x08, 0x0D, 0x00, 0x71,
19                       0x08, 0x09, 0x00, 0x71, 0xE8, 0x0F, 0x00, 0xB9,
20                       0xC8, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x14,
21                       0xE8, 0x03, 0x00, 0x32, 0x08, 0x01, 0x00, 0x12,
22                       0xE8, 0x7F, 0x00, 0x39, 0x02, 0x00, 0x00, 0x14 ]
23  - segment:         __DATA
24    section:         __data
25    type:            S_REGULAR
26    attributes:      [  ]
27    alignment:       8
28    address:         0x000000000001C348
29    content:         [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30                       0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
31                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
32                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33                       0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
34                       0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
35                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
37    relocations:
38
39# Make sure that the offsets of the subtractor and unsigned both match.
40# CHECK: bad relocation (paired relocs must have the same offset) in section __DATA/__data (r1_address=1, r1_type=1, r1_extern=1, r1_length=3, r1_pcrel=0, r1_symbolnum=1), (r2_address=0, r2_type=0, r2_extern=1, r2_length=3, r2_pcrel=0, r2_symbolnum=1)
41      - offset:          0x00000001
42        type:            ARM64_RELOC_SUBTRACTOR
43        length:          3
44        pc-rel:          false
45        extern:          true
46        symbol:          1
47      - offset:          0x00000000
48        type:            ARM64_RELOC_UNSIGNED
49        length:          3
50        pc-rel:          false
51        extern:          true
52        symbol:          1
53global-symbols:
54  - name:            _f1
55    type:            N_SECT
56    sect:            2
57    value:           0x000000000001C348
58  - name:            _f2
59    type:            N_SECT
60    sect:            1
61    value:           0x0000000000000010
62  - name:            _f3
63    type:            N_SECT
64    sect:            1
65    value:           0x0000000000000020
66