forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llvm-readobj: Dump more info for COFF import libraries.
This patch teaches llvm-readobj to print out COFF import file header fields. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246291 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
6 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//===-- COFFImportDumper.cpp - COFF import library dumper -------*- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// \brief This file implements the COFF import library dumper for llvm-readobj. | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "Error.h" | ||
#include "ObjDumper.h" | ||
#include "llvm-readobj.h" | ||
#include "llvm/Object/COFF.h" | ||
#include "llvm/Object/COFFImportFile.h" | ||
#include "llvm/Support/COFF.h" | ||
|
||
using namespace llvm::object; | ||
|
||
namespace llvm { | ||
|
||
void dumpCOFFImportFile(const COFFImportFile *File) { | ||
outs() << '\n'; | ||
outs() << "File: " << File->getFileName() << "\n"; | ||
outs() << "Format: COFF-import-file\n"; | ||
|
||
const coff_import_header *H = File->getCOFFImportHeader(); | ||
switch (H->getType()) { | ||
case COFF::IMPORT_CODE: outs() << "Type: code\n"; break; | ||
case COFF::IMPORT_DATA: outs() << "Type: data\n"; break; | ||
case COFF::IMPORT_CONST: outs() << "Type: const\n"; break; | ||
} | ||
|
||
switch (H->getNameType()) { | ||
case COFF::IMPORT_ORDINAL: outs() << "Name type: ordinal\n"; break; | ||
case COFF::IMPORT_NAME: outs() << "Name type: name\n"; break; | ||
case COFF::IMPORT_NAME_NOPREFIX: outs() << "Name type: noprefix\n"; break; | ||
case COFF::IMPORT_NAME_UNDECORATE: outs() << "Name type: undecorate\n"; break; | ||
} | ||
|
||
for (const object::BasicSymbolRef &Sym : File->symbols()) { | ||
outs() << "Symbol: "; | ||
Sym.printName(outs()); | ||
outs() << "\n"; | ||
} | ||
} | ||
|
||
} // namespace llvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters