1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
| RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.coff-i386 \
RUN: | FileCheck %s -check-prefix COFF
RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.elf-i386 \
RUN: | FileCheck %s -check-prefix ELF
RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.wasm \
RUN: | FileCheck %s -check-prefix WASM
# Check flag aliases produce identical output.
RUN: llvm-readobj --symbols %p/Inputs/trivial.obj.elf-i386 > %t.symbols
RUN: llvm-readobj --syms %p/Inputs/trivial.obj.elf-i386 > %t.syms
RUN: cmp %t.symbols %t.syms
RUN: llvm-readobj -t %p/Inputs/trivial.obj.elf-i386 > %t.t
RUN: cmp %t.symbols %t.t
RUN: llvm-readelf -s -elf-output-style LLVM %p/Inputs/trivial.obj.elf-i386 > %t.lowers
RUN: cmp %t.symbols %t.lowers
COFF: Symbols [
COFF-NEXT: Symbol {
COFF-NEXT: Name: @comp.id
COFF-NEXT: Value: 14766605
COFF-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
COFF-NEXT: BaseType: Null (0x0)
COFF-NEXT: ComplexType: Null (0x0)
COFF-NEXT: StorageClass: Static (0x3)
COFF-NEXT: AuxSymbolCount: 0
COFF-NEXT: }
COFF-NEXT: Symbol {
COFF-NEXT: Name: @feat.00
COFF-NEXT: Value: 2147484049
COFF-NEXT: Section: IMAGE_SYM_ABSOLUTE (-1)
COFF-NEXT: BaseType: Null (0x0)
COFF-NEXT: ComplexType: Null (0x0)
COFF-NEXT: StorageClass: Static (0x3)
COFF-NEXT: AuxSymbolCount: 0
COFF-NEXT: }
COFF-NEXT: Symbol {
COFF-NEXT: Name: .text
COFF-NEXT: Value: 0
COFF-NEXT: Section: .text (1)
COFF-NEXT: BaseType: Null (0x0)
COFF-NEXT: ComplexType: Null (0x0)
COFF-NEXT: StorageClass: Static (0x3)
COFF-NEXT: AuxSymbolCount: 1
COFF-NEXT: AuxSectionDef {
COFF-NEXT: Length: 22
COFF-NEXT: RelocationCount: 3
COFF-NEXT: LineNumberCount: 0
COFF-NEXT: Checksum: 0x0
COFF-NEXT: Number: 1
COFF-NEXT: Selection: 0x0
COFF-NEXT: }
COFF-NEXT: }
ELF: Symbols [
ELF-NEXT: Symbol {
ELF-NEXT: Name: (0)
ELF-NEXT: Value: 0x0
ELF-NEXT: Size: 0
ELF-NEXT: Binding: Local (0x0)
ELF-NEXT: Type: None (0x0)
ELF-NEXT: Other: 0
ELF-NEXT: Section: Undefined (0x0)
ELF-NEXT: }
ELF-NEXT: Symbol {
ELF-NEXT: Name: trivial.ll (1)
ELF-NEXT: Value: 0x0
ELF-NEXT: Size: 0
ELF-NEXT: Binding: Local (0x0)
ELF-NEXT: Type: File (0x4)
ELF-NEXT: Other: 0
ELF-NEXT: Section: Absolute (0xFFF1)
ELF-NEXT: }
ELF-NEXT: Symbol {
ELF-NEXT: Name: .L.str (39)
ELF-NEXT: Value: 0x0
ELF-NEXT: Size: 13
ELF-NEXT: Binding: Local (0x0)
ELF-NEXT: Type: Object (0x1)
ELF-NEXT: Other: 0
ELF-NEXT: Section: .rodata.str1.1 (0x5)
ELF-NEXT: }
WASM: Symbols [
WASM-NEXT: Symbol {
WASM-NEXT: Name: main
WASM-NEXT: Type: FUNCTION (0x0)
WASM-NEXT: Flags [ (0x0)
WASM-NEXT: ]
WASM-NEXT: ElementIndex: 0x2
WASM-NEXT: }
WASM-NEXT: Symbol {
WASM-NEXT: Name: .L.str
WASM-NEXT: Type: DATA (0x1)
WASM-NEXT: Flags [ (0x2)
WASM-NEXT: BINDING_LOCAL (0x2)
WASM-NEXT: ]
WASM-NEXT: Offset: 0x0
WASM-NEXT: Segment: 0x0
WASM-NEXT: Size: 0xD
WASM-NEXT: }
WASM-NEXT: Symbol {
WASM-NEXT: Name: puts
WASM-NEXT: Type: FUNCTION (0x0)
WASM-NEXT: Flags [ (0x10)
WASM-NEXT: UNDEFINED (0x10)
WASM-NEXT: ]
WASM-NEXT: ImportName: puts
WASM-NEXT: ImportModule: env
WASM-NEXT: ElementIndex: 0x0
WASM-NEXT: }
WASM-NEXT: Symbol {
WASM-NEXT: Name: .LSomeOtherFunction_bitcast
WASM-NEXT: Type: FUNCTION (0x0)
WASM-NEXT: Flags [ (0x2)
WASM-NEXT: BINDING_LOCAL (0x2)
WASM-NEXT: ]
WASM-NEXT: ElementIndex: 0x3
WASM-NEXT: }
WASM-NEXT: Symbol {
WASM-NEXT: Name: SomeOtherFunction
WASM-NEXT: Type: FUNCTION (0x0)
WASM-NEXT: Flags [ (0x10)
WASM-NEXT: UNDEFINED (0x10)
WASM-NEXT: ]
WASM-NEXT: ImportName: SomeOtherFunction
WASM-NEXT: ImportModule: env
WASM-NEXT: ElementIndex: 0x1
WASM-NEXT: }
WASM-NEXT: ]
|