From 6d8c8f0344a706df651567387ede683ab3ec1b5f Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Mon, 26 Oct 2015 10:57:09 +0000 Subject: Rewrite ElfBuilder to make streaming directly to file easier. The previous design required knowing all the sections and their sizes before even the first byte of the file was written. The new design allows sections to be written one by one without any knowledge of later sections. Furthermore, as soon as section is started, its virtual memory address is known, which removes the need for the various patching passes. The new ElfBuilder essentially tries to be a thin wrapper around OutputStream which keeps track where the various sections start/end and then writes their ELF headers. Change-Id: I817e7f3b41882e4e4b9b442cfe56e4ef2e26babd --- compiler/elf_writer_debug.h | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'compiler/elf_writer_debug.h') diff --git a/compiler/elf_writer_debug.h b/compiler/elf_writer_debug.h index 69f7e0d811..e58fd0a390 100644 --- a/compiler/elf_writer_debug.h +++ b/compiler/elf_writer_debug.h @@ -19,29 +19,21 @@ #include +#include "elf_builder.h" #include "dwarf/dwarf_constants.h" #include "oat_writer.h" namespace art { namespace dwarf { -void WriteCFISection(const CompilerDriver* compiler, - const OatWriter* oat_writer, - ExceptionHeaderValueApplication address_type, - CFIFormat format, - std::vector* debug_frame, - std::vector* debug_frame_patches, - std::vector* eh_frame_hdr, - std::vector* eh_frame_hdr_patches); - -void WriteDebugSections(const CompilerDriver* compiler, - const OatWriter* oat_writer, - std::vector* debug_info, - std::vector* debug_info_patches, - std::vector* debug_abbrev, - std::vector* debug_str, - std::vector* debug_line, - std::vector* debug_line_patches); +template +void WriteCFISection(ElfBuilder* builder, + const std::vector& method_infos, + CFIFormat format); + +template +void WriteDebugSections(ElfBuilder* builder, + const std::vector& method_infos); } // namespace dwarf } // namespace art -- cgit v1.2.3-59-g8ed1b