diff options
author | David Srbecky <dsrbecky@google.com> | 2019-04-05 18:23:32 +0000 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2019-04-05 18:23:32 +0000 |
commit | 0b80d3372c5f42475394f8623b2c3ef4bdb6bac9 (patch) | |
tree | 2cb79f348bfd3356b8c07c7b889f8537f1d967bb /libunwindstack/ElfInterface.cpp | |
parent | 91dc724d5ba73d60cc0f7c2b01e559e899ff3a87 (diff) | |
download | unwinding-0b80d3372c5f42475394f8623b2c3ef4bdb6bac9.tar.gz |
Revert "Check for data races when reading JIT/DEX entries."
This reverts commit 91dc724d5ba73d60cc0f7c2b01e559e899ff3a87.
Reason for revert: Breaks ART tests, reverting to investigate.
Change-Id: I1bb905407e87cbd4f832646651133a9caf6fcfc8
Diffstat (limited to 'libunwindstack/ElfInterface.cpp')
-rw-r--r-- | libunwindstack/ElfInterface.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/libunwindstack/ElfInterface.cpp b/libunwindstack/ElfInterface.cpp index e09a2ae..12efb94 100644 --- a/libunwindstack/ElfInterface.cpp +++ b/libunwindstack/ElfInterface.cpp @@ -69,15 +69,6 @@ bool ElfInterface::IsValidPc(uint64_t pc) { return false; } -bool ElfInterface::GetTextRange(uint64_t* addr, uint64_t* size) { - if (text_size_ != 0) { - *addr = text_addr_; - *size = text_size_; - return true; - } - return false; -} - Memory* ElfInterface::CreateGnuDebugdataMemory() { if (gnu_debugdata_offset_ == 0 || gnu_debugdata_size_ == 0) { return nullptr; @@ -339,26 +330,29 @@ void ElfInterface::ReadSectionHeaders(const EhdrType& ehdr) { } symbols_.push_back(new Symbols(shdr.sh_offset, shdr.sh_size, shdr.sh_entsize, str_shdr.sh_offset, str_shdr.sh_size)); - } else if (shdr.sh_type == SHT_PROGBITS || shdr.sh_type == SHT_NOBITS) { + } else if (shdr.sh_type == SHT_PROGBITS && sec_size != 0) { // Look for the .debug_frame and .gnu_debugdata. if (shdr.sh_name < sec_size) { std::string name; if (memory_->ReadString(sec_offset + shdr.sh_name, &name)) { + uint64_t* offset_ptr = nullptr; + uint64_t* size_ptr = nullptr; if (name == ".debug_frame") { - debug_frame_offset_ = shdr.sh_offset; - debug_frame_size_ = shdr.sh_size; + offset_ptr = &debug_frame_offset_; + size_ptr = &debug_frame_size_; } else if (name == ".gnu_debugdata") { - gnu_debugdata_offset_ = shdr.sh_offset; - gnu_debugdata_size_ = shdr.sh_size; + offset_ptr = &gnu_debugdata_offset_; + size_ptr = &gnu_debugdata_size_; } else if (name == ".eh_frame") { - eh_frame_offset_ = shdr.sh_offset; - eh_frame_size_ = shdr.sh_size; + offset_ptr = &eh_frame_offset_; + size_ptr = &eh_frame_size_; } else if (eh_frame_hdr_offset_ == 0 && name == ".eh_frame_hdr") { - eh_frame_hdr_offset_ = shdr.sh_offset; - eh_frame_hdr_size_ = shdr.sh_size; - } else if (name == ".text") { - text_addr_ = shdr.sh_addr; - text_size_ = shdr.sh_size; + offset_ptr = &eh_frame_hdr_offset_; + size_ptr = &eh_frame_hdr_size_; + } + if (offset_ptr != nullptr) { + *offset_ptr = shdr.sh_offset; + *size_ptr = shdr.sh_size; } } } |