PIE.yaml
1.24 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
# RUN: ld64.lld -arch x86_64 -macosx_version_min 10.8 %s \
# RUN: %p/Inputs/PIE.yaml -o %t && \
# RUN: llvm-objdump -macho -private-headers %t | FileCheck %s
#
# RUN: ld64.lld -arch x86_64 -macosx_version_min 10.8 %s \
# RUN: %p/Inputs/PIE.yaml -pie -o %t\
# RUN: && llvm-objdump -macho -private-headers %t | FileCheck %s
#
# RUN: ld64.lld -arch x86_64 -macosx_version_min 10.8 %s \
# RUN: %p/Inputs/PIE.yaml -no_pie -o %t\
# RUN: && llvm-objdump -macho -private-headers %t \
# RUN: | FileCheck --check-prefix=CHECK_NO_PIE %s
#
# Test various PIE options.
#
--- !mach-o
arch: x86_64
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 ]
address: 0x0000000000000000
content: [ 0xC3 ]
global-symbols:
- name: _main
type: N_SECT
scope: [ N_EXT ]
sect: 1
value: 0x0000000000000000
...
# CHECK: MH_MAGIC_64 {{[0-9a-zA-Z _]+}} TWOLEVEL PIE
# CHECK_NO_PIE-NOT: MH_MAGIC_64 {{[0-9a-zA-Z _]+}} TWOLEVEL PIE