mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
llvm-objdump: support dumping AUX records for weak externals
This is a support COFF feature. Ensure that we can display the weak externals auxiliary symbol. It contains useful information (such as the default binding and how to resolve the symbol). This reapplies the previous patch with a modification which hopefully should fix the endianness issues. The variadic call would promote the ulittle32_t to a uint32_t which would lose the byte-swapping behaviour desired. llvm-svn: 270813
This commit is contained in:
parent
1c0a9b72a0
commit
a8d68795c3
Binary file not shown.
26
test/Object/Inputs/COFF/weak-externals.yaml
Normal file
26
test/Object/Inputs/COFF/weak-externals.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
header:
|
||||
Machine: IMAGE_FILE_MACHINE_ARMNT
|
||||
Characteristics: [ ]
|
||||
sections:
|
||||
- Name: .rdata
|
||||
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
|
||||
Alignment: 1
|
||||
SectionData: ''
|
||||
symbols:
|
||||
- Name: Function
|
||||
Value: 0
|
||||
SectionNumber: 0
|
||||
SimpleType: IMAGE_SYM_TYPE_NULL
|
||||
ComplexType: IMAGE_SYM_DTYPE_NULL
|
||||
StorageClass: IMAGE_SYM_CLASS_WEAK_EXTERNAL
|
||||
WeakExternal:
|
||||
TagIndex: 9
|
||||
Characteristics: IMAGE_WEAK_EXTERN_SEARCH_LIBRARY
|
||||
- Name: .weak.Function.default
|
||||
Value: 0
|
||||
SectionNumber: -1
|
||||
SimpleType: IMAGE_SYM_TYPE_NULL
|
||||
ComplexType: IMAGE_SYM_DTYPE_NULL
|
||||
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
||||
...
|
5
test/Object/coff-weak-externals.test
Normal file
5
test/Object/coff-weak-externals.test
Normal file
@ -0,0 +1,5 @@
|
||||
RUN: yaml2obj %p/Inputs/COFF/weak-externals.yaml | llvm-objdump -t - | FileCheck %s
|
||||
|
||||
CHECK: [ 0](sec 0)(fl 0x00)(ty 0)(scl 69) (nx 1) 0x00000000 Function
|
||||
CHECK: AUX indx 9 srch 2
|
||||
|
@ -653,6 +653,13 @@ void llvm::printCOFFSymbolTable(const COFFObjectFile *coff) {
|
||||
|
||||
SI = SI + Symbol->getNumberOfAuxSymbols();
|
||||
break;
|
||||
} else if (Symbol->isWeakExternal()) {
|
||||
const coff_aux_weak_external *awe;
|
||||
error(coff->getAuxSymbol<coff_aux_weak_external>(SI + 1, awe));
|
||||
|
||||
outs() << "AUX " << format("indx %d srch %d\n",
|
||||
static_cast<uint32_t>(awe->TagIndex),
|
||||
static_cast<uint32_t>(awe->Characteristics));
|
||||
} else {
|
||||
outs() << "AUX Unknown\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user