parse-literals.yaml
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# RUN: ld64.lld -arch x86_64 -r -print_atoms %s -o %t | FileCheck %s
#
# Test parsing of literal sections.
#
--- !mach-o
arch: x86_64
file-type: MH_OBJECT
flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
has-UUID: false
OS: unknown
sections:
- segment: __TEXT
section: __cstring
type: S_CSTRING_LITERALS
attributes: [ ]
alignment: 1
address: 0x0000000000000100
content: [ 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x00, 0x74, 0x68,
0x65, 0x72, 0x65, 0x00, 0x77, 0x6F, 0x72, 0x6C,
0x00 ]
- segment: __TEXT
section: __literal4
type: S_4BYTE_LITERALS
attributes: [ ]
alignment: 1
address: 0x0000000000000114
content: [ 0x01, 0x02, 0x03, 0x04, 0x11, 0x12, 0x13, 0x14,
0x28, 0x29, 0x2A, 0x2B ]
- segment: __TEXT
section: __literal8
type: S_8BYTE_LITERALS
attributes: [ ]
alignment: 1
address: 0x0000000000000120
content: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F ]
- segment: __TEXT
section: __literal16
type: S_16BYTE_LITERALS
attributes: [ ]
alignment: 1
address: 0x0000000000000130
content: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00 ]
- segment: __TEXT
section: __ustring
type: S_REGULAR
attributes: [ ]
alignment: 1
address: 0x0000000000000100
content: [ 0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x6C, 0x00,
0x6F, 0x00, 0x00, 0x00, 0x74, 0x00, 0x68, 0x00,
0x65, 0x00, 0x72, 0x00, 0x00, 0x00 ]
...
# CHECK:defined-atoms:
# CHECK: - scope: hidden
# CHECK: type: c-string
# CHECK: content: [ 68, 65, 6C, 6C, 6F, 00 ]
# CHECK: - scope: hidden
# CHECK: type: c-string
# CHECK: content: [ 74, 68, 65, 72, 65, 00 ]
# CHECK: - scope: hidden
# CHECK: type: c-string
# CHECK: content: [ 77, 6F, 72, 6C, 00 ]
# CHECK: - scope: hidden
# CHECK: type: utf16-string
# CHECK: content: [ 68, 00, 65, 00, 6C, 00, 6C, 00, 6F, 00, 00, 00 ]
# CHECK: - scope: hidden
# CHECK: type: utf16-string
# CHECK: content: [ 74, 00, 68, 00, 65, 00, 72, 00, 00, 00 ]
# CHECK: - scope: hidden
# CHECK: type: const-4-byte
# CHECK: content: [ 01, 02, 03, 04 ]
# CHECK: - scope: hidden
# CHECK: type: const-4-byte
# CHECK: content: [ 11, 12, 13, 14 ]
# CHECK: - scope: hidden
# CHECK: type: const-4-byte
# CHECK: content: [ 28, 29, 2A, 2B ]
# CHECK: - scope: hidden
# CHECK: type: const-8-byte
# CHECK: content: [ 01, 02, 03, 04, 05, 06, 07, 08 ]
# CHECK: - scope: hidden
# CHECK: type: const-8-byte
# CHECK: content: [ 28, 29, 2A, 2B, 2C, 2D, 2E, 2F ]
# CHECK: - scope: hidden
# CHECK: type: const-16-byte
# CHECK: content: [ 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C,
# CHECK: 0D, 0E, 0F, 00 ]