2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux /dev/null -o %t.o
3 # RUN: ld.lld --hash-style=sysv -o %t.so --script %s %t.o -shared
4 # RUN: llvm-readobj -l %t.so | FileCheck %s
6 PHDRS { all PT_LOAD PHDRS; }
9 . = 0x2000 + SIZEOF_HEADERS;
10 .text : {*(.text)} :all
13 # CHECK: ProgramHeaders [
14 # CHECK-NEXT: ProgramHeader {
15 # CHECK-NEXT: Type: PT_LOAD
16 # CHECK-NEXT: Offset: 0x40
17 # CHECK-NEXT: VirtualAddress: 0x2040
18 # CHECK-NEXT: PhysicalAddress: 0x2040
19 # CHECK-NEXT: FileSize: 200
20 # CHECK-NEXT: MemSize: 200
22 # CHECK-NEXT: PF_R (0x4)
23 # CHECK-NEXT: PF_W (0x2)
24 # CHECK-NEXT: PF_X (0x1)
26 # CHECK-NEXT: Alignment: 4096
30 # RUN: ld.lld --hash-style=sysv -o %t2.so --script %s %t.o -shared -z max-page-size=0x2000
31 # RUN: llvm-readobj -l %t2.so \
32 # RUN: | FileCheck --check-prefix=MAXPAGE %s
34 # MAXPAGE: ProgramHeaders [
35 # MAXPAGE-NEXT: ProgramHeader {
36 # MAXPAGE-NEXT: Type: PT_LOAD
37 # MAXPAGE-NEXT: Offset: 0x40
38 # MAXPAGE-NEXT: VirtualAddress: 0x2040
39 # MAXPAGE-NEXT: PhysicalAddress: 0x2040
40 # MAXPAGE-NEXT: FileSize: 200
41 # MAXPAGE-NEXT: MemSize: 200
42 # MAXPAGE-NEXT: Flags [
47 # MAXPAGE-NEXT: Alignment: 8192