[llvm] Add --offoading option to llvm-readobj (PR #143342)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 16 01:53:25 PDT 2025


================
@@ -230,4 +232,15 @@ void ObjDumper::printSectionsAsHex(const object::ObjectFile &Obj,
   }
 }
 
+void ObjDumper::printOffloading(const object::ObjectFile &Obj) {
+
+  SmallVector<llvm::object::OffloadBundleFatBin> Bundles;
+  if (Error Err = object::extractOffloadBundleFatBinary(Obj, Bundles))
+    reportWarning(std::move(Err), Obj.getFileName());
----------------
jh7370 wrote:

The issue isn't what all the different warnings are, it's to show that these warnings are propagated correctly up to the tool (though if you want to test that the API generates all the different expected warnings, using llvm-readobj as a mechanism to bubble them up, that's absolutely fine, but not what I'm asking for here).

Imagine the case where you failed to actually check the value of `Err` or call `reportWarning` at all. In that case, there'd be a failure due to an unhandled `Error`, but only in some configurations.

https://github.com/llvm/llvm-project/pull/143342


More information about the llvm-commits mailing list