File tree Expand file tree Collapse file tree 2 files changed +61
-1
lines changed
test/tools/llvm-objdump/XCOFF Expand file tree Collapse file tree 2 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -1288,7 +1288,11 @@ Expected<bool> XCOFFSymbolRef::isFunction() const {
1288
1288
if (CsectAuxRef.getSymbolType () == XCOFF::XTY_LD)
1289
1289
return true ;
1290
1290
1291
- return createError (" csect symbol has no valid symbol type." );
1291
+ return createError (
1292
+ " Symbol csect aux entry with index " +
1293
+ Twine (getObject ()->getSymbolIndex (CsectAuxRef.getEntryAddress ())) +
1294
+ " has invalid symbol type " +
1295
+ Twine::utohexstr (CsectAuxRef.getSymbolType ()));
1292
1296
}
1293
1297
1294
1298
bool XCOFFSymbolRef::isCsectSymbol () const {
Original file line number Diff line number Diff line change
1
+ ## Check that llvm-objdump --syms reports an error when
2
+ ## the symbol type in the csect aux entry of a symbol is not valid.
3
+
4
+ ## Check XCOFF32
5
+ # RUN: yaml2obj --docnum=1 %s -o %t1
6
+ # RUN: not llvm-objdump --syms %t1 2>&1 | FileCheck %s -DOBJ=%t1 --check-prefix=XCOFF32
7
+
8
+ # XCOFF32: error: '[[OBJ]]': Symbol csect aux entry with index 2 has invalid symbol type 5
9
+
10
+ --- !XCOFF
11
+ FileHeader:
12
+ MagicNumber: 0x1DF
13
+ Sections:
14
+ - Name: .text
15
+ Flags: [ STYP_TEXT ]
16
+ Symbols:
17
+ - Name: .file
18
+ Section: N_DEBUG
19
+ NumberOfAuxEntries: 0
20
+ Type: 0x0
21
+ StorageClass: C_FILE
22
+ - Name: test
23
+ Section: .text
24
+ NumberOfAuxEntries: 1
25
+ StorageClass: C_EXT
26
+ AuxEntries:
27
+ - Type: AUX_CSECT
28
+ SymbolAlignmentAndType: 5
29
+ StorageMappingClass: XMC_PR
30
+
31
+ ## Check XCOFF64
32
+ # RUN: yaml2obj --docnum=2 %s -o %t2
33
+ # RUN: not llvm-objdump --syms %t2 2>&1 | FileCheck %s -DOBJ=%t2 --check-prefix=XCOFF64
34
+
35
+ # XCOFF64: error: '[[OBJ]]': Symbol csect aux entry with index 2 has invalid symbol type 5
36
+
37
+ --- !XCOFF
38
+ FileHeader:
39
+ MagicNumber: 0x1F7
40
+ Sections:
41
+ - Name: .text
42
+ Flags: [ STYP_TEXT ]
43
+ Symbols:
44
+ - Name: .file
45
+ Section: N_DEBUG
46
+ NumberOfAuxEntries: 0
47
+ Type: 0x0
48
+ StorageClass: C_FILE
49
+ - Name: test
50
+ Section: .text
51
+ NumberOfAuxEntries: 1
52
+ StorageClass: C_EXT
53
+ AuxEntries:
54
+ - Type: AUX_CSECT
55
+ SymbolAlignmentAndType: 5
56
+ StorageMappingClass: XMC_PR
You can’t perform that action at this time.
0 commit comments