This patchs adds the necessary code for inspecting or creating offloading
binaries using the standing obj2yaml and yaml2obj features in LLVM.
Depends on D127774
Paths
| Differential D127776
[ObjectYAML] Add offloading binary implementations for obj2yaml and yaml2obj ClosedPublic Authored by jhuber6 on Jun 14 2022, 12:41 PM.
Details Summary This patchs adds the necessary code for inspecting or creating offloading Depends on D127774
Diff Detail
Event Timelinejhuber6 added a child revision: D126904: [llvm-objdump] Add support for dumping embedded offloading data.Jun 14 2022, 12:41 PM Comment Actions Have you got any reference material that I can read for the format of offloading binaries? I can't really review that this implementation does the right thing without knowing the format!
Comment Actions
Sure, it's documented here https://clang.llvm.org/docs/ClangOffloadPackager.html. More or less, it's just a few integers followed by a list of offsets into an Elf-like string table that forms a string map.
jhuber6 added inline comments.
Comment Actions Add tweaking of specific binary features and add a test to make sure we handle it explicitly.
Comment Actions LGTM.
This revision is now accepted and ready to land.Jun 27 2022, 1:25 AM This revision was landed with ongoing or failed builds.Jul 1 2022, 6:13 PM Closed by commit rG228c8f9cc0b2: [ObjectYAML] Add offloading binary implementations for obj2yaml and yaml2obj (authored by jhuber6). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 441834 llvm/include/llvm/Object/OffloadBinary.h
llvm/include/llvm/ObjectYAML/ObjectYAML.h
llvm/include/llvm/ObjectYAML/OffloadYAML.h
llvm/include/llvm/ObjectYAML/yaml2obj.h
llvm/lib/ObjectYAML/CMakeLists.txt
llvm/lib/ObjectYAML/ObjectYAML.cpp
llvm/lib/ObjectYAML/OffloadEmitter.cpp
llvm/lib/ObjectYAML/OffloadYAML.cpp
llvm/lib/ObjectYAML/yaml2obj.cpp
llvm/test/ObjectYAML/Offload/binary.yaml
llvm/test/ObjectYAML/Offload/default.yaml
llvm/test/ObjectYAML/Offload/enumeration_kinds.yaml
llvm/test/ObjectYAML/Offload/malformed-entry-size.yaml
llvm/test/ObjectYAML/Offload/malformed-offset.yaml
llvm/test/ObjectYAML/Offload/malformed-size.yaml
llvm/test/ObjectYAML/Offload/malformed-version.yaml
llvm/test/ObjectYAML/Offload/multiple_members.yaml
llvm/tools/obj2yaml/CMakeLists.txt
llvm/tools/obj2yaml/obj2yaml.h
llvm/tools/obj2yaml/obj2yaml.cpp
llvm/tools/obj2yaml/offload2yaml.cpp
|
I'd rather expect these two to be enums that correspond to the IMG and OFK values in the spec, with the option of specifying an arbitrary uint16_t value so that you can provide arbitrary values that don't have a defined mapping (this is a common pattern in ELF yaml2obj, for example).