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

David Salinas via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 10:03:57 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());
----------------
david-salinas wrote:

We're just passing along the error message from the API routine here.  There are a couple of cases where the API would return an error when "extractOffloadBundleFatBinary" is called.   I agree we should have tests to verify all of the error cases in the API, though I guess I'd say those error tests should be part of the API, and not necessarily required for this tool to use the API. And we should ask the API "owner" to make those tests .... which is me.

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


More information about the llvm-commits mailing list