From f4886df5e72fa21eddfc4cc7860f4154929b3380 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Mon, 11 Dec 2017 16:06:29 +0000 Subject: Add mini-debug-info generation mode for JIT. This excludes everything that is not needed for backtraces and compresses the resulting ELF file (wrapped in another ELF file). This approximately halves the size of the debug data for JIT. The vast majority of the data is the overhead of ELF header. We could amortize this by storing more methods per ELF file. It also adds NOBITS .text section to all debug ELF files, as that seems necessary for gdb to find the symbols. On the other hand, it removes .rodata from debug ELF files. Test: Manually tested that gdb can use this data to unwind. Test: m test-art-host-gtest Test: testrunner.py --optimizing --host Test: testrunner.py -t 137-cfi Change-Id: Ic0a2dfa953cb79973a7b2ae99d32018599e61171 --- compiler/linker/elf_builder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/linker') diff --git a/compiler/linker/elf_builder.h b/compiler/linker/elf_builder.h index 3710878ea1..aa3cd98595 100644 --- a/compiler/linker/elf_builder.h +++ b/compiler/linker/elf_builder.h @@ -203,13 +203,13 @@ class ElfBuilder FINAL { if (section_index_ == 0) { std::vector& sections = owner_->sections_; Elf_Word last = sections.empty() ? PF_R : sections.back()->phdr_flags_; - if (owner_->write_program_headers_ && phdr_flags_ != last) { + if (phdr_flags_ != last) { header_.sh_addralign = kPageSize; // Page-align if R/W/X flags changed. } sections.push_back(this); section_index_ = sections.size(); // First ELF section has index 1. } - return header_.sh_addralign; + return owner_->write_program_headers_ ? header_.sh_addralign : 1; } ElfBuilder* owner_; -- cgit v1.2.3-59-g8ed1b