mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-24 19:44:49 +00:00
llvm-readobj: Add test for COFF auxiliary symbols as used by C++/CLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
960c80d8a9
commit
23653b1265
2
test/tools/llvm-readobj/Inputs/cxx-cli-aux.cpp
Normal file
2
test/tools/llvm-readobj/Inputs/cxx-cli-aux.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
// cl.exe -clr -c t.cpp -Fo"cxx-cli-aux.obj.coff-i386"
|
||||
__declspec(appdomain) int PerAppDomain = 0;
|
BIN
test/tools/llvm-readobj/Inputs/cxx-cli-aux.obj.coff-i386
Normal file
BIN
test/tools/llvm-readobj/Inputs/cxx-cli-aux.obj.coff-i386
Normal file
Binary file not shown.
42
test/tools/llvm-readobj/cxx-cli-aux.test
Normal file
42
test/tools/llvm-readobj/cxx-cli-aux.test
Normal file
@ -0,0 +1,42 @@
|
||||
Ensure that we can read the COFF auxiliary symbols 'section definition' and
|
||||
'CLR token definition' as used in C++/CLI object files. Auxiliary section
|
||||
definitions usually only follow a symbol with static storage class, but
|
||||
non-const appdomain globals (external ABS) also get one.
|
||||
|
||||
RUN: llvm-readobj -t %p/Inputs/cxx-cli-aux.obj.coff-i386 | FileCheck %s
|
||||
|
||||
CHECK: Symbols [
|
||||
CHECK: Symbol {
|
||||
CHECK: Name: ?PerAppDomain@@$$Q3HA
|
||||
CHECK-NEXT: Value: 4
|
||||
CHECK-NEXT: Section: (65535)
|
||||
CHECK-NEXT: BaseType: Null (0x0)
|
||||
CHECK-NEXT: ComplexType: Null (0x0)
|
||||
CHECK-NEXT: StorageClass: External (0x2)
|
||||
CHECK-NEXT: AuxSymbolCount: 1
|
||||
CHECK-NEXT: AuxSectionDef {
|
||||
CHECK-NEXT: Length: 0
|
||||
CHECK-NEXT: RelocationCount: 0
|
||||
CHECK-NEXT: LineNumberCount: 0
|
||||
CHECK-NEXT: Checksum: 0x0
|
||||
CHECK-NEXT: Number: 0
|
||||
CHECK-NEXT: Selection: NoDuplicates (0x1)
|
||||
CHECK-NEXT: Unused: (00 00 00)
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: }
|
||||
|
||||
CHECK: Symbol {
|
||||
CHECK: Name: 04000001
|
||||
CHECK-NEXT: Value: 4
|
||||
CHECK-NEXT: Section: (65535)
|
||||
CHECK-NEXT: BaseType: Null (0x0)
|
||||
CHECK-NEXT: ComplexType: Null (0x0)
|
||||
CHECK-NEXT: StorageClass: CLRToken (0x6B)
|
||||
CHECK-NEXT: AuxSymbolCount: 1
|
||||
CHECK-NEXT: AuxCLRToken {
|
||||
CHECK-NEXT: AuxType: 1
|
||||
CHECK-NEXT: Reserved: 0
|
||||
CHECK-NEXT: SymbolTableIndex: 19
|
||||
CHECK-NEXT: Unused: (00 00 00 00 00 00 00 00 00 00 00 00)
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: }
|
@ -1022,9 +1022,11 @@ void COFFDumper::printSymbol(symbol_iterator SymI) {
|
||||
DictScope AS(W, "AuxFileRecord");
|
||||
W.printString("FileName", StringRef(Aux->FileName));
|
||||
|
||||
// C++/CLI creates external ABS symbols for non-const appdomain globals.
|
||||
// These are also followed by an auxiliary section definition.
|
||||
} else if (Symbol->StorageClass == COFF::IMAGE_SYM_CLASS_STATIC ||
|
||||
(Symbol->StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL &&
|
||||
Symbol->SectionNumber != COFF::IMAGE_SYM_UNDEFINED)) {
|
||||
Symbol->SectionNumber == COFF::IMAGE_SYM_ABSOLUTE)) {
|
||||
const coff_aux_section_definition *Aux;
|
||||
if (error(getSymbolAuxData(Obj, Symbol + I, Aux)))
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user