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 ]
43 ## TODO (grimar): without the following line (i.e. without an empty symbol table),
44 ## llvm-objcopy adds an empty .strtab section. It doesn't look correct.
47 #CHECK: SectionHeaderCount: 4
50 # CHECK-NEXT: Section {
51 # CHECK-NEXT: Index: 0
52 # CHECK-NEXT: Name: (0)
53 # CHECK-NEXT: Type: SHT_NULL (0x0)
54 # CHECK-NEXT: Flags [ (0x0)
56 # CHECK-NEXT: Address: 0x0
57 # CHECK-NEXT: Offset: 0x0
61 # CHECK-NEXT: AddressAlignment: 0
62 # CHECK-NEXT: EntrySize: 0
64 # CHECK-NEXT: Section {
65 # CHECK-NEXT: Index: 1
66 # CHECK-NEXT: Name: .text
67 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
68 # CHECK-NEXT: Flags [ (0x6)
69 # CHECK-NEXT: SHF_ALLOC (0x2)
70 # CHECK-NEXT: SHF_EXECINSTR (0x4)
72 # CHECK-NEXT: Address: 0x1000
73 # CHECK-NEXT: Offset: 0x1000
74 # CHECK-NEXT: Size: 4096
77 # CHECK-NEXT: AddressAlignment: 4096
78 # CHECK-NEXT: EntrySize: 0
80 # CHECK-NEXT: Section {
81 # CHECK-NEXT: Index: 2
82 # CHECK-NEXT: Name: .text3
83 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
84 # CHECK-NEXT: Flags [ (0x6)
85 # CHECK-NEXT: SHF_ALLOC (0x2)
86 # CHECK-NEXT: SHF_EXECINSTR (0x4)
88 # CHECK-NEXT: Address: 0x3000
89 # CHECK-NEXT: Offset: 0x2000
90 # CHECK-NEXT: Size: 4096
93 # CHECK-NEXT: AddressAlignment: 4096
94 # CHECK-NEXT: EntrySize: 0
96 # CHECK-NEXT: Section {
97 # CHECK-NEXT: Index: 3
98 # CHECK-NEXT: Name: .shstrtab
99 # CHECK-NEXT: Type: SHT_STRTAB (0x3)
100 # CHECK-NEXT: Flags [ (0x0)
102 # CHECK-NEXT: Address: 0x0
103 # CHECK-NEXT: Offset:
105 # CHECK-NEXT: Link: 0
106 # CHECK-NEXT: Info: 0
107 # CHECK-NEXT: AddressAlignment: 1
108 # CHECK-NEXT: EntrySize: 0
113 # CHECK: ProgramHeaders [
114 # CHECK-NEXT: ProgramHeader {
115 # CHECK-NEXT: Type: PT_LOAD (0x1)
116 # CHECK-NEXT: Offset: 0x1000
117 # CHECK-NEXT: VirtualAddress: 0x1000
118 # CHECK-NEXT: PhysicalAddress: 0x1000
119 # CHECK-NEXT: FileSize: 4096
120 # CHECK-NEXT: MemSize: 4096
121 # CHECK-NEXT: Flags [ (0x4)
122 # CHECK-NEXT: PF_R (0x4)
124 # CHECK-NEXT: Alignment: 4096
126 # CHECK-NEXT: ProgramHeader {
127 # CHECK-NEXT: Type: PT_LOAD (0x1)
128 # CHECK-NEXT: Offset: 0x2000
129 # CHECK-NEXT: VirtualAddress: 0x3000
130 # CHECK-NEXT: PhysicalAddress: 0x3000
131 # CHECK-NEXT: FileSize: 4096
132 # CHECK-NEXT: MemSize: 4096
133 # CHECK-NEXT: Flags [ (0x5)
134 # CHECK-NEXT: PF_R (0x4)
135 # CHECK-NEXT: PF_X (0x1)
137 # CHECK-NEXT: Alignment: 4096