1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy -R .text2 %t %t2
3 # RUN: llvm-readobj --file-headers --sections --program-headers %t2 | FileCheck %s
14 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
20 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
26 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
44 #CHECK: SectionHeaderCount: 6
47 # CHECK-NEXT: Section {
48 # CHECK-NEXT: Index: 0
49 # CHECK-NEXT: Name: (0)
50 # CHECK-NEXT: Type: SHT_NULL (0x0)
51 # CHECK-NEXT: Flags [ (0x0)
53 # CHECK-NEXT: Address: 0x0
54 # CHECK-NEXT: Offset: 0x0
58 # CHECK-NEXT: AddressAlignment: 0
59 # CHECK-NEXT: EntrySize: 0
61 # CHECK-NEXT: Section {
62 # CHECK-NEXT: Index: 1
63 # CHECK-NEXT: Name: .text
64 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
65 # CHECK-NEXT: Flags [ (0x6)
66 # CHECK-NEXT: SHF_ALLOC (0x2)
67 # CHECK-NEXT: SHF_EXECINSTR (0x4)
69 # CHECK-NEXT: Address: 0x1000
70 # CHECK-NEXT: Offset: 0x1000
71 # CHECK-NEXT: Size: 4096
74 # CHECK-NEXT: AddressAlignment: 4096
75 # CHECK-NEXT: EntrySize: 0
77 # CHECK-NEXT: Section {
78 # CHECK-NEXT: Index: 2
79 # CHECK-NEXT: Name: .text3
80 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
81 # CHECK-NEXT: Flags [ (0x6)
82 # CHECK-NEXT: SHF_ALLOC (0x2)
83 # CHECK-NEXT: SHF_EXECINSTR (0x4)
85 # CHECK-NEXT: Address: 0x3000
86 # CHECK-NEXT: Offset: 0x2000
87 # CHECK-NEXT: Size: 4096
90 # CHECK-NEXT: AddressAlignment: 4096
91 # CHECK-NEXT: EntrySize: 0
93 # CHECK-NEXT: Section {
94 # CHECK-NEXT: Index: 3
95 # CHECK-NEXT: Name: .symtab
96 # CHECK-NEXT: Type: SHT_SYMTAB (0x2)
97 # CHECK-NEXT: Flags [ (0x0)
99 # CHECK-NEXT: Address: 0x0
100 # CHECK-NEXT: Offset: 0x3000
101 # CHECK-NEXT: Size: 24
102 # CHECK-NEXT: Link: 4
103 # CHECK-NEXT: Info: 1
104 # CHECK-NEXT: AddressAlignment: 8
105 # CHECK-NEXT: EntrySize: 24
107 # CHECK-NEXT: Section {
108 # CHECK-NEXT: Index: 4
109 # CHECK-NEXT: Name: .strtab
110 # CHECK-NEXT: Type: SHT_STRTAB (0x3)
111 # CHECK-NEXT: Flags [ (0x0)
113 # CHECK-NEXT: Address: 0x0
114 # CHECK-NEXT: Offset: 0x3018
116 # CHECK-NEXT: Link: 0
117 # CHECK-NEXT: Info: 0
118 # CHECK-NEXT: AddressAlignment: 1
119 # CHECK-NEXT: EntrySize: 0
121 # CHECK-NEXT: Section {
122 # CHECK-NEXT: Index: 5
123 # CHECK-NEXT: Name: .shstrtab
124 # CHECK-NEXT: Type: SHT_STRTAB (0x3)
125 # CHECK-NEXT: Flags [ (0x0)
127 # CHECK-NEXT: Address: 0x0
128 # CHECK-NEXT: Offset:
130 # CHECK-NEXT: Link: 0
131 # CHECK-NEXT: Info: 0
132 # CHECK-NEXT: AddressAlignment: 1
133 # CHECK-NEXT: EntrySize: 0
138 # CHECK: ProgramHeaders [
139 # CHECK-NEXT: ProgramHeader {
140 # CHECK-NEXT: Type: PT_LOAD (0x1)
141 # CHECK-NEXT: Offset: 0x1000
142 # CHECK-NEXT: VirtualAddress: 0x1000
143 # CHECK-NEXT: PhysicalAddress: 0x1000
144 # CHECK-NEXT: FileSize: 4096
145 # CHECK-NEXT: MemSize: 4096
146 # CHECK-NEXT: Flags [ (0x4)
147 # CHECK-NEXT: PF_R (0x4)
149 # CHECK-NEXT: Alignment: 4096
151 # CHECK-NEXT: ProgramHeader {
152 # CHECK-NEXT: Type: PT_LOAD (0x1)
153 # CHECK-NEXT: Offset: 0x2000
154 # CHECK-NEXT: VirtualAddress: 0x3000
155 # CHECK-NEXT: PhysicalAddress: 0x3000
156 # CHECK-NEXT: FileSize: 4096
157 # CHECK-NEXT: MemSize: 4096
158 # CHECK-NEXT: Flags [ (0x5)
159 # CHECK-NEXT: PF_R (0x4)
160 # CHECK-NEXT: PF_X (0x1)
162 # CHECK-NEXT: Alignment: 4096