2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # Test that we warn when a page size is set and paging is disabled by -n or -N.
6 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 -N %t -o %t2 2>&1 | FileCheck --check-prefix=WARN %s
7 # RUN: llvm-readobj --program-headers %t2 | FileCheck --check-prefix=OMAGIC %s
8 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 --omagic %t -o %t2 2>&1 | FileCheck --check-prefix=WARN %s
9 # RUN: llvm-readobj --program-headers %t2 | FileCheck --check-prefix=OMAGIC %s
11 # WARN: ld.lld: warning: -z max-page-size set, but paging disabled by omagic or nmagic
12 # WARN-NEXT: ld.lld: warning: -z common-page-size set, but paging disabled by omagic or nmagic
14 # OMAGIC: ProgramHeader {
15 # OMAGIC: Type: PT_LOAD
16 # OMAGIC-NEXT: Offset: 0xB0
17 # OMAGIC-NEXT: VirtualAddress:
18 # OMAGIC-NEXT: PhysicalAddress:
19 # OMAGIC-NEXT: FileSize:
20 # OMAGIC-NEXT: MemSize:
21 # OMAGIC-NEXT: Flags [
26 # OMAGIC-NEXT: Alignment: 4
28 # OMAGIC-NEXT: ProgramHeader {
29 # OMAGIC-NEXT: Type: PT_GNU_STACK
31 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 -n %t -o %t3 2>&1 | FileCheck --check-prefix=WARN %s
32 # RUN: llvm-readobj --program-headers %t3 | FileCheck --check-prefix=NMAGIC %s
33 # RUN: ld.lld -z max-page-size=0x10 -z common-page-size=0x10 --nmagic %t -o %t3 2>&1 | FileCheck --check-prefix=WARN %s
34 # RUN: llvm-readobj --program-headers %t3 | FileCheck --check-prefix=NMAGIC %s
36 # NMAGIC: ProgramHeader {
37 # NMAGIC-NEXT: Type: PT_LOAD
38 # NMAGIC-NEXT: Offset: 0x120
39 # NMAGIC-NEXT: VirtualAddress:
40 # NMAGIC-NEXT: PhysicalAddress:
41 # NMAGIC-NEXT: FileSize: 1
42 # NMAGIC-NEXT: MemSize: 1
43 # NMAGIC-NEXT: Flags [
46 # NMAGIC-NEXT: Alignment: 1
48 # NMAGIC-NEXT: ProgramHeader {
49 # NMAGIC-NEXT: Type: PT_LOAD
50 # NMAGIC-NEXT: Offset: 0x124
51 # NMAGIC-NEXT: VirtualAddress:
52 # NMAGIC-NEXT: PhysicalAddress:
53 # NMAGIC-NEXT: FileSize: 2
54 # NMAGIC-NEXT: MemSize: 2
55 # NMAGIC-NEXT: Flags [
59 # NMAGIC-NEXT: Alignment: 4
61 # NMAGIC-NEXT: ProgramHeader {
62 # NMAGIC-NEXT: Type: PT_LOAD (0x1)
63 # NMAGIC-NEXT: Offset: 0x126
64 # NMAGIC-NEXT: VirtualAddress:
65 # NMAGIC-NEXT: PhysicalAddress:
66 # NMAGIC-NEXT: FileSize: 1
67 # NMAGIC-NEXT: MemSize: 1
68 # NMAGIC-NEXT: Flags [
72 # NMAGIC-NEXT: Alignment: 1