1# RUN: ld64.lld -arch i386 -r -print_atoms %s -o %t  | FileCheck %s
2#
3# Test parsing of literal sections.
4#
5
6--- !mach-o
7arch:            x86
8file-type:       MH_OBJECT
9flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
10has-UUID:        false
11OS:              unknown
12sections:
13  - segment:         __TEXT
14    section:         __text
15    type:            S_REGULAR
16    attributes:      [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
17    address:         0x0000000000000000
18    content:         [ 0x55, 0x89, 0xE5, 0x5D, 0xC3, 0x55, 0x89, 0xE5,
19                       0x5D, 0xC3, 0x55, 0x89, 0xE5, 0x5D, 0xC3 ]
20  - segment:         __DATA
21    section:         __mod_init_func
22    type:            S_MOD_INIT_FUNC_POINTERS
23    attributes:      [  ]
24    alignment:       2
25    address:         0x0000000000000044
26    content:         [ 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00 ]
27    relocations:
28      - offset:          0x00000000
29        type:            GENERIC_RELOC_VANILLA
30        length:          2
31        pc-rel:          false
32        extern:          false
33        symbol:          1
34      - offset:          0x00000004
35        type:            GENERIC_RELOC_VANILLA
36        length:          2
37        pc-rel:          false
38        extern:          false
39        symbol:          1
40  - segment:         __DATA
41    section:         __mod_term_func
42    type:            S_MOD_TERM_FUNC_POINTERS
43    attributes:      [  ]
44    alignment:       2
45    address:         0x0000000000000104
46    content:         [ 0x0A, 0x00, 0x00, 0x00 ]
47global-symbols:
48  - name:            _init
49    type:            N_SECT
50    scope:           [ N_EXT ]
51    sect:            1
52    value:           0x0000000000000000
53  - name:            _init2
54    type:            N_SECT
55    scope:           [ N_EXT ]
56    sect:            1
57    value:           0x0000000000000005
58  - name:            _term
59    type:            N_SECT
60    scope:           [ N_EXT ]
61    sect:            1
62    value:           0x000000000000000A
63...
64
65
66# CHECK:defined-atoms:
67# CHECK:  - type:            initializer-pointer
68# CHECK:    content:         [ 00, 00, 00, 00 ]
69# CHECK:    dead-strip:      never
70# CHECK:  - type:            initializer-pointer
71# CHECK:    content:         [ 05, 00, 00, 00 ]
72# CHECK:    dead-strip:      never
73# CHECK:  - type:            terminator-pointer
74# CHECK:    content:         [ 0A, 00, 00, 00 ]
75# CHECK:    dead-strip:      never
76# CHECK:  - name:            _init
77# CHECK:    scope:           global
78# CHECK:    content:         [ 55, 89, E5, 5D, C3 ]
79# CHECK:  - name:            _init2
80# CHECK:    scope:           global
81# CHECK:    content:         [ 55, 89, E5, 5D, C3 ]
82# CHECK:  - name:            _term
83# CHECK:    scope:           global
84# CHECK:    content:         [ 55, 89, E5, 5D, C3 ]
85