2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
5 # RUN: ld.lld %t1.o -o %t
6 # RUN: llvm-readobj --file-headers --sections -l --symbols -r %t \
7 # RUN: | FileCheck %s --check-prefix=NOPIE
10 # RUN: ld.lld -pie %t1.o -o %t
11 # RUN: llvm-readobj --file-headers --sections -l -d --symbols -r %t | FileCheck %s
13 ## Test --pic-executable alias
14 # RUN: ld.lld --pic-executable %t1.o -o %t
15 # RUN: llvm-readobj --file-headers --sections -l -d --symbols -r %t | FileCheck %s
19 # CHECK-NEXT: Magic: (7F 45 4C 46)
20 # CHECK-NEXT: Class: 64-bit
21 # CHECK-NEXT: DataEncoding: LittleEndian
22 # CHECK-NEXT: FileVersion: 1
23 # CHECK-NEXT: OS/ABI: SystemV
24 # CHECK-NEXT: ABIVersion: 0
25 # CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
27 # CHECK-NEXT: Type: SharedObject
29 # CHECK: ProgramHeaders [
30 # CHECK-NEXT: ProgramHeader {
31 # CHECK-NEXT: Type: PT_PHDR
32 # CHECK-NEXT: Offset: 0x40
33 # CHECK-NEXT: VirtualAddress: 0x40
34 # CHECK-NEXT: PhysicalAddress: 0x40
35 # CHECK-NEXT: FileSize:
36 # CHECK-NEXT: MemSize:
40 # CHECK-NEXT: Alignment: 8
42 # CHECK-NEXT: ProgramHeader {
43 # CHECK-NEXT: Type: PT_LOAD
44 # CHECK-NEXT: Offset: 0x0
45 # CHECK-NEXT: VirtualAddress: 0x0
46 # CHECK-NEXT: PhysicalAddress: 0x0
48 # CHECK: Type: PT_DYNAMIC
50 # CHECK: DynamicSection [
51 # CHECK: 0x000000006FFFFFFB FLAGS_1 PIE
54 # RUN: ld.lld -no-pie %t1.o -o %t2
55 # RUN: llvm-readobj --file-headers -r %t2 | FileCheck %s --check-prefix=NOPIE
56 # NOPIE-NOT: Type: SharedObject