OSDN Git Service

Relocate DWARF using .oat_patches.
authorDavid Srbecky <dsrbecky@google.com>
Fri, 10 Apr 2015 23:17:53 +0000 (00:17 +0100)
committerDavid Srbecky <dsrbecky@google.com>
Sat, 11 Apr 2015 18:14:10 +0000 (19:14 +0100)
commit2f6cdb01f74772c1c521a125776ef57ea3c73d43
tree163f90841f02b9529997f4e3eea65e512e4795a3
parent58565098b2298041ccc97371a3cc486df88d51b3
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
16 files changed:
compiler/cfi_test.h
compiler/dwarf/debug_info_entry_writer.h
compiler/dwarf/debug_line_opcode_writer.h
compiler/dwarf/dwarf_test.cc
compiler/dwarf/headers.h
compiler/elf_writer_debug.cc
compiler/elf_writer_debug.h
compiler/elf_writer_quick.cc
compiler/elf_writer_quick.h
compiler/elf_writer_test.cc
compiler/oat_writer.cc
compiler/oat_writer.h
patchoat/patchoat.cc
patchoat/patchoat.h
runtime/elf_file.cc
runtime/elf_file_impl.h