Summary: Add XCOFF recognition of debug section types
under `--section-headers` option.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D103079
bool isSectionText(DataRefImpl Sec) const override;
bool isSectionData(DataRefImpl Sec) const override;
bool isSectionBSS(DataRefImpl Sec) const override;
+ bool isDebugSection(DataRefImpl Sec) const override;
bool isSectionVirtual(DataRefImpl Sec) const override;
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
return Flags & (XCOFF::STYP_BSS | XCOFF::STYP_TBSS);
}
+bool XCOFFObjectFile::isDebugSection(DataRefImpl Sec) const {
+ uint32_t Flags = getSectionFlags(Sec);
+ return Flags & (XCOFF::STYP_DEBUG | XCOFF::STYP_DWARF);
+}
+
bool XCOFFObjectFile::isSectionVirtual(DataRefImpl Sec) const {
return is64Bit() ? toSection64(Sec)->FileOffsetToRawData == 0
: toSection32(Sec)->FileOffsetToRawData == 0;
# CHECK-NEXT: 2 .bss 00000000 00000010 BSS
# CHECK-NEXT: 3 .tdata 00000004 00000000 DATA
# CHECK-NEXT: 4 .tbss 00000000 00000000 BSS
+# CHECK-NEXT: 5 .dwline 00000046 00000000 DEBUG
+# CHECK-NEXT: 6 .debug 00000046 00000000 DEBUG
--- !XCOFF
FileHeader:
- Name: .tbss
Size: 0x0
Flags: [ STYP_TBSS ]
+ - Name: .dwline
+ Size: 0x46
+ Flags: [ STYP_DWARF ]
+ - Name: .debug
+ Size: 0x46
+ Flags: [ STYP_DEBUG ]
## Check the -h/--section-headers option prints long section names.
# RUN: yaml2obj %s --docnum=2 -o %t-longname.o