aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorDjordje Todorovic <djordje.todorovic@syrmia.com>2020-04-02 10:00:18 +0200
committerDjordje Todorovic <djordje.todorovic@syrmia.com>2020-04-02 10:56:00 +0200
commit29d253c4c6879bfe57040c8c59b0d9d84f6e5e2f (patch)
treeff0ab1c5fa27b23a7bce006efa6078ba5f41c8d1 /llvm/lib/Object/MachOObjectFile.cpp
parentdeb902252ac8d07b3f4419de4ff23dae444aaa6e (diff)
downloadllvm-29d253c4c6879bfe57040c8c59b0d9d84f6e5e2f.zip
llvm-29d253c4c6879bfe57040c8c59b0d9d84f6e5e2f.tar.gz
llvm-29d253c4c6879bfe57040c8c59b0d9d84f6e5e2f.tar.bz2
[Object] Add the method for checking if a section is a debug section
Different file formats have different naming style for the debug sections. The method is implemented for ELF, COFF and Mach-O formats. Differential Revision: https://reviews.llvm.org/D76276
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index feea11c..c0aa0b8 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -2030,6 +2030,11 @@ bool MachOObjectFile::isSectionBSS(DataRefImpl Sec) const {
SectionType == MachO::S_GB_ZEROFILL);
}
+bool MachOObjectFile::isDebugSection(StringRef SectionName) const {
+ return SectionName.startswith("__debug") ||
+ SectionName.startswith("__zdebug") || SectionName == "__gdb_index";
+}
+
unsigned MachOObjectFile::getSectionID(SectionRef Sec) const {
return Sec.getRawDataRefImpl().d.a;
}