aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.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/COFFObjectFile.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/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 384c19d..1fd95451 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -328,6 +328,12 @@ bool COFFObjectFile::isSectionBSS(DataRefImpl Ref) const {
return (Sec->Characteristics & BssFlags) == BssFlags;
}
+// The .debug sections are the only debug sections for COFF
+// (\see MCObjectFileInfo.cpp).
+bool COFFObjectFile::isDebugSection(StringRef SectionName) const {
+ return SectionName.startswith(".debug");
+}
+
unsigned COFFObjectFile::getSectionID(SectionRef Sec) const {
uintptr_t Offset =
uintptr_t(Sec.getRawDataRefImpl().p) - uintptr_t(SectionTable);