[Clang] replace 'bitfield' with 'bit-field' for consistency (#117881)
[llvm-project.git] / lld / test / ELF / avoid-empty-program-headers.s
blob4714ea9edcaa900febc32901739b741338e1d903
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 // RUN: ld.lld %t -o %tout
4 // RUN: llvm-readobj -l %tout | FileCheck %s
6 .global _start
7 _start:
8 retq
10 .section .tbss,"awT",@nobits
11 .zero 4
12 // FIXME: Test that we don't create unecessary empty PT_LOAD and PT_GNU_RELRO
13 // for the .tbss section.
15 // CHECK: ProgramHeaders [
16 // CHECK-NEXT: ProgramHeader {
17 // CHECK-NEXT: Type: PT_PHDR (0x6)
18 // CHECK-NEXT: Offset: 0x40
19 // CHECK-NEXT: VirtualAddress: 0x200040
20 // CHECK-NEXT: PhysicalAddress: 0x200040
21 // CHECK-NEXT: FileSize: 280
22 // CHECK-NEXT: MemSize: 280
23 // CHECK-NEXT: Flags [ (0x4)
24 // CHECK-NEXT: PF_R (0x4)
25 // CHECK-NEXT: ]
26 // CHECK-NEXT: Alignment: 8
27 // CHECK-NEXT: }
28 // CHECK-NEXT: ProgramHeader {
29 // CHECK-NEXT: Type: PT_LOAD (0x1)
30 // CHECK-NEXT: Offset: 0x0
31 // CHECK-NEXT: VirtualAddress: 0x200000
32 // CHECK-NEXT: PhysicalAddress: 0x200000
33 // CHECK-NEXT: FileSize: 344
34 // CHECK-NEXT: MemSize: 344
35 // CHECK-NEXT: Flags [ (0x4)
36 // CHECK-NEXT: PF_R (0x4)
37 // CHECK-NEXT: ]
38 // CHECK-NEXT: Alignment: 4096
39 // CHECK-NEXT: }
40 // CHECK-NEXT: ProgramHeader {
41 // CHECK-NEXT: Type: PT_LOAD (0x1)
42 // CHECK-NEXT: Offset: 0x158
43 // CHECK-NEXT: VirtualAddress: 0x201158
44 // CHECK-NEXT: PhysicalAddress: 0x201158
45 // CHECK-NEXT: FileSize: 1
46 // CHECK-NEXT: MemSize: 1
47 // CHECK-NEXT: Flags [ (0x5)
48 // CHECK-NEXT: PF_R (0x4)
49 // CHECK-NEXT: PF_X (0x1)
50 // CHECK-NEXT: ]
51 // CHECK-NEXT: Alignment: 4096
52 // CHECK-NEXT: }
53 // CHECK-NEXT: ProgramHeader {
54 // CHECK-NEXT: Type: PT_TLS (0x7)
55 // CHECK-NEXT: Offset: 0x159
56 // CHECK-NEXT: VirtualAddress: 0x201159
57 // CHECK-NEXT: PhysicalAddress: 0x201159
58 // CHECK-NEXT: FileSize: 0
59 // CHECK-NEXT: MemSize: 4
60 // CHECK-NEXT: Flags [ (0x4)
61 // CHECK-NEXT: PF_R (0x4)
62 // CHECK-NEXT: ]
63 // CHECK-NEXT: Alignment: 1
64 // CHECK-NEXT: }
65 // CHECK-NEXT: ProgramHeader {
66 // CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551)
67 // CHECK-NEXT: Offset: 0x0
68 // CHECK-NEXT: VirtualAddress: 0x0
69 // CHECK-NEXT: PhysicalAddress: 0x0
70 // CHECK-NEXT: FileSize: 0
71 // CHECK-NEXT: MemSize: 0
72 // CHECK-NEXT: Flags [ (0x6)
73 // CHECK-NEXT: PF_R (0x4)
74 // CHECK-NEXT: PF_W (0x2)
75 // CHECK-NEXT: ]
76 // CHECK-NEXT: Alignment: 0
77 // CHECK-NEXT: }
78 // CHECK-NEXT: ]