summaryrefslogtreecommitdiff
path: root/patchoat/patchoat.h
diff options
context:
space:
mode:
author Tong Shen <endlessroad@google.com> 2014-09-03 17:24:56 -0700
committer Tong Shen <endlessroad@google.com> 2014-10-03 11:25:11 -0700
commit62d1ca3182a6cbb921799825f43ad36821233fd7 (patch)
tree54d9663f5ce10f41e95fe774d4e4841c1a78bbc3 /patchoat/patchoat.h
parent63462448ca4e377074a10a4720aa22f71154dbe9 (diff)
ART: Prepare for ELF64.
Only expose necessary interface in ElfFile, and move all details into template class ElfFileImpl. Change-Id: I9df2bbc55f32ba0ba91f4f3d5d0009e84a2ddf74
Diffstat (limited to 'patchoat/patchoat.h')
-rw-r--r--patchoat/patchoat.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/patchoat/patchoat.h b/patchoat/patchoat.h
index 9086d58fc7..7dd95f5d6b 100644
--- a/patchoat/patchoat.h
+++ b/patchoat/patchoat.h
@@ -76,12 +76,15 @@ class PatchOat {
// Patches oat in place, modifying the oat_file given to the constructor.
bool PatchElf();
- bool PatchTextSection();
+ template <typename ElfFileImpl>
+ bool PatchElf(ElfFileImpl* oat_file);
+ template <typename ElfFileImpl>
+ bool PatchTextSection(ElfFileImpl* oat_file);
// Templatized version to actually do the patching with the right sized offsets.
- template <typename ptr_t> bool PatchTextSection(const Elf32_Shdr& patches_sec);
- template <typename ptr_t> bool CheckOatFile(const Elf32_Shdr& patches_sec);
- bool PatchOatHeader();
- bool PatchSymbols(Elf32_Shdr* section);
+ template <typename ElfFileImpl, typename patch_loc_t> bool PatchTextSection(ElfFileImpl* oat_file);
+ template <typename ElfFileImpl, typename patch_loc_t> bool CheckOatFile(ElfFileImpl* oat_filec);
+ template <typename ElfFileImpl>
+ bool PatchOatHeader(ElfFileImpl* oat_file);
bool PatchImage() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);