mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
This patch adds a new flag "-coff-imports" to llvm-readobj.
When the flag is given, the command prints out the COFF import table. Currently only the import table directory will be printed. I'm going to make another patch to print out the imported symbols. The implementation of import directory entry iterator in COFFObjectFile.cpp was buggy. This patch fixes that too. http://reviews.llvm.org/D5569 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -55,6 +55,7 @@ public:
|
||||
void printSymbols() override;
|
||||
void printDynamicSymbols() override;
|
||||
void printUnwindInfo() override;
|
||||
void printCOFFImports() override;
|
||||
|
||||
private:
|
||||
void printSymbol(const SymbolRef &Sym);
|
||||
@ -882,3 +883,17 @@ void COFFDumper::printUnwindInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
void COFFDumper::printCOFFImports() {
|
||||
for (auto I = Obj->import_directory_begin(), E = Obj->import_directory_end();
|
||||
I != E; ++I) {
|
||||
DictScope Import(W, "Import");
|
||||
StringRef Name;
|
||||
if (error(I->getName(Name))) return;
|
||||
W.printString("Name", Name);
|
||||
uint32_t Addr;
|
||||
if (error(I->getImportLookupTableRVA(Addr))) return;
|
||||
W.printHex("ImportLookupTableRVA", Addr);
|
||||
if (error(I->getImportAddressTableRVA(Addr))) return;
|
||||
W.printHex("ImportAddressTableRVA", Addr);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user