2014-05-22 09:42:06 +08:00
|
|
|
# RUN: lld -flavor darwin -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: [ ]
|
2015-03-26 10:20:25 +08:00
|
|
|
alignment: 1
|
2014-05-22 09:42:06 +08:00
|
|
|
address: 0x0000000000000100
|
2015-04-28 01:18:04 +08:00
|
|
|
content: [ 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x00, 0x74, 0x68,
|
|
|
|
0x65, 0x72, 0x65, 0x00, 0x77, 0x6F, 0x72, 0x6C,
|
2014-06-25 19:21:51 +08:00
|
|
|
0x00 ]
|
2014-05-22 09:42:06 +08:00
|
|
|
- segment: __TEXT
|
|
|
|
section: __literal4
|
|
|
|
type: S_4BYTE_LITERALS
|
|
|
|
attributes: [ ]
|
2015-03-26 10:20:25 +08:00
|
|
|
alignment: 1
|
2014-05-22 09:42:06 +08:00
|
|
|
address: 0x0000000000000114
|
|
|
|
content: [ 0x01, 0x02, 0x03, 0x04, 0x11, 0x12, 0x13, 0x14,
|
|
|
|
0x28, 0x29, 0x2A, 0x2B ]
|
|
|
|
- segment: __TEXT
|
|
|
|
section: __literal8
|
|
|
|
type: S_8BYTE_LITERALS
|
|
|
|
attributes: [ ]
|
2015-03-26 10:20:25 +08:00
|
|
|
alignment: 1
|
2014-05-22 09:42:06 +08:00
|
|
|
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: [ ]
|
2015-03-26 10:20:25 +08:00
|
|
|
alignment: 1
|
2014-05-22 09:42:06 +08:00
|
|
|
address: 0x0000000000000130
|
|
|
|
content: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
|
|
|
|
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00 ]
|
2014-05-28 04:25:06 +08:00
|
|
|
- segment: __TEXT
|
|
|
|
section: __ustring
|
|
|
|
type: S_REGULAR
|
|
|
|
attributes: [ ]
|
2015-03-26 10:20:25 +08:00
|
|
|
alignment: 1
|
2014-05-28 04:25:06 +08:00
|
|
|
address: 0x0000000000000100
|
2015-04-28 01:18:04 +08:00
|
|
|
content: [ 0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x6C, 0x00,
|
|
|
|
0x6F, 0x00, 0x00, 0x00, 0x74, 0x00, 0x68, 0x00,
|
2014-06-25 19:21:51 +08:00
|
|
|
0x65, 0x00, 0x72, 0x00, 0x00, 0x00 ]
|
2014-05-22 09:42:06 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
|
2015-04-28 01:18:04 +08:00
|
|
|
# CHECK:defined-atoms:
|
2014-05-22 09:42:06 +08:00
|
|
|
# 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
|
2014-06-25 19:21:51 +08:00
|
|
|
# CHECK: content: [ 77, 6F, 72, 6C, 00 ]
|
2014-05-22 09:42:06 +08:00
|
|
|
# CHECK: - scope: hidden
|
2014-05-28 04:25:06 +08:00
|
|
|
# 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
|
2014-06-25 19:21:51 +08:00
|
|
|
# CHECK: content: [ 74, 00, 68, 00, 65, 00, 72, 00, 00, 00 ]
|
2014-05-28 04:25:06 +08:00
|
|
|
# CHECK: - scope: hidden
|
2014-05-22 09:42:06 +08:00
|
|
|
# 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
|
2015-04-28 01:18:04 +08:00
|
|
|
# CHECK: content: [ 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C,
|
2014-05-22 09:42:06 +08:00
|
|
|
# CHECK: 0D, 0E, 0F, 00 ]
|
|
|
|
|