diff options
author | 2015-04-11 00:17:53 +0100 | |
---|---|---|
committer | 2015-04-11 19:14:10 +0100 | |
commit | 2f6cdb01f74772c1c521a125776ef57ea3c73d43 (patch) | |
tree | 163f90841f02b9529997f4e3eea65e512e4795a3 /patchoat/patchoat.h | |
parent | 58565098b2298041ccc97371a3cc486df88d51b3 (diff) |
Relocate DWARF using .oat_patches.
The current solution is to hard-code knowledge of DWARF in the linker.
This works for simple use of DWARF, but breaks as soon as I try to do
anything more complex. Making the linker fully support DWARF would be
non-trivial task and would be essentially rewrite. Using .oat_patches
is much easier solution.
Relocating .debug_* sections required extending .oat_patches to support
more sections than just .text. I have encoded each section as
null-terminated section name followed by ULEB128 deltas.
The ULEB128 encoding shrinks .oat_patches for .text by factor of
about 6 with 64-bit compiler, and factor of 3 with 32-bit compiler.
On the other hand, it grows by the extra .oat_patches for DWARF which
were not present before (if debug symbols are included).
Overall, it is still a clear improvement even with the DWARF patches.
Change-Id: I78ffeda0f8a3da03341995a3b5ef15c954e16e9f
Diffstat (limited to 'patchoat/patchoat.h')
-rw-r--r-- | patchoat/patchoat.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/patchoat/patchoat.h b/patchoat/patchoat.h index 418650ac16..86f9118e2e 100644 --- a/patchoat/patchoat.h +++ b/patchoat/patchoat.h @@ -109,11 +109,6 @@ class PatchOat { 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 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_); |