]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/mach-o/parse-non-lazy-pointers.yaml
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / mach-o / parse-non-lazy-pointers.yaml
1 # RUN: ld64.lld -arch i386 -r -print_atoms %s -o %t  | FileCheck %s
2 #
3 # Test parsing of non-lazy-pointer 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, 0xE8, 0x00, 0x00, 0x00, 0x00,
19                        0x59, 0x8D, 0x81, 0x14, 0x00, 0x00, 0x00, 0x8D,
20                        0x81, 0x18, 0x00, 0x00, 0x00, 0x5D, 0xC3, 0x55,
21                        0x89, 0xE5, 0x5D, 0xC3 ]
22     relocations:
23       - offset:          0x00000011
24         scattered:       true
25         type:            GENERIC_RELOC_LOCAL_SECTDIFF
26         length:          2
27         pc-rel:          false
28         value:           0x00000020
29       - offset:          0x00000000
30         scattered:       true
31         type:            GENERIC_RELOC_PAIR
32         length:          2
33         pc-rel:          false
34         value:           0x00000008
35       - offset:          0x0000000B
36         scattered:       true
37         type:            GENERIC_RELOC_LOCAL_SECTDIFF
38         length:          2
39         pc-rel:          false
40         value:           0x0000001C
41       - offset:          0x00000000
42         scattered:       true
43         type:            GENERIC_RELOC_PAIR
44         length:          2
45         pc-rel:          false
46         value:           0x00000008
47   - segment:         __IMPORT
48     section:         __pointers
49     type:            S_NON_LAZY_SYMBOL_POINTERS
50     attributes:      [  ]
51     address:         0x000000000000001C
52     content:         [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
53     indirect-syms:   [ 2, 2147483648 ]
54 local-symbols:
55   - name:            _foo
56     type:            N_SECT
57     sect:            1
58     value:           0x0000000000000017
59 global-symbols:
60   - name:            _get
61     type:            N_SECT
62     scope:           [ N_EXT ]
63     sect:            1
64     value:           0x0000000000000000
65 undefined-symbols:
66   - name:            _bar
67     type:            N_UNDF
68     scope:           [ N_EXT ]
69     value:           0x0000000000000000
70 ...
71
72
73 # CHECK:defined-atoms:
74 # CHECK:  - ref-name:        [[GOT1:L[L0-9]+]]
75 # CHECK:    scope:           hidden
76 # CHECK:    type:            got
77 # CHECK:    content:         [ 00, 00, 00, 00 ]
78 # CHECK:    merge:           by-content
79 # CHECK:  - ref-name:        [[GOT2:L[L0-9]+]]
80 # CHECK:    scope:           hidden
81 # CHECK:    type:            got
82 # CHECK:    content:         [ 00, 00, 00, 00 ]
83 # CHECK:    merge:           by-content
84 # CHECK:  - name:            _get
85 # CHECK:    scope:           global
86 # CHECK:    content:         [ 55, 89, E5, E8, 00, 00, 00, 00, 59, 8D, 81, 14,
87 # CHECK:                       00, 00, 00, 8D, 81, 18, 00, 00, 00, 5D, C3 ]
88 # CHECK:     references:
89 # CHECK:       - kind:            funcRel32
90 # CHECK:         offset:          11
91 # CHECK:         target:          [[GOT1]]
92 # CHECK:       - kind:            funcRel32
93 # CHECK:         offset:          17
94 # CHECK:         target:          [[GOT2]]
95 # CHECK:  - name:            _foo
96 # CHECK:    content:         [ 55, 89, E5, 5D, C3 ]
97
98