aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-16 07:23:21 -0700
committerKazu Hirata <kazu@google.com>2025-05-16 07:23:21 -0700
commit9c3ab1cfc8295e64d7bfb3bd5bec36859069a962 (patch)
treebac3ed817c0e7ca89c4cc56671ba8e1e534eb0e9 /llvm/tools/llvm-objdump
parentba631508ae7fec17dd104370106191c7ea6539a5 (diff)
downloadllvm-9c3ab1cfc8295e64d7bfb3bd5bec36859069a962.zip
llvm-9c3ab1cfc8295e64d7bfb3bd5bec36859069a962.tar.gz
llvm-9c3ab1cfc8295e64d7bfb3bd5bec36859069a962.tar.bz2
Revert "Reapply: [llvm-objdump] Add support for HIP offload bundles (#140128)"
This reverts commit 910220b84fa18ce2cbb2e21dd53b9f3d0ae582a7. Multiple buildbot failures have been reported: https://github.com/llvm/llvm-project/pull/140128
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r--llvm/tools/llvm-objdump/OffloadDump.cpp46
-rw-r--r--llvm/tools/llvm-objdump/OffloadDump.h6
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp3
3 files changed, 3 insertions, 52 deletions
diff --git a/llvm/tools/llvm-objdump/OffloadDump.cpp b/llvm/tools/llvm-objdump/OffloadDump.cpp
index 4021f31..4ac6b99 100644
--- a/llvm/tools/llvm-objdump/OffloadDump.cpp
+++ b/llvm/tools/llvm-objdump/OffloadDump.cpp
@@ -14,16 +14,12 @@
#include "OffloadDump.h"
#include "llvm-objdump.h"
#include "llvm/Object/ELFObjectFile.h"
-#include "llvm/Object/OffloadBinary.h"
-#include "llvm/Object/OffloadBundle.h"
#include "llvm/Support/Alignment.h"
using namespace llvm;
using namespace llvm::object;
using namespace llvm::objdump;
-void disassembleObject(llvm::object::ObjectFile *, bool InlineRelocs);
-
/// Get the printable name of the image kind.
static StringRef getImageName(const OffloadBinary &OB) {
switch (OB.getImageKind()) {
@@ -52,7 +48,7 @@ static void printBinary(const OffloadBinary &OB, uint64_t Index) {
}
/// Print the embedded offloading contents of an ObjectFile \p O.
-void llvm::dumpOffloadBinary(const ObjectFile &O, StringRef ArchName) {
+void llvm::dumpOffloadBinary(const ObjectFile &O) {
if (!O.isELF() && !O.isCOFF()) {
reportWarning(
"--offloading is currently only supported for COFF and ELF targets",
@@ -68,46 +64,6 @@ void llvm::dumpOffloadBinary(const ObjectFile &O, StringRef ArchName) {
// Print out all the binaries that are contained in this buffer.
for (uint64_t I = 0, E = Binaries.size(); I != E; ++I)
printBinary(*Binaries[I].getBinary(), I);
-
- dumpOffloadBundleFatBinary(O, ArchName);
-}
-
-// Given an Object file, collect all Bundles of FatBin Binaries
-// and dump them into Code Object files
-// if -arch=-name is specified, only dump the Entries that match the target arch
-void llvm::dumpOffloadBundleFatBinary(const ObjectFile &O, StringRef ArchName) {
- if (!O.isELF() && !O.isCOFF()) {
- reportWarning(
- "--offloading is currently only supported for COFF and ELF targets",
- O.getFileName());
- return;
- }
-
- SmallVector<llvm::object::OffloadBundleFatBin> FoundBundles;
- SmallVector<llvm::object::OffloadBundleEntry> FoundEntries;
-
- if (Error Err = llvm::object::extractOffloadBundleFatBinary(O, FoundBundles))
- reportError(O.getFileName(), "while extracting offload FatBin bundles: " +
- toString(std::move(Err)));
-
- for (const auto &[BundleNum, Bundle] : llvm::enumerate(FoundBundles)) {
- if (!ArchName.empty())
- FoundEntries = Bundle.entryIDContains(ArchName);
- else
- FoundEntries = Bundle.getEntries();
-
- for (OffloadBundleEntry &Entry : FoundEntries) {
- // create file name for this object file: <source-filename>:<Bundle
- // Number>.<EntryID>
- std::string str = Bundle.getFileName().str() + "." + itostr(BundleNum) +
- "." + Entry.ID.str();
- if (Error Err = object::extractCodeObject(O, Entry.Offset, Entry.Size,
- StringRef(str)))
- reportError(O.getFileName(),
- "while extracting offload Bundle Entries: " +
- toString(std::move(Err)));
- }
- }
}
/// Print the contents of an offload binary file \p OB. This may contain
diff --git a/llvm/tools/llvm-objdump/OffloadDump.h b/llvm/tools/llvm-objdump/OffloadDump.h
index 229d479..75f188e 100644
--- a/llvm/tools/llvm-objdump/OffloadDump.h
+++ b/llvm/tools/llvm-objdump/OffloadDump.h
@@ -11,16 +11,12 @@
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/OffloadBinary.h"
-#include "llvm/Object/OffloadBundle.h"
namespace llvm {
void dumpOffloadSections(const object::OffloadBinary &OB);
-void dumpOffloadBinary(const object::ObjectFile &O, StringRef ArchName);
+void dumpOffloadBinary(const object::ObjectFile &O);
-/// Dump fat binary in binary clang-offload-bundler format
-void dumpOffloadBundleFatBinary(const object::ObjectFile &O,
- StringRef ArchName);
} // namespace llvm
#endif
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index ab26a42..7a778da 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -56,7 +56,6 @@
#include "llvm/Object/MachO.h"
#include "llvm/Object/MachOUniversal.h"
#include "llvm/Object/OffloadBinary.h"
-#include "llvm/Object/OffloadBundle.h"
#include "llvm/Object/Wasm.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
@@ -3362,7 +3361,7 @@ static void dumpObject(ObjectFile *O, const Archive *A = nullptr,
if (FaultMapSection)
printFaultMaps(O);
if (Offloading)
- dumpOffloadBinary(*O, StringRef(ArchName));
+ dumpOffloadBinary(*O);
}
static void dumpObject(const COFFImportFile *I, const Archive *A,