diff options
author | Chris B <chris.bieneman@me.com> | 2025-08-04 10:57:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-04 10:57:25 -0500 |
commit | 2fe96439fb81d85ea78a6311b1d9e6ed9b85bcfa (patch) | |
tree | f48479f94e54398e8be6039ed33cf31a9d3bf113 /llvm/lib/Object/ObjectFile.cpp | |
parent | 2cf276d48a3f2726dcbd786ff030e6ce3d5dffb4 (diff) | |
download | llvm-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/lib/Object/ObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/ObjectFile.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index 6a226a3..b0e4ea0 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -15,6 +15,7 @@ #include "llvm/BinaryFormat/Magic.h" #include "llvm/Object/Binary.h" #include "llvm/Object/COFF.h" +#include "llvm/Object/DXContainer.h" #include "llvm/Object/Error.h" #include "llvm/Object/MachO.h" #include "llvm/Object/Wasm.h" @@ -165,7 +166,6 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type, case file_magic::goff_object: case file_magic::cuda_fatbinary: case file_magic::offload_binary: - case file_magic::dxcontainer_object: case file_magic::offload_bundle: case file_magic::offload_bundle_compressed: case file_magic::spirv_object: @@ -201,6 +201,8 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type, return createXCOFFObjectFile(Object, Binary::ID_XCOFF64); case file_magic::wasm_object: return createWasmObjectFile(Object); + case file_magic::dxcontainer_object: + return createDXContainerObjectFile(Object); } llvm_unreachable("Unexpected Object File Type"); } |