• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: ld64.lld -arch x86_64 -r -print_atoms %s -o %t  | FileCheck %s
2#
3# Test parsing of CFString constants.
4#
5
6--- !mach-o
7arch:            x86_64
8file-type:       MH_OBJECT
9flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
10has-UUID:        false
11OS:              unknown
12sections:
13  - segment:         __TEXT
14    section:         __cstring
15    type:            S_CSTRING_LITERALS
16    attributes:      [  ]
17    address:         0x0000000000000000
18    content:         [ 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x00, 0x74, 0x68,
19                       0x65, 0x72, 0x65, 0x00 ]
20  - segment:         __DATA
21    section:         __cfstring
22    type:            S_REGULAR
23    attributes:      [  ]
24    alignment:       4
25    address:         0x0000000000000010
26    content:         [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27                       0xC8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29                       0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
31                       0xC8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
32                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33                       0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
34    relocations:
35      - offset:          0x00000030
36        type:            X86_64_RELOC_UNSIGNED
37        length:          3
38        pc-rel:          false
39        extern:          true
40        symbol:          1
41      - offset:          0x00000020
42        type:            X86_64_RELOC_UNSIGNED
43        length:          3
44        pc-rel:          false
45        extern:          true
46        symbol:          2
47      - offset:          0x00000010
48        type:            X86_64_RELOC_UNSIGNED
49        length:          3
50        pc-rel:          false
51        extern:          true
52        symbol:          0
53      - offset:          0x00000000
54        type:            X86_64_RELOC_UNSIGNED
55        length:          3
56        pc-rel:          false
57        extern:          true
58        symbol:          2
59local-symbols:
60  - name:            Lstr1
61    type:            N_SECT
62    sect:            1
63    value:           0x0000000000000000
64  - name:            Lstr2
65    type:            N_SECT
66    sect:            1
67    value:           0x0000000000000006
68undefined-symbols:
69  - name:            ___CFConstantStringClassReference
70    type:            N_UNDF
71    scope:           [ N_EXT ]
72    value:           0x0000000000000000
73...
74
75# CHECK:defined-atoms:
76# CHECK:  - ref-name:        L000
77# CHECK:    scope:           hidden
78# CHECK:    type:            c-string
79# CHECK:    content:         [ 68, 65, 6C, 6C, 6F, 00 ]
80# CHECK:    merge:           by-content
81# CHECK:  - ref-name:        L001
82# CHECK:    scope:           hidden
83# CHECK:    type:            c-string
84# CHECK:    content:         [ 74, 68, 65, 72, 65, 00 ]
85# CHECK:    merge:           by-content
86# CHECK:  - scope:           hidden
87# CHECK:    type:            cfstring
88# CHECK:    merge:           by-content
89# CHECK:    references:
90# CHECK:      - kind:            pointer64
91# CHECK:        offset:          0
92# CHECK:        target:          ___CFConstantStringClassReference
93# CHECK:      - kind:            pointer64
94# CHECK:        offset:          16
95# CHECK:        target:          L000
96# CHECK:  - scope:           hidden
97# CHECK:    type:            cfstring
98# CHECK:    merge:           by-content
99# CHECK:    references:
100# CHECK:      - kind:            pointer64
101# CHECK:        offset:          0
102# CHECK:        target:          ___CFConstantStringClassReference
103# CHECK:      - kind:            pointer64
104# CHECK:        offset:          16
105# CHECK:        target:          L001
106# CHECK:undefined-atoms:
107# CHECK:  - name:            ___CFConstantStringClassReference
108
109