summaryrefslogtreecommitdiffstats
path: root/oatdump
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2015-04-22 12:20:22 +0100
committerDavid Srbecky <dsrbecky@google.com>2015-04-22 16:56:23 +0100
commit533c207f9d2da6d913c4b10f6f757fe9d6367b10 (patch)
tree1e2c1bf5c91898e785398a3d66e7e7570e8b29db /oatdump
parent8d1ba74fe48703fc2b5a5920dd5eea0c65db5b15 (diff)
downloadart-533c207f9d2da6d913c4b10f6f757fe9d6367b10.zip
art-533c207f9d2da6d913c4b10f6f757fe9d6367b10.tar.gz
art-533c207f9d2da6d913c4b10f6f757fe9d6367b10.tar.bz2
Simplify template parameters of Elf classes.
The ELF specification defines several types which differ between 32-bit ELF and 64-bit ELF. We used to template all ELF-related methods on all of those types which was very verbose. This CL wraps all the types as typedefs in ElfTypes32 and ElfTypes64. One of those wrappers is then used as the template parameter. Change-Id: I65247c2c79d92a7c4799e988cf3e4a1b10eb4788
Diffstat (limited to 'oatdump')
-rw-r--r--oatdump/oatdump.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index a36e5b1..d6d8808 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -92,8 +92,7 @@ class OatSymbolizer FINAL : public CodeOutput {
elf_output_ = OS::CreateEmptyFile(output_name_.c_str());
- builder_.reset(new ElfBuilder<Elf32_Word, Elf32_Sword, Elf32_Addr, Elf32_Dyn,
- Elf32_Sym, Elf32_Ehdr, Elf32_Phdr, Elf32_Shdr>(
+ builder_.reset(new ElfBuilder<ElfTypes32>(
this,
elf_output_,
oat_file_->GetOatHeader().GetInstructionSet(),
@@ -270,8 +269,7 @@ class OatSymbolizer FINAL : public CodeOutput {
pretty_name = "[Dedup]" + pretty_name;
}
- ElfSymtabBuilder<Elf32_Word, Elf32_Sword, Elf32_Addr,
- Elf32_Sym, Elf32_Shdr>* symtab = builder_->GetSymtabBuilder();
+ ElfSymtabBuilder<ElfTypes32>* symtab = builder_->GetSymtabBuilder();
symtab->AddSymbol(pretty_name, &builder_->GetTextBuilder(),
oat_method.GetCodeOffset() - oat_file_->GetOatHeader().GetExecutableOffset(),
@@ -300,8 +298,7 @@ class OatSymbolizer FINAL : public CodeOutput {
}
const OatFile* oat_file_;
- std::unique_ptr<ElfBuilder<Elf32_Word, Elf32_Sword, Elf32_Addr, Elf32_Dyn,
- Elf32_Sym, Elf32_Ehdr, Elf32_Phdr, Elf32_Shdr> > builder_;
+ std::unique_ptr<ElfBuilder<ElfTypes32> > builder_;
File* elf_output_;
std::unordered_map<uint32_t, uint32_t> state_;
const std::string output_name_;