Skip to content

Commit 72c3ef6

Browse files
committed
Symbol Value Name
1 parent 79e788d commit 72c3ef6

File tree

2 files changed

+112
-3
lines changed

2 files changed

+112
-3
lines changed

llvm/test/tools/llvm-readobj/XCOFF/symbols.test

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,48 @@ Symbols:
162162
SectionOrLength: 256
163163
StabInfoIndex: 44
164164
StabSectNum: 55
165+
- Name: .fun3
166+
Value: 0x0
167+
Section: N_DEBUG
168+
Type: 0x20
169+
StorageClass: C_WEAKEXT
170+
171+
- Name: stsym
172+
Value: 0x05
173+
Section: .text
174+
Type: 0x00
175+
StorageClass: C_STSYM
176+
177+
- Name: bincl
178+
Value: 0x06
179+
Section: .text
180+
Type: 0x00
181+
StorageClass: C_BINCL
182+
183+
- Name: lsym
184+
Value: 0x07
185+
Section: .text
186+
Type: 0x00
187+
StorageClass: C_LSYM
188+
189+
- Name: rsym
190+
Value: 0x08
191+
Section: .text
192+
Type: 0x00
193+
StorageClass: C_RSYM
194+
195+
- Name: ecoml
196+
Value: 0x09
197+
Section: .text
198+
Type: 0x00
199+
StorageClass: C_ECOML
200+
201+
- Name: cinfo
202+
Value: 0x02
203+
Section: .text
204+
Type: 0x00
205+
StorageClass: C_INFO
206+
165207

166208
# SYMBOL32: Symbols [
167209
# SYMBOL32-NEXT: Symbol {
@@ -368,4 +410,67 @@ Symbols:
368410
# SYMBOL32-NEXT: StabSectNum: 0x37
369411
# SYMBOL32-NEXT: }
370412
# SYMBOL32-NEXT: }
413+
# SYMBOL32-NEXT: Symbol {
414+
# SYMBOL32-NEXT: Index: 25
415+
# SYMBOL32-NEXT: Name: .fun3
416+
# SYMBOL32-NEXT: Value (RelocatableAddress): 0x0
417+
# SYMBOL32-NEXT: Section: N_DEBUG
418+
# SYMBOL32-NEXT: Type: 0x20
419+
# SYMBOL32-NEXT: StorageClass: C_WEAKEXT (0x6F)
420+
# SYMBOL32-NEXT: NumberOfAuxEntries: 0
421+
# SYMBOL32-NEXT: }
422+
# SYMBOL32-NEXT: Symbol {
423+
# SYMBOL32-NEXT: Index: 26
424+
# SYMBOL32-NEXT: Name: Unimplemented Debug Name
425+
# SYMBOL32-NEXT: Value (OffsetInCSect): 0x5
426+
# SYMBOL32-NEXT: Section: .text
427+
# SYMBOL32-NEXT: Type: 0x0
428+
# SYMBOL32-NEXT: StorageClass: C_STSYM (0x85)
429+
# SYMBOL32-NEXT: NumberOfAuxEntries: 0
430+
# SYMBOL32-NEXT: }
431+
# SYMBOL32-NEXT: Symbol {
432+
# SYMBOL32-NEXT: Index: 27
433+
# SYMBOL32-NEXT: Name: bincl
434+
# SYMBOL32-NEXT: Value (OffsetInFile): 0x6
435+
# SYMBOL32-NEXT: Section: .text
436+
# SYMBOL32-NEXT: Type: 0x0
437+
# SYMBOL32-NEXT: StorageClass: C_BINCL (0x6C)
438+
# SYMBOL32-NEXT: NumberOfAuxEntries: 0
439+
# SYMBOL32-NEXT: }
440+
# SYMBOL32-NEXT: Symbol {
441+
# SYMBOL32-NEXT: Index: 28
442+
# SYMBOL32-NEXT: Name: Unimplemented Debug Name
443+
# SYMBOL32-NEXT: Value (OffsetRelToStackFrame): 0x7
444+
# SYMBOL32-NEXT: Section: .text
445+
# SYMBOL32-NEXT: Type: 0x0
446+
# SYMBOL32-NEXT: StorageClass: C_LSYM (0x81)
447+
# SYMBOL32-NEXT: NumberOfAuxEntries: 0
448+
# SYMBOL32-NEXT: }
449+
# SYMBOL32-NEXT: Symbol {
450+
# SYMBOL32-NEXT: Index: 29
451+
# SYMBOL32-NEXT: Name: Unimplemented Debug Name
452+
# SYMBOL32-NEXT: Value (RegisterNumber): 0x8
453+
# SYMBOL32-NEXT: Section: .text
454+
# SYMBOL32-NEXT: Type: 0x0
455+
# SYMBOL32-NEXT: StorageClass: C_RSYM (0x83)
456+
# SYMBOL32-NEXT: NumberOfAuxEntries: 0
457+
# SYMBOL32-NEXT: }
458+
# SYMBOL32-NEXT: Symbol {
459+
# SYMBOL32-NEXT: Index: 30
460+
# SYMBOL32-NEXT: Name: Unimplemented Debug Name
461+
# SYMBOL32-NEXT: Value (OffsetInCommBlock): 0x9
462+
# SYMBOL32-NEXT: Section: .text
463+
# SYMBOL32-NEXT: Type: 0x0
464+
# SYMBOL32-NEXT: StorageClass: C_ECOML (0x88)
465+
# SYMBOL32-NEXT: NumberOfAuxEntries: 0
466+
# SYMBOL32-NEXT: }
467+
# SYMBOL32-NEXT: Symbol {
468+
# SYMBOL32-NEXT: Index: 31
469+
# SYMBOL32-NEXT: Name: cinfo
470+
# SYMBOL32-NEXT: Value (OffsetInCommentSection): 0x2
471+
# SYMBOL32-NEXT: Section: .text
472+
# SYMBOL32-NEXT: Type: 0x0
473+
# SYMBOL32-NEXT: StorageClass: C_INFO (0x6E)
474+
# SYMBOL32-NEXT: NumberOfAuxEntries: 0
475+
# SYMBOL32-NEXT: }
371476
# SYMBOL32-NEXT: ]

llvm/tools/llvm-readobj/XCOFFDumper.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,22 +692,26 @@ static StringRef GetSymbolValueName(XCOFF::StorageClass SC) {
692692
case XCOFF::C_BLOCK:
693693
return "Value (RelocatableAddress)";
694694
case XCOFF::C_FILE:
695+
case XCOFF::C_BSTAT:
695696
return "Value (SymbolTableIndex)";
696697
case XCOFF::C_DWARF:
697698
return "Value (OffsetInDWARF)";
698699
case XCOFF::C_FUN:
699700
case XCOFF::C_STSYM:
701+
return "Value (OffsetInCSect)";
700702
case XCOFF::C_BINCL:
701703
case XCOFF::C_EINCL:
704+
return "Value (OffsetInFile)";
702705
case XCOFF::C_INFO:
703-
case XCOFF::C_BSTAT:
706+
return "Value (OffsetInCommentSection)";
704707
case XCOFF::C_LSYM:
705708
case XCOFF::C_PSYM:
709+
return "Value (OffsetRelToStackFrame)";
706710
case XCOFF::C_RPSYM:
707711
case XCOFF::C_RSYM:
712+
return "Value (RegisterNumber)";
708713
case XCOFF::C_ECOML:
709-
assert(false && "This StorageClass for the symbol is not yet implemented.");
710-
return "";
714+
return "Value (OffsetInCommBlock)";
711715
default:
712716
return "Value";
713717
}

0 commit comments

Comments
 (0)