aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorzhijian lin <zhijian@ca.ibm.com>2024-06-21 09:17:04 -0400
committerGitHub <noreply@github.com>2024-06-21 09:17:04 -0400
commitdf86fb069e130f405ca2e6124c725e6dd1d629c6 (patch)
tree0533dfdfdbdbd3aebc57c6f396d63afbac5fbf31 /llvm/lib
parentf5c2ef2597d937901b7b261ca3a847aecd456a65 (diff)
downloadllvm-df86fb069e130f405ca2e6124c725e6dd1d629c6.zip
llvm-df86fb069e130f405ca2e6124c725e6dd1d629c6.tar.gz
llvm-df86fb069e130f405ca2e6124c725e6dd1d629c6.tar.bz2
[llvm-objdump] enable file-headers option of llvm-objdump for XCOFF object files (#96104)
the patch enable file-headers option of llvm-objdump for XCOFF object files
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Object/XCOFFObjectFile.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index d09e7b06..25a60f3 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -737,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 {