-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add --offoading option to llvm-readobj #143342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
#include "llvm/Object/Archive.h" | ||
#include "llvm/Object/Decompressor.h" | ||
#include "llvm/Object/ObjectFile.h" | ||
#include "llvm/Object/OffloadBinary.h" | ||
#include "llvm/Object/OffloadBundle.h" | ||
#include "llvm/Support/Error.h" | ||
#include "llvm/Support/FormatVariadic.h" | ||
#include "llvm/Support/ScopedPrinter.h" | ||
|
@@ -230,4 +232,15 @@ void ObjDumper::printSectionsAsHex(const object::ObjectFile &Obj, | |
} | ||
} | ||
|
||
void ObjDumper::printOffloading(const object::ObjectFile &Obj) { | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: don't start a function with a blank line. |
||
SmallVector<llvm::object::OffloadBundleFatBin> Bundles; | ||
if (Error Err = object::extractOffloadBundleFatBinary(Obj, Bundles)) | ||
reportWarning(std::move(Err), Obj.getFileName()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd still like to see a test that shows this warning is printed when expected. |
||
|
||
// Print out all the FatBin Bundles that are contained in this buffer. | ||
for (const auto &[Index, Bundle] : llvm::enumerate(Bundles)) | ||
Bundle.printEntriesAsURI(); | ||
} | ||
|
||
} // namespace llvm |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ def file_header : FF<"file-header", "Display file header">; | |
def headers : FF<"headers", "Equivalent to setting: --file-header, --program-headers, --section-headers">; | ||
defm hex_dump : Eq<"hex-dump", "Display the specified section(s) as hexadecimal bytes">, MetaVarName<"<name or index>">; | ||
def pretty_print : FF<"pretty-print", "Pretty print JSON output">; | ||
def offloading : FF<"offloading", "Display the content of the offloading section">; | ||
def relocs : FF<"relocs", "Display the relocation entries in the file">; | ||
def section_data : FF<"section-data", "Display section data for each section shown. This option has no effect for GNU style output">; | ||
def section_details : FF<"section-details", "Display the section details">; | ||
|
@@ -64,6 +65,7 @@ def notes : FF<"notes", "Display notes">, Group<grp_elf>; | |
def program_headers : FF<"program-headers", "Display program headers">, Group<grp_elf>; | ||
def version_info : FF<"version-info", "Display version sections">, Group<grp_elf>; | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: spurious extra line. |
||
// Mach-O specific options. | ||
def grp_mach_o : OptionGroup<"kind">, HelpText<"OPTIONS (Mach-O specific)">; | ||
def macho_data_in_code : FF<"macho-data-in-code", "Display Data in Code command">, Group<grp_mach_o>; | ||
|
Uh oh!
There was an error while loading. Please reload this page.