aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorChris B <chris.bieneman@me.com>2025-08-04 10:57:25 -0500
committerGitHub <noreply@github.com>2025-08-04 10:57:25 -0500
commit2fe96439fb81d85ea78a6311b1d9e6ed9b85bcfa (patch)
treef48479f94e54398e8be6039ed33cf31a9d3bf113 /llvm/tools/llvm-objdump/llvm-objdump.cpp
parent2cf276d48a3f2726dcbd786ff030e6ce3d5dffb4 (diff)
downloadllvm-2fe96439fb81d85ea78a6311b1d9e6ed9b85bcfa.zip
llvm-2fe96439fb81d85ea78a6311b1d9e6ed9b85bcfa.tar.gz
llvm-2fe96439fb81d85ea78a6311b1d9e6ed9b85bcfa.tar.bz2
[DirectX] Add ObjectFile boilerplate for objdump (#151434)
This change adds boilerplate code to implement the object::ObjectFile interface for the DXContainer object file and an empty implementation of the objdump Dumper object. Adding an ObjectFile implementation for DXContainer is a bit odd because the DXContainer format doesn't have a symbol table, so there isn't a reasonable implementation for the SymbolicFile interfaces. That said, it does have sections, and it will be useful for objdump to be able to inspect some of the structured data stored in some of the special named sections. At this point in the implementation it can't do much other than dump the part names, offsets, and sizes. Dumping detailed structured section contents to be extended in subsequent PRs. Fixes #151433
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 6ce23e8..c19c698 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -50,6 +50,7 @@
#include "llvm/Object/BuildID.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/COFFImportFile.h"
+#include "llvm/Object/DXContainer.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ELFTypes.h"
#include "llvm/Object/FaultMapParser.h"
@@ -386,6 +387,8 @@ static Expected<std::unique_ptr<Dumper>> createDumper(const ObjectFile &Obj) {
return createWasmDumper(*O);
if (const auto *O = dyn_cast<XCOFFObjectFile>(&Obj))
return createXCOFFDumper(*O);
+ if (const auto *O = dyn_cast<DXContainerObjectFile>(&Obj))
+ return createDXContainerDumper(*O);
return createStringError(errc::invalid_argument,
"unsupported object file format");