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

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 12 01:56:06 PDT 2025


================
@@ -0,0 +1,42 @@
+## Test that --offloading with a fatbin works correctly
+# REQUIRES: target={{x86_64-.*-linux.*}}
+# REQUIRES: amdgpu-registered-target
+
+# RUN: yaml2obj %s -o %t.elf
+# RUN: llvm-readobj --offloading %t.elf | \ 
+# RUN: FileCheck %s --input-file=%t.out -DFILE_NAME=%t.elf
+
+# CHECK:        host-x86_64-unknown-linux--     file://[[FILE_NAME]]#offset=8192&size=0
+# CHECK-NEXT:   hipv4-amdgcn-amd-amdhsa--gfx908 file://[[FILE_NAME]]#offset=8192&size=4048
+
+--- !ELF
+FileHeader:
+  Class:           ELFCLASS64
+  Data:            ELFDATA2LSB
+  Type:            ET_EXEC
+  Machine:         EM_X86_64
+  Entry:           0x2041B0
----------------
jh7370 wrote:

We normally omit fields that aren't actually needed, to better highlight the important behaviour. I suspect these two are redundant (I'm less certain about `Entry`).

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


More information about the llvm-commits mailing list