[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 Aug 9 01:58:23 PDT 2024
================
@@ -0,0 +1,38 @@
+## Test the --private-headers option for XCOFF object files.
+
+# RUN: yaml2obj -DMAGIC=0x1DF %s -o %t_xcoff32.o
+# RUN: yaml2obj -DMAGIC=0x1F7 %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: [[MAGIC]]
+Sections:
+ - Name: .text
+ Flags: [ STYP_TEXT ]
+ SectionData: "9061FFF880820000"
+ - Name: .data
+ Flags: [ STYP_DATA ]
+ SectionData: "0000000000000FC0"
+
+# CHECK32: ---File Header:
+# CHECK32-NEXT: Magic: 0x1df
+# CHECK32-NEXT: NumberOfSections: 2
+# CHECK32-NEXT: TimeStamp: None (0)
+# CHECK32-NEXT: SymbolTableOffset: 0x0
+# CHECK32-NEXT: SymbolTableEntries: 0
+# CHECK32-NEXT: OptionalHeaderSize: 0x0
+# CHECK32-NEXT: Flags: 0x0
+
+# CHECK64: ---File Header:
+# CHECK64-NEXT: Magic: 0x1f7
+# CHECK64-NEXT: NumberOfSections: 2
+# CHECK64-NEXT: TimeStamp: None (0)
+# CHECK64-NEXT: SymbolTableOffset: 0x0
+# CHECK64-NEXT: SymbolTableEntries: 0
+# CHECK64-NEXT: OptionalHeaderSize: 0x0
+# CHECK64-NEXT: Flags: 0x0
+
----------------
jh7370 wrote:
Nit: don't have additional blank lines at EOF...
https://github.com/llvm/llvm-project/pull/96350
More information about the llvm-commits
mailing list