diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-08-08 22:27:13 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-08-08 22:27:13 +0000 |
commit | 081a1941b595f6294e4ce678fd61ef56a2ceb51e (patch) | |
tree | 45ac82225774a2894de7e3e4c4a83e5cf2d90dd5 /tools/llvm-objdump | |
parent | 491d04969d9f29ed891c73238648853954ba4f81 (diff) | |
download | external_llvm-081a1941b595f6294e4ce678fd61ef56a2ceb51e.zip external_llvm-081a1941b595f6294e4ce678fd61ef56a2ceb51e.tar.gz external_llvm-081a1941b595f6294e4ce678fd61ef56a2ceb51e.tar.bz2 |
[Object] Split the ELF interface into 3 parts.
* ELFTypes.h contains template magic for defining types based on endianess, size, and alignment.
* ELFFile.h defines the ELFFile class which provides low level ELF specific access.
* ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objdump')
-rw-r--r-- | tools/llvm-objdump/ELFDump.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/llvm-objdump/ELFDump.cpp b/tools/llvm-objdump/ELFDump.cpp index ef1f0e9..9c091a41 100644 --- a/tools/llvm-objdump/ELFDump.cpp +++ b/tools/llvm-objdump/ELFDump.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm-objdump.h" -#include "llvm/Object/ELF.h" +#include "llvm/Object/ELFObjectFile.h" #include "llvm/Support/Format.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" @@ -21,10 +21,8 @@ using namespace llvm; using namespace llvm::object; -template<class ELFT> -void printProgramHeaders( - const ELFObjectFile<ELFT> *o) { - typedef ELFObjectFile<ELFT> ELFO; +template <class ELFT> void printProgramHeaders(const ELFFile<ELFT> *o) { + typedef ELFFile<ELFT> ELFO; outs() << "Program Header:\n"; for (typename ELFO::Elf_Phdr_Iter pi = o->begin_program_headers(), pe = o->end_program_headers(); @@ -80,17 +78,17 @@ void printProgramHeaders( void llvm::printELFFileHeader(const object::ObjectFile *Obj) { // Little-endian 32-bit if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj)) - printProgramHeaders(ELFObj); + printProgramHeaders(ELFObj->getELFFile()); // Big-endian 32-bit if (const ELF32BEObjectFile *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj)) - printProgramHeaders(ELFObj); + printProgramHeaders(ELFObj->getELFFile()); // Little-endian 64-bit if (const ELF64LEObjectFile *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj)) - printProgramHeaders(ELFObj); + printProgramHeaders(ELFObj->getELFFile()); // Big-endian 64-bit if (const ELF64BEObjectFile *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj)) - printProgramHeaders(ELFObj); + printProgramHeaders(ELFObj->getELFFile()); } |