[llvm] [XCOFF] Support the subtype in Dwarf section headers (PR #81667)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 01:32:21 PST 2024
================
@@ -0,0 +1,138 @@
+## Test that we can generate and read DWARF section headers.
+
+# RUN: yaml2obj --docnum=1 %s -o %t32
+# RUN: llvm-readobj --section-headers %t32 | \
+# RUN FileCheck --check-prefixes=HDRS,HDRS32 %s
+# RUN: obj2yaml %t32 | FileCheck --check-prefix=YAML %s
+
+# RUN: yaml2obj --docnum=1 -DMAGIC=0x01F7 %s -o %t64
+# RUN: llvm-readobj --section-headers %t64 | \
+# RUN FileCheck --check-prefixes=HDRS,HDRS64 %s
+# RUN: obj2yaml %t64 | FileCheck --check-prefix=YAML %s
+
+# YAML: - Name: .dwabrev
+# YAML: Flags: [ STYP_DWARF ]
+# YAML-NEXT: DWARFSectionSubtype: SSUBTYP_DWABREV
+# YAML: - Name: .dwinfo
+# YAML: Flags: [ STYP_DWARF ]
+# YAML-NEXT: DWARFSectionSubtype: SSUBTYP_DWINFO
+# YAML: - Name: .dwline
+# YAML: Flags: [ STYP_DWARF ]
+# YAML-NEXT: DWARFSectionSubtype: SSUBTYP_DWLINE
+
+# HDRS32: Format: aixcoff-rs6000
+# HDRS64: Format: aix5coff64-rs6000
+# HDRS: Arch: powerpc
+# HDRS-NEXT: AddressSize: 32bit
+# HDRS-NEXT: Sections [
+# HDRS-NEXT: Section {
+# HDRS: Index: 1
+# HDRS-NEXT: Name: .data
+# HDRS: Type: STYP_DATA (0x40)
+# HDRS-NEXT: }
+# HDRS-NEXT: Section {
+# HDRS-NEXT: Index: 2
+# HDRS-NEXT: Name: .dwabrev
+# HDRS: Type: STYP_DWARF (0x10)
+# HDRS-NEXT: DWARFSubType: SSUBTYP_DWABREV (0x60000)
+# HDRS-NEXT: }
+# HDRS-NEXT: Section {
+# HDRS-NEXT: Index: 3
+# HDRS-NEXT: Name: .dwinfo
+# HDRS: Type: STYP_DWARF (0x10)
+# HDRS-NEXT: DWARFSubType: SSUBTYP_DWINFO (0x10000)
+# HDRS-NEXT: }
+# HDRS-NEXT: Section {
+# HDRS-NEXT: Index: 4
+# HDRS-NEXT: Name: .dwline
+# HDRS: Type: STYP_DWARF (0x10)
+# HDRS-NEXT: DWARFSubType: SSUBTYP_DWLINE (0x20000)
+
+--- !XCOFF
+FileHeader:
+ MagicNumber: [[MAGIC=0x01DF]]
+ NumberOfSections: 4
+ CreationTime: 0
+ AuxiliaryHeaderSize: 0
+ Flags: 0x0
+Sections:
+ - Name: .data
+ Address: 0x0
+ Size: 0x4
+ Flags: [ STYP_DATA ]
+ SectionData: '00000001'
+ - Name: .dwabrev
+ Address: 0x0
+ Size: 0x4
+ Flags: [ STYP_DWARF ]
+ DWARFSectionSubtype: SSUBTYP_DWABREV
+ SectionData: 01110125
+ - Name: .dwinfo
+ Address: 0x0
+ Size: 0x4
+ Flags: [ STYP_DWARF ]
+ DWARFSectionSubtype: SSUBTYP_DWINFO
+ SectionData: 00000080
+ - Name: .dwline
+ Address: 0x0
+ Size: 0x4
+ Flags: [ STYP_DWARF ]
+ DWARFSectionSubtype: SSUBTYP_DWLINE
+ SectionData: 00000021
+StringTable: {}
+...
+
+
----------------
jh7370 wrote:
Nit: we avoid double-blank lines.
https://github.com/llvm/llvm-project/pull/81667
More information about the llvm-commits
mailing list