summaryrefslogtreecommitdiff
path: root/compiler/cfi_test.h
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2015-04-17 21:14:10 +0100
committer David Srbecky <dsrbecky@google.com> 2015-04-21 19:47:42 +0100
commit527c9c71f0c6e2f9943ac028e7c050500699a44b (patch)
tree09e6794e5b184ce33ca468c972a8ef2faff7f174 /compiler/cfi_test.h
parente7bee3b7d307508243f4a00b5cf8a8867fcaaff5 (diff)
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
Diffstat (limited to 'compiler/cfi_test.h')
-rw-r--r--compiler/cfi_test.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/cfi_test.h b/compiler/cfi_test.h
index cdb1b9e9a5..f7501d2dda 100644
--- a/compiler/cfi_test.h
+++ b/compiler/cfi_test.h
@@ -22,6 +22,7 @@
#include <sstream>
#include "arch/instruction_set.h"
+#include "dwarf/dwarf_constants.h"
#include "dwarf/dwarf_test.h"
#include "dwarf/headers.h"
#include "disassembler/disassembler.h"
@@ -45,7 +46,8 @@ class CFITest : public dwarf::DwarfTest {
// Pretty-print CFI opcodes.
constexpr bool is64bit = false;
dwarf::DebugFrameOpCodeWriter<> initial_opcodes;
- dwarf::WriteEhFrameCIE(is64bit, dwarf::Reg(8), initial_opcodes, &eh_frame_data_);
+ dwarf::WriteEhFrameCIE(is64bit, dwarf::DW_EH_PE_absptr, dwarf::Reg(8),
+ initial_opcodes, &eh_frame_data_);
std::vector<uintptr_t> eh_frame_patches;
dwarf::WriteEhFrameFDE(is64bit, 0, 0, actual_asm.size(), &actual_cfi,
&eh_frame_data_, &eh_frame_patches);