aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Object/XCOFFObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Object/XCOFFObjectFile.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Object/XCOFFObjectFile.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/contrib/llvm-project/llvm/lib/Object/XCOFFObjectFile.cpp b/contrib/llvm-project/llvm/lib/Object/XCOFFObjectFile.cpp
index 3fbd51887831..6efb8759d13f 100644
--- a/contrib/llvm-project/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/contrib/llvm-project/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;
}
@@ -731,9 +737,11 @@ bool XCOFFObjectFile::isRelocatableObject() const {
}
Expected<uint64_t> XCOFFObjectFile::getStartAddress() const {
- // TODO FIXME Should get from auxiliary_header->o_entry when support for the
- // auxiliary_header is added.
- return 0;
+ if (AuxiliaryHeader == nullptr)
+ return 0;
+
+ return is64Bit() ? auxiliaryHeader64()->getEntryPointAddr()
+ : auxiliaryHeader32()->getEntryPointAddr();
}
StringRef XCOFFObjectFile::mapDebugSectionName(StringRef Name) const {
@@ -1361,7 +1369,7 @@ Expected<StringRef> XCOFFSymbolRef::getName() const {
return getObject()->getStringTableEntry(getSymbol64()->Offset);
}
-// Explictly instantiate template classes.
+// Explicitly instantiate template classes.
template struct XCOFFSectionHeader<XCOFFSectionHeader32>;
template struct XCOFFSectionHeader<XCOFFSectionHeader64>;