OSDN Git Service

Switch to using .debug_frame for CFI.
authorDavid Srbecky <dsrbecky@google.com>
Thu, 21 May 2015 13:03:48 +0000 (14:03 +0100)
committerDavid Srbecky <dsrbecky@google.com>
Thu, 21 May 2015 13:08:19 +0000 (14:08 +0100)
This will make it easier to strip or compress CFI using standard tools.

It also saves some space since we do not need .eh_frame_hdr anymore.

Bug:20556771
Change-Id: I8656b1ff248e4b12cb94924800c3a91fac8bdda4

compiler/elf_writer_quick.cc

index 96dd7ca..af42364 100644 (file)
@@ -43,7 +43,8 @@ namespace art {
 // it is used by C++ exception handling (which we do not use so we
 // can choose either).  C++ compilers generally tend to use .eh_frame
 // because if they need it sometimes, they might as well always use it.
-constexpr dwarf::CFIFormat kCFIFormat = dwarf::DW_EH_FRAME_FORMAT;
+// Let's use .debug_frame because it is easier to strip or compress.
+constexpr dwarf::CFIFormat kCFIFormat = dwarf::DW_DEBUG_FRAME_FORMAT;
 
 template <typename ElfTypes>
 bool ElfWriterQuick<ElfTypes>::Create(File* elf_file,