Generate .eh_frame_hdr section and PT_GNU_EH_FRAME segment.
Fixes issue 20125400 - ART: Need .eh_frame_hdr and PT_GNU_EH_FRAME
for libunwind.
.eh_frame_hdr serves two purposes. Firstly, it can optionally contain
binary search table for fast eh_frame lookup. This is important for
C++ exception handling, but we do not need it so we omit it.
Secondly, it contains a relative .eh_frame pointer which makes it
easier for run-time code to locate the .eh_frame section.
libunwind seems to rely on this relative pointer.
Bug: 20125400
Change-Id: I7c1e3f68d914f70781404c508395831a3296a7da
diff --git a/compiler/elf_writer_debug.h b/compiler/elf_writer_debug.h
index 2c03b98..5bf4841 100644
--- a/compiler/elf_writer_debug.h
+++ b/compiler/elf_writer_debug.h
@@ -19,23 +19,27 @@
#include <vector>
+#include "dwarf/dwarf_constants.h"
#include "oat_writer.h"
namespace art {
namespace dwarf {
void WriteEhFrame(const CompilerDriver* compiler,
- OatWriter* oat_writer,
- uint32_t text_section_offset,
- std::vector<uint8_t>* eh_frame);
+ const OatWriter* oat_writer,
+ ExceptionHeaderValueApplication address_type,
+ std::vector<uint8_t>* eh_frame,
+ std::vector<uintptr_t>* eh_frame_patches,
+ std::vector<uint8_t>* eh_frame_hdr);
void WriteDebugSections(const CompilerDriver* compiler,
- OatWriter* oat_writer,
- uint32_t text_section_offset,
+ const OatWriter* oat_writer,
std::vector<uint8_t>* debug_info,
+ std::vector<uintptr_t>* debug_info_patches,
std::vector<uint8_t>* debug_abbrev,
std::vector<uint8_t>* debug_str,
- std::vector<uint8_t>* debug_line);
+ std::vector<uint8_t>* debug_line,
+ std::vector<uintptr_t>* debug_line_patches);
} // namespace dwarf
} // namespace art