llvm-project
24 строки · 815.0 Байт
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
3# RUN: %lld -dylib -fixup_chains -o %t %t.o
4# RUN: llvm-objdump --macho --all-headers %t | FileCheck %s
5
6## dyld always expects LC_DYLD_CHAINED_FIXUPS to point to a valid
7## chained fixups header, even if there aren't any fixups.
8# CHECK: cmd LC_DYLD_CHAINED_FIXUPS
9# CHECK-NEXT: cmdsize 16
10# CHECK-NEXT: dataoff [[#]]
11# CHECK-NEXT: datasize 48
12
13## While ld64 emits the root trie node even if there are no exports,
14## setting the data size and offset to zero works too in practice.
15# CHECK: cmd LC_DYLD_EXPORTS_TRIE
16# CHECK-NEXT: cmdsize 16
17# CHECK-NEXT: dataoff 0
18# CHECK-NEXT: datasize 0
19
20## Old load commands should not be generated.
21# CHECK-NOT: cmd LC_DYLD_INFO_ONLY
22
23_not_exported:
24.space 1
25