[Object][ELF] Add support for dumping dynamic relocations when sections are stripped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240703 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer
2015-06-25 21:47:32 +00:00
parent ee46b796c2
commit 4cbb2db3ab
6 changed files with 104 additions and 4 deletions

View File

@@ -40,7 +40,6 @@
#include <string>
#include <system_error>
using namespace llvm;
using namespace llvm::object;
@@ -91,6 +90,10 @@ namespace opts {
cl::desc("Alias for --relocations"),
cl::aliasopt(Relocations));
// -dyn-relocations
cl::opt<bool> DynRelocs("dyn-relocations",
cl::desc("Display the dynamic relocation entries in the file"));
// -symbols, -t
cl::opt<bool> Symbols("symbols",
cl::desc("Display the symbol table"));
@@ -280,6 +283,8 @@ static void dumpObject(const ObjectFile *Obj) {
Dumper->printSections();
if (opts::Relocations)
Dumper->printRelocations();
if (opts::DynRelocs)
Dumper->printDynamicRelocations();
if (opts::Symbols)
Dumper->printSymbols();
if (opts::DynamicSymbols)
@@ -313,7 +318,6 @@ static void dumpObject(const ObjectFile *Obj) {
Dumper->printCOFFBaseReloc();
}
/// @brief Dumps each object file in \a Arc;
static void dumpArchive(const Archive *Arc) {
for (Archive::child_iterator ArcI = Arc->child_begin(),
@@ -374,7 +378,6 @@ static void dumpInput(StringRef File) {
reportError(File, readobj_error::unrecognized_file_format);
}
int main(int argc, const char *argv[]) {
sys::PrintStackTraceOnErrorSignal();
PrettyStackTraceProgram X(argc, argv);