X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllvm-readobj%2Fllvm-readobj.cpp;h=2e95b6b5518f97032ce07e87dec3b1f8243f2241;hb=4ff87aaf84f0fbc9dffa2757fd7a33c7ee9044ea;hp=67c9a98f40f3ae5c1ecb14047c8d8fce1dd80562;hpb=76e70f340c09ba759ad96d8dfe416b64f24bc287;p=oota-llvm.git diff --git a/tools/llvm-readobj/llvm-readobj.cpp b/tools/llvm-readobj/llvm-readobj.cpp index 67c9a98f40f..2e95b6b5518 100644 --- a/tools/llvm-readobj/llvm-readobj.cpp +++ b/tools/llvm-readobj/llvm-readobj.cpp @@ -120,6 +120,14 @@ namespace opts { // -needed-libs cl::opt NeededLibraries("needed-libs", cl::desc("Display the needed libraries")); + + // -program-headers + cl::opt ProgramHeaders("program-headers", + cl::desc("Display ELF program headers")); + + // -expand-relocs + cl::opt ExpandRelocs("expand-relocs", + cl::desc("Expand each shown relocation to multiple lines")); } // namespace opts namespace llvm { @@ -135,8 +143,8 @@ bool error(error_code EC) { bool relocAddressLess(RelocationRef a, RelocationRef b) { uint64_t a_addr, b_addr; - if (error(a.getAddress(a_addr))) return false; - if (error(b.getAddress(b_addr))) return false; + if (error(a.getOffset(a_addr))) return false; + if (error(b.getOffset(b_addr))) return false; return a_addr < b_addr; } @@ -211,6 +219,8 @@ static void dumpObject(const ObjectFile *Obj) { Dumper->printDynamicTable(); if (opts::NeededLibraries) Dumper->printNeededLibraries(); + if (opts::ProgramHeaders) + Dumper->printProgramHeaders(); }