1 # RUN: yaml2obj %s -o %t.o
2 # Preserve input to verify it is not modified.
3 # RUN: cp %t.o %t-copy.o
4 # RUN: llvm-objcopy %t.o -O elf64-x86-64 %t.2.o
5 # RUN: llvm-readobj --sections --symbols %t.2.o | FileCheck %s
6 # RUN: cmp %t.o %t-copy.o
17 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
38 # CHECK-NEXT: Section {
39 # CHECK-NEXT: Index: 0
40 # CHECK-NEXT: Name: (0)
41 # CHECK-NEXT: Type: SHT_NULL (0x0)
42 # CHECK-NEXT: Flags [ (0x0)
44 # CHECK-NEXT: Address:
49 # CHECK-NEXT: AddressAlignment: 0
50 # CHECK-NEXT: EntrySize: 0
52 # CHECK-NEXT: Section {
53 # CHECK-NEXT: Index: 1
54 # CHECK-NEXT: Name: .text
55 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
56 # CHECK-NEXT: Flags [ (0x6)
57 # CHECK-NEXT: SHF_ALLOC (0x2)
58 # CHECK-NEXT: SHF_EXECINSTR (0x4)
60 # CHECK-NEXT: Address:
62 # CHECK-NEXT: Size: 32
65 # CHECK-NEXT: AddressAlignment: 0
66 # CHECK-NEXT: EntrySize: 0
68 # CHECK-NEXT: Section {
69 # CHECK-NEXT: Index: 2
70 # CHECK-NEXT: Name: .data
71 # CHECK-NEXT: Type: SHT_PROGBITS (0x1)
72 # CHECK-NEXT: Flags [ (0x2)
73 # CHECK-NEXT: SHF_ALLOC (0x2)
75 # CHECK-NEXT: Address:
77 # CHECK-NEXT: Size: 16
80 # CHECK-NEXT: AddressAlignment: 0
81 # CHECK-NEXT: EntrySize: 0
83 # CHECK-NEXT: Section {
84 # CHECK-NEXT: Index: 3
85 # CHECK-NEXT: Name: .symtab
86 # CHECK-NEXT: Type: SHT_SYMTAB (0x2)
87 # CHECK-NEXT: Flags [ (0x0)
89 # CHECK-NEXT: Address:
91 # CHECK-NEXT: Size: 72
94 # CHECK-NEXT: AddressAlignment: 8
95 # CHECK-NEXT: EntrySize: 24
97 # CHECK-NEXT: Section {
98 # CHECK-NEXT: Index: 4
99 # CHECK-NEXT: Name: .strtab
100 # CHECK-NEXT: Type: SHT_STRTAB (0x3)
101 # CHECK-NEXT: Flags [ (0x0)
103 # CHECK-NEXT: Address:
104 # CHECK-NEXT: Offset:
105 # CHECK-NEXT: Size: 9
106 # CHECK-NEXT: Link: 0
107 # CHECK-NEXT: Info: 0
108 # CHECK-NEXT: AddressAlignment: 1
109 # CHECK-NEXT: EntrySize: 0
111 # CHECK-NEXT: Section {
112 # CHECK-NEXT: Index: 5
113 # CHECK-NEXT: Name: .shstrtab
114 # CHECK-NEXT: Type: SHT_STRTAB (0x3)
115 # CHECK-NEXT: Flags [ (0x0)
117 # CHECK-NEXT: Address:
118 # CHECK-NEXT: Offset:
119 # CHECK-NEXT: Size: 39
120 # CHECK-NEXT: Link: 0
121 # CHECK-NEXT: Info: 0
122 # CHECK-NEXT: AddressAlignment: 1
123 # CHECK-NEXT: EntrySize: 0
126 # CHECK-NEXT: Symbols [
127 # CHECK-NEXT: Symbol {
129 # CHECK-NEXT: Value: 0x0
130 # CHECK-NEXT: Size: 0
131 # CHECK-NEXT: Binding: Local (0x0)
132 # CHECK-NEXT: Type: None (0x0)
133 # CHECK-NEXT: Other: 0
134 # CHECK-NEXT: Section: Undefined
136 # CHECK-NEXT: Symbol {
137 # CHECK-NEXT: Name: foo
138 # CHECK-NEXT: Value: 0x10
139 # CHECK-NEXT: Size: 8
140 # CHECK-NEXT: Binding: Global (0x1)
141 # CHECK-NEXT: Type: Function (0x2)
142 # CHECK-NEXT: Other: 0
143 # CHECK-NEXT: Section: .text
145 # CHECK-NEXT: Symbol {
146 # CHECK-NEXT: Name: bar
147 # CHECK-NEXT: Value: 0x0
148 # CHECK-NEXT: Size: 16
149 # CHECK-NEXT: Binding: Global (0x1)
150 # CHECK-NEXT: Type: Object (0x1)
151 # CHECK-NEXT: Other: 0
152 # CHECK-NEXT: Section: .data