[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / image-base.s
blobf6bb26400b92db80389923c7147f03b2f9713918
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 # RUN: ld.lld --image-base=0x1000000 %t -o %t1
4 # RUN: llvm-readobj -l %t1 | FileCheck %s
6 # RUN: not ld.lld --image-base=ABC %t -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
7 # ERR: error: --image-base: number expected, but got ABC
9 # RUN: ld.lld --image-base=0x1000 -z max-page-size=0x2000 %t -o %t1 2>&1 | FileCheck --check-prefix=WARN %s
10 # WARN: warning: --image-base: address isn't multiple of page size: 0x1000
12 # Check alias.
13 # RUN: ld.lld --image-base 0x1000000 %t -o %t1
14 # RUN: llvm-readobj -l %t1 | FileCheck %s
16 .global _start
17 _start:
18 nop
20 # CHECK: ProgramHeaders [
21 # CHECK-NEXT: ProgramHeader {
22 # CHECK-NEXT: Type: PT_PHDR (0x6)
23 # CHECK-NEXT: Offset: 0x40
24 # CHECK-NEXT: VirtualAddress: 0x1000040
25 # CHECK-NEXT: PhysicalAddress: 0x1000040
26 # CHECK-NEXT: FileSize: 224
27 # CHECK-NEXT: MemSize: 224
28 # CHECK-NEXT: Flags [ (0x4)
29 # CHECK-NEXT: PF_R (0x4)
30 # CHECK-NEXT: ]
31 # CHECK-NEXT: Alignment: 8
32 # CHECK-NEXT: }
33 # CHECK-NEXT: ProgramHeader {
34 # CHECK-NEXT: Type: PT_LOAD (0x1)
35 # CHECK-NEXT: Offset: 0x0
36 # CHECK-NEXT: VirtualAddress: 0x1000000
37 # CHECK-NEXT: PhysicalAddress: 0x1000000
38 # CHECK-NEXT: FileSize: 288
39 # CHECK-NEXT: MemSize: 288
40 # CHECK-NEXT: Flags [ (0x4)
41 # CHECK-NEXT: PF_R (0x4)
42 # CHECK-NEXT: ]
43 # CHECK-NEXT: Alignment: 4096
44 # CHECK-NEXT: }
45 # CHECK-NEXT: ProgramHeader {
46 # CHECK-NEXT: Type: PT_LOAD (0x1)
47 # CHECK-NEXT: Offset: 0x120
48 # CHECK-NEXT: VirtualAddress: 0x1001120
49 # CHECK-NEXT: PhysicalAddress: 0x1001120
50 # CHECK-NEXT: FileSize: 1
51 # CHECK-NEXT: MemSize: 1
52 # CHECK-NEXT: Flags [ (0x5)
53 # CHECK-NEXT: PF_R (0x4)
54 # CHECK-NEXT: PF_X (0x1)
55 # CHECK-NEXT: ]
56 # CHECK-NEXT: Alignment: 4096
57 # CHECK-NEXT: }
58 # CHECK-NEXT: ProgramHeader {
59 # CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551)
60 # CHECK-NEXT: Offset: 0x0
61 # CHECK-NEXT: VirtualAddress: 0x0
62 # CHECK-NEXT: PhysicalAddress: 0x0
63 # CHECK-NEXT: FileSize: 0
64 # CHECK-NEXT: MemSize: 0
65 # CHECK-NEXT: Flags [ (0x6)
66 # CHECK-NEXT: PF_R (0x4)
67 # CHECK-NEXT: PF_W (0x2)
68 # CHECK-NEXT: ]
69 # CHECK-NEXT: Alignment: 0
70 # CHECK-NEXT: }