aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
authorstephenpeckham <118857872+stephenpeckham@users.noreply.github.com>2024-02-20 08:42:12 -0600
committerGitHub <noreply@github.com>2024-02-20 08:42:12 -0600
commit26db845536aa4ada6231873a01252c75637fcbae (patch)
tree09e6b6bff03cff28e256c74d0d8d623a58eeac2e /llvm/lib/Object/XCOFFObjectFile.cpp
parenta1a68603145a39e6abdd35bf7a01535eb53826b1 (diff)
downloadllvm-26db845536aa4ada6231873a01252c75637fcbae.zip
llvm-26db845536aa4ada6231873a01252c75637fcbae.tar.gz
llvm-26db845536aa4ada6231873a01252c75637fcbae.tar.bz2
[XCOFF] Support the subtype flag in DWARF section headers (#81667)
The section headers for XCOFF files have a subtype flag for Dwarf sections. This PR updates obj2yaml, yaml2obj, and llvm-readobj so that they recognize the subtype.
Diffstat (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index 3fbd518..d09e7b06 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -65,6 +65,12 @@ template <typename T> uint16_t XCOFFSectionHeader<T>::getSectionType() const {
}
template <typename T>
+uint32_t XCOFFSectionHeader<T>::getSectionSubtype() const {
+ const T &DerivedXCOFFSectionHeader = static_cast<const T &>(*this);
+ return DerivedXCOFFSectionHeader.Flags & ~SectionFlagsTypeMask;
+}
+
+template <typename T>
bool XCOFFSectionHeader<T>::isReservedSectionType() const {
return getSectionType() & SectionFlagsReservedMask;
}