Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions llvm/docs/CommandGuide/llvm-readelf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ OPTIONS

Display all notes.

.. option:: --offloading

Display list of HIP offload bundles.

.. option:: --pretty-print

When used with :option:`--elf-output-style`, JSON output will be formatted in
Expand Down
4 changes: 0 additions & 4 deletions llvm/docs/CommandGuide/llvm-readobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ file formats.
Do not demangle symbol names in the output. This option is only for ELF and
XCOFF file formats. The option is enabled by default.

.. option:: --offloading

Display list of HIP offload bundles.

.. option:: --relocations, --relocs, -r

Display the relocation entries in the file.
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Object/OffloadBundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ struct OffloadBundleURI {
OffsetStr.getAsInteger(10, O);
Str = Str.drop_front(OffsetStr.size());

if (!Str.consume_front("&size="))
if (Str.consume_front("&size="))
return createStringError(object_error::parse_failed,
"Reading 'size' in URI");

Expand Down
18 changes: 9 additions & 9 deletions llvm/lib/Object/OffloadBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ Error OffloadBundleFatBin::readEntries(StringRef Buffer,
uint64_t EntryIDSize;
StringRef EntryID;

if (Error Err = Reader.readInteger(EntryOffset))
return Err;
if (auto EC = Reader.readInteger(EntryOffset))
return errorCodeToError(object_error::parse_failed);

if (Error Err = Reader.readInteger(EntrySize))
return Err;
if (auto EC = Reader.readInteger(EntrySize))
return errorCodeToError(object_error::parse_failed);

if (Error Err = Reader.readInteger(EntryIDSize))
return Err;
if (auto EC = Reader.readInteger(EntryIDSize))
return errorCodeToError(object_error::parse_failed);

if (Error Err = Reader.readFixedString(EntryID, EntryIDSize))
return Err;
if (auto EC = Reader.readFixedString(EntryID, EntryIDSize))
return errorCodeToError(object_error::parse_failed);

auto Entry = std::make_unique<OffloadBundleEntry>(
EntryOffset + SectionOffset, EntrySize, EntryIDSize, EntryID);
Expand All @@ -125,7 +125,7 @@ OffloadBundleFatBin::create(MemoryBufferRef Buf, uint64_t SectionOffset,
// Read the Bundle Entries
Error Err = TheBundle->readEntries(Buf.getBuffer(), SectionOffset);
if (Err)
return Err;
return errorCodeToError(object_error::parse_failed);

return std::unique_ptr<OffloadBundleFatBin>(TheBundle);
}
Expand Down
26 changes: 0 additions & 26 deletions llvm/test/tools/llvm-readobj/ELF/AMDGPU/offloading-fail.test

This file was deleted.

27 changes: 0 additions & 27 deletions llvm/test/tools/llvm-readobj/ELF/AMDGPU/offloading.test

This file was deleted.

12 changes: 0 additions & 12 deletions llvm/tools/llvm-readobj/ObjDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#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"
Expand Down Expand Up @@ -232,14 +230,4 @@ 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());

// Print out all the FatBin Bundles that are contained in this buffer.
for (const auto &[Index, Bundle] : llvm::enumerate(Bundles))
Bundle.printEntriesAsURI();
}

} // namespace llvm
2 changes: 0 additions & 2 deletions llvm/tools/llvm-readobj/ObjDumper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/OffloadBinary.h"
#include "llvm/Support/CommandLine.h"

#include <unordered_set>
Expand Down Expand Up @@ -189,7 +188,6 @@ class ObjDumper {
std::function<Error(const Twine &Msg)> WarningHandler;
void reportUniqueWarning(Error Err) const;
void reportUniqueWarning(const Twine &Msg) const;
void printOffloading(const object::ObjectFile &Obj);

protected:
ScopedPrinter &W;
Expand Down
1 change: 0 additions & 1 deletion llvm/tools/llvm-readobj/Opts.td
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ 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">;
Expand Down
5 changes: 0 additions & 5 deletions llvm/tools/llvm-readobj/llvm-readobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ static bool HashHistogram;
static bool Memtag;
static bool NeededLibraries;
static bool Notes;
static bool Offloading;
static bool ProgramHeaders;
static bool SectionGroups;
static std::vector<std::string> SFrame;
Expand Down Expand Up @@ -275,7 +274,6 @@ static void parseOptions(const opt::InputArgList &Args) {
opts::Memtag = Args.hasArg(OPT_memtag);
opts::NeededLibraries = Args.hasArg(OPT_needed_libs);
opts::Notes = Args.hasArg(OPT_notes);
opts::Offloading = Args.hasArg(OPT_offloading);
opts::PrettyPrint = Args.hasArg(OPT_pretty_print);
opts::ProgramHeaders = Args.hasArg(OPT_program_headers);
opts::SectionGroups = Args.hasArg(OPT_section_groups);
Expand Down Expand Up @@ -461,8 +459,6 @@ static void dumpObject(ObjectFile &Obj, ScopedPrinter &Writer,
Dumper->printGnuHashTable();
if (opts::VersionInfo)
Dumper->printVersionInfo();
if (opts::Offloading)
Dumper->printOffloading(Obj);
if (opts::StringTable)
Dumper->printStringTable();
if (Obj.isELF()) {
Expand Down Expand Up @@ -711,7 +707,6 @@ int llvm_readobj_main(int argc, char **argv, const llvm::ToolContext &) {
opts::DynamicTable = true;
opts::Notes = true;
opts::VersionInfo = true;
opts::Offloading = true;
opts::UnwindInfo = true;
opts::SectionGroups = true;
opts::HashHistogram = true;
Expand Down