]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/mach-o/parse-initializers32.yaml
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / test / mach-o / parse-initializers32.yaml
1 # RUN: lld -flavor darwin -arch i386 -r -print_atoms %s -o %t  | FileCheck %s
2 #
3 # Test parsing of literal sections.
4 #
5
6 --- !mach-o
7 arch:            x86
8 file-type:       MH_OBJECT
9 flags:           [ MH_SUBSECTIONS_VIA_SYMBOLS ]
10 has-UUID:        false
11 OS:              unknown
12 sections:
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 ]
47 global-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 ]