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
diff --git a/runtime/elf.h b/runtime/elf.h
index 60b5248..4514bb2 100644
--- a/runtime/elf.h
+++ b/runtime/elf.h
@@ -1852,6 +1852,38 @@
VER_NEED_CURRENT = 1
};
+struct ElfTypes32 {
+ typedef Elf32_Addr Addr;
+ typedef Elf32_Off Off;
+ typedef Elf32_Half Half;
+ typedef Elf32_Word Word;
+ typedef Elf32_Sword Sword;
+ typedef Elf32_Ehdr Ehdr;
+ typedef Elf32_Shdr Shdr;
+ typedef Elf32_Sym Sym;
+ typedef Elf32_Rel Rel;
+ typedef Elf32_Rela Rela;
+ typedef Elf32_Phdr Phdr;
+ typedef Elf32_Dyn Dyn;
+};
+
+struct ElfTypes64 {
+ typedef Elf64_Addr Addr;
+ typedef Elf64_Off Off;
+ typedef Elf64_Half Half;
+ typedef Elf64_Word Word;
+ typedef Elf64_Sword Sword;
+ typedef Elf64_Xword Xword;
+ typedef Elf64_Sxword Sxword;
+ typedef Elf64_Ehdr Ehdr;
+ typedef Elf64_Shdr Shdr;
+ typedef Elf64_Sym Sym;
+ typedef Elf64_Rel Rel;
+ typedef Elf64_Rela Rela;
+ typedef Elf64_Phdr Phdr;
+ typedef Elf64_Dyn Dyn;
+};
+
// BEGIN android-changed
#endif // ART_RUNTIME_ELF_H_
// END android-changed