[llvm] [llvm-objdump] print out xcoff file header and load section header for xcoff object file with option private-headers (PR #96350)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 00:44:09 PDT 2024


================
@@ -0,0 +1,83 @@
+## Test the --privated-headers option for XCOFF object files.
+
+# RUN: yaml2obj --docnum=1 %s -o %t_xcoff32.o
+# RUN: yaml2obj --docnum=2  %s -o %t_xcoff64.o
+# RUN: llvm-objdump --private-headers %t_xcoff32.o |\
+# RUN:   FileCheck %s --check-prefixes=CHECK32 --match-full-lines
+# RUN: llvm-objdump --private-headers %t_xcoff64.o |\
+# RUN:   FileCheck %s --check-prefixes=CHECK64 --match-full-lines
+
+--- !XCOFF
+FileHeader:
+  MagicNumber:       0x1DF
+Sections:
+  - Name:            .loader
+    Flags:           [ STYP_LOADER ]
+    SectionData:     "0000000100000003000000050000016D00000001000000A40000001800000211"
----------------
jh7370 wrote:

I'd prefer yaml2obj to be updated to support this section type specially, without the need of a binary blob. Is there anything preventing this? In the ideal world, this would allow a shared YAML for the 64-bit and 32-bit version (except for a MagicNumber define value provided on the command-line).

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


More information about the llvm-commits mailing list