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 ]
41 ## TODO (grimar): without the following line (i.e. without an empty symbol table),
42 ## llvm-objcopy adds an empty .strtab section. It doesn't look correct.
45 #CHECK: SectionHeaderCount: 4
48 # CHECK-NEXT: Section {
49 # CHECK-NEXT: Index: 0
50 # CHECK-NEXT: Name: (0)
51 # CHECK-NEXT: Type: SHT_NULL (0x0)
52 # CHECK-NEXT: Flags [ (0x0)
54 # CHECK-NEXT: Address: 0x0
55 # CHECK-NEXT: Offset: 0x0
59 # CHECK-NEXT: AddressAlignment: 0
60 # CHECK-NEXT: EntrySize: 0
62 # CHECK-NEXT: Section {
63 # CHECK-NEXT: Index: 1
64 # CHECK-NEXT: Name: .text
65 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
66 # CHECK-NEXT: Flags [ (0x6)
67 # CHECK-NEXT: SHF_ALLOC (0x2)
68 # CHECK-NEXT: SHF_EXECINSTR (0x4)
70 # CHECK-NEXT: Address: 0x1000
71 # CHECK-NEXT: Offset: 0x1000
72 # CHECK-NEXT: Size: 4096
75 # CHECK-NEXT: AddressAlignment: 4096
76 # CHECK-NEXT: EntrySize: 0
78 # CHECK-NEXT: Section {
79 # CHECK-NEXT: Index: 2
80 # CHECK-NEXT: Name: .text3
81 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
82 # CHECK-NEXT: Flags [ (0x6)
83 # CHECK-NEXT: SHF_ALLOC (0x2)
84 # CHECK-NEXT: SHF_EXECINSTR (0x4)
86 # CHECK-NEXT: Address: 0x3000
87 # CHECK-NEXT: Offset: 0x2000
88 # CHECK-NEXT: Size: 4096
91 # CHECK-NEXT: AddressAlignment: 4096
92 # CHECK-NEXT: EntrySize: 0
94 # CHECK-NEXT: Section {
95 # CHECK-NEXT: Index: 3
96 # CHECK-NEXT: Name: .shstrtab
97 # CHECK-NEXT: Type: SHT_STRTAB (0x3)
98 # CHECK-NEXT: Flags [ (0x0)
100 # CHECK-NEXT: Address: 0x0
101 # CHECK-NEXT: Offset:
103 # CHECK-NEXT: Link: 0
104 # CHECK-NEXT: Info: 0
105 # CHECK-NEXT: AddressAlignment: 1
106 # CHECK-NEXT: EntrySize: 0
111 # CHECK: ProgramHeaders [
112 # CHECK-NEXT: ProgramHeader {
113 # CHECK-NEXT: Type: PT_LOAD (0x1)
114 # CHECK-NEXT: Offset: 0x1000
115 # CHECK-NEXT: VirtualAddress: 0x1000
116 # CHECK-NEXT: PhysicalAddress: 0x1000
117 # CHECK-NEXT: FileSize: 4096
118 # CHECK-NEXT: MemSize: 4096
119 # CHECK-NEXT: Flags [ (0x4)
120 # CHECK-NEXT: PF_R (0x4)
122 # CHECK-NEXT: Alignment: 4096
124 # CHECK-NEXT: ProgramHeader {
125 # CHECK-NEXT: Type: PT_LOAD (0x1)
126 # CHECK-NEXT: Offset: 0x2000
127 # CHECK-NEXT: VirtualAddress: 0x3000
128 # CHECK-NEXT: PhysicalAddress: 0x3000
129 # CHECK-NEXT: FileSize: 4096
130 # CHECK-NEXT: MemSize: 4096
131 # CHECK-NEXT: Flags [ (0x5)
132 # CHECK-NEXT: PF_R (0x4)
133 # CHECK-NEXT: PF_X (0x1)
135 # CHECK-NEXT: Alignment: 4096