summaryrefslogtreecommitdiff
path: root/runtime/elf_file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/elf_file.cc')
-rw-r--r--runtime/elf_file.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc
index 3b4b88d437..096f003de3 100644
--- a/runtime/elf_file.cc
+++ b/runtime/elf_file.cc
@@ -1830,6 +1830,14 @@ bool ElfFile::GetSectionOffsetAndSize(const char* section_name, uint64_t* offset
}
}
+bool ElfFile::HasSection(const std::string& name) const {
+ if (elf64_.get() != nullptr) {
+ return elf64_->FindSectionByName(name) != nullptr;
+ } else {
+ return elf32_->FindSectionByName(name) != nullptr;
+ }
+}
+
uint64_t ElfFile::FindSymbolAddress(unsigned section_type,
const std::string& symbol_name,
bool build_map) {