llvm-capstone/lld/test/mach-o/hello-world-armv7.yaml
2018-02-16 21:16:57 +00:00

77 lines
2.5 KiB
YAML

# RUN: ld64.lld -arch armv7 %s %p/Inputs/hello-world-armv7.yaml -o %t
# RUN: llvm-nm -m -n %t | FileCheck %s
#
# Test that armv7 (thumb) hello-world can be linked into a mach-o executable
#
--- !mach-o
arch: armv7
file-type: MH_OBJECT
flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
has-UUID: false
OS: unknown
sections:
- segment: __TEXT
section: __text
type: S_REGULAR
attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
alignment: 2
address: 0x0000000000000000
content: [ 0x80, 0xB5, 0x40, 0xF2, 0x06, 0x00, 0x6F, 0x46,
0xC0, 0xF2, 0x00, 0x00, 0x78, 0x44, 0xFF, 0xF7,
0xF8, 0xEF, 0x00, 0x20, 0x80, 0xBD ]
relocations:
- offset: 0x0000000E
type: ARM_THUMB_RELOC_BR22
length: 2
pc-rel: true
extern: true
symbol: 1
- offset: 0x00000008
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 3
pc-rel: false
value: 0x00000016
- offset: 0x00000006
scattered: true
type: ARM_RELOC_PAIR
length: 3
pc-rel: false
value: 0x0000000C
- offset: 0x00000002
scattered: true
type: ARM_RELOC_HALF_SECTDIFF
length: 2
pc-rel: false
value: 0x00000016
- offset: 0x00000000
scattered: true
type: ARM_RELOC_PAIR
length: 2
pc-rel: false
value: 0x0000000C
- segment: __TEXT
section: __cstring
type: S_CSTRING_LITERALS
attributes: [ ]
address: 0x0000000000000016
content: [ 0x68, 0x65, 0x6C, 0x6C, 0x6F, 0x0A, 0x00 ]
global-symbols:
- name: _main
type: N_SECT
scope: [ N_EXT ]
sect: 1
desc: [ N_ARM_THUMB_DEF ]
value: 0x0000000000000000
undefined-symbols:
- name: _printf
type: N_UNDF
scope: [ N_EXT ]
value: 0x0000000000000000
...
# CHECK: (undefined) external _printf (from libSystem)
# CHECK: (undefined) external dyld_stub_binder (from libSystem)
# CHECK: {{[0-9a-f]+}} (__TEXT,__text) external [Thumb] _main