diff --git a/llvm/lib/MC/MCSectionXCOFF.cpp b/llvm/lib/MC/MCSectionXCOFF.cpp --- a/llvm/lib/MC/MCSectionXCOFF.cpp +++ b/llvm/lib/MC/MCSectionXCOFF.cpp @@ -88,6 +88,8 @@ bool MCSectionXCOFF::UseCodeAlign() const { return getKind().isText(); } bool MCSectionXCOFF::isVirtualSection() const { - assert(isCsect() && "Only csect section can be virtual!"); + // DWARF sections are always not virtual. + if (isDWARFSection()) + return false; return XCOFF::XTY_CM == CsectProp->Type; } diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp --- a/llvm/lib/MC/XCOFFObjectWriter.cpp +++ b/llvm/lib/MC/XCOFFObjectWriter.cpp @@ -265,7 +265,7 @@ // All the XCOFF sections, in the order they will appear in the section header // table. - std::array Sections{{&Text, &Data, &BSS}}; + std::vector Sections; CsectGroup &getCsectGroup(const MCSectionXCOFF *MCSec); @@ -285,12 +285,21 @@ uint64_t); void writeSymbolTableEntryForControlSection(const ControlSection &, int16_t, XCOFF::StorageClass); + void writeSymbolTableEntryForDWARFSection(const DWARFSection &, int16_t); void writeFileHeader(); void writeSectionHeaderTable(); void writeSections(const MCAssembler &Asm, const MCAsmLayout &Layout); + void writeSectionForControlSectionEntry(const MCAssembler &Asm, + const MCAsmLayout &Layout, + const CsectSectionEntry &CsectEntry, + uint32_t &CurrentAddressLocation); + void writeSectionForDWARFSectionEntry(const MCAssembler &Asm, + const MCAsmLayout &Layout, + const DWARFSectionEntry &DWARFEntry, + uint32_t &CurrentAddressLocation); void writeSymbolTable(const MCAsmLayout &Layout); void writeRelocations(); - void writeRelocation(XCOFFRelocation Reloc, const ControlSection &CSection); + void writeRelocation(XCOFFRelocation Reloc, const XCOFFSection &Section); // Called after all the csects and symbols have been processed by // `executePostLayoutBinding`, this function handles building up the majority @@ -329,7 +338,11 @@ Data(".data", XCOFF::STYP_DATA, /* IsVirtual */ false, CsectGroups{&DataCsects, &FuncDSCsects, &TOCCsects}), BSS(".bss", XCOFF::STYP_BSS, /* IsVirtual */ true, - CsectGroups{&BSSCsects}) {} + CsectGroups{&BSSCsects}) { + Sections.push_back(&Text); + Sections.push_back(&Data); + Sections.push_back(&BSS); +} void XCOFFObjectWriter::reset() { // Clear the mappings we created. @@ -338,8 +351,11 @@ UndefinedCsects.clear(); // Reset any sections we have written to, and empty the section header table. - for (auto *Sec : Sections) + for (auto *Sec : Sections) { Sec->reset(); + if (isa(Sec)) + free(Sec); + } // Reset states in XCOFFObjectWriter. SymbolTableEntryCount = 0; @@ -410,17 +426,26 @@ const auto *MCSec = cast(&S); assert(SectionMap.find(MCSec) == SectionMap.end() && "Cannot add a section twice."); - assert(XCOFF::XTY_ER != MCSec->getCSectType() && - "An undefined csect should not get registered."); // If the name does not fit in the storage provided in the symbol table // entry, add it to the string table. if (nameShouldBeInStringTable(MCSec->getSymbolTableName())) Strings.add(MCSec->getSymbolTableName()); - CsectGroup &Group = getCsectGroup(MCSec); - Group.emplace_back(MCSec); - SectionMap[MCSec] = &Group.back(); + if (MCSec->isCsect()) { + assert(XCOFF::XTY_ER != MCSec->getCSectType() && + "An undefined csect should not get registered."); + CsectGroup &Group = getCsectGroup(MCSec); + Group.emplace_back(MCSec); + SectionMap[MCSec] = &Group.back(); + } else if (MCSec->isDWARFSection()) { + DWARFSection *DWARFSec = new DWARFSection(MCSec); + DWARFSectionEntry *SecEntry = new DWARFSectionEntry( + MCSec->getName(), MCSec->getSecFlags(), DWARFSec); + Sections.push_back(SecEntry); + SectionMap[MCSec] = DWARFSec; + } else + llvm_unreachable("unsupport section type!"); } for (const MCSymbol &S : Asm.symbols()) { @@ -485,10 +510,14 @@ auto getVirtualAddress = [this, &Layout](const MCSymbol *Sym, - const MCSectionXCOFF *ContainingCsect) { + const MCSectionXCOFF *ContainingSect) { // If Sym is a csect, return csect's address. - // If Sym is a label, return csect's address + label's offset from the csect. - return SectionMap[ContainingCsect]->Address + + // If Sym is a label, return csect's address + label's offset from the + // csect. + // If Sym is a DWARF section, return label's offset from the DWARF section. + return (ContainingSect->isDWARFSection() + ? 0 + : SectionMap[ContainingSect]->Address) + (Sym->isDefined() ? Layout.getSymbolOffset(*Sym) : 0); }; @@ -570,39 +599,14 @@ const MCAsmLayout &Layout) { uint32_t CurrentAddressLocation = 0; for (const auto *Section : Sections) { - assert(isa(Section) && "Only csect entry is supported!"); - auto CsectEntry = dyn_cast(Section); - // Nothing to write for this Section. - if (CsectEntry->Index == SectionEntry::UninitializedIndex || - CsectEntry->IsVirtual) - continue; - - // There could be a gap (without corresponding zero padding) between - // sections. - assert(CurrentAddressLocation <= CsectEntry->Address && - "CurrentAddressLocation should be less than or equal to section " - "address."); - - CurrentAddressLocation = CsectEntry->Address; - - for (const auto *Group : CsectEntry->Groups) { - for (const auto &Csect : *Group) { - if (uint32_t PaddingSize = Csect.Address - CurrentAddressLocation) - W.OS.write_zeros(PaddingSize); - if (Csect.Size) - Asm.writeSectionData(W.OS, Csect.MCSec, Layout); - CurrentAddressLocation = Csect.Address + Csect.Size; - } - } - - // The size of the tail padding in a section is the end virtual address of - // the current section minus the the end virtual address of the last csect - // in that section. - if (uint32_t PaddingSize = - CsectEntry->Address + CsectEntry->Size - CurrentAddressLocation) { - W.OS.write_zeros(PaddingSize); - CurrentAddressLocation += PaddingSize; - } + if (auto *CsectEntry = dyn_cast(Section)) + writeSectionForControlSectionEntry(Asm, Layout, *CsectEntry, + CurrentAddressLocation); + else if (auto *DWARFEntry = dyn_cast(Section)) + writeSectionForDWARFSectionEntry(Asm, Layout, *DWARFEntry, + CurrentAddressLocation); + else + llvm_unreachable("unsupport section type!"); } } @@ -685,6 +689,34 @@ W.write(0); } +void XCOFFObjectWriter::writeSymbolTableEntryForDWARFSection( + const DWARFSection &DWARFSectionRef, int16_t SectionIndex) { + // n_name, n_zeros, n_offset + writeSymbolName(DWARFSectionRef.getSymbolTableName()); + // n_value + W.write(0); + // n_scnum + W.write(SectionIndex); + // n_type + W.write(0); + // n_sclass + W.write(XCOFF::C_DWARF); + // Always 1 aux entry for now. + W.write(1); + + // Now output the auxiliary entry. + // x_scnlen + W.write(DWARFSectionRef.Size); + // Reserved + W.write(0); + // x_nreloc. Set to 0 for now. + W.write(0); + // Reserved + W.write(0); + // Reserved + W.write(0); +} + void XCOFFObjectWriter::writeSymbolTableEntryForControlSection( const ControlSection &CSectionRef, int16_t SectionIndex, XCOFF::StorageClass StorageClass) { @@ -753,8 +785,15 @@ // Write the Physical Address and Virtual Address. In an object file these // are the same. - W.write(Sec->Address); - W.write(Sec->Address); + // We now use 0 for DWARF section Physical and Virtual Addresses. + if (isa(Sec)) { + W.write(0); + W.write(0); + } else { + assert(isa(Sec) && "unsupported section type!"); + W.write(Sec->Address); + W.write(Sec->Address); + } W.write(Sec->Size); W.write(Sec->FileOffsetToData); @@ -768,13 +807,22 @@ // Line number counts. Not supported yet. W.write(0); - W.write(Sec->Flags); + // DWARF related flags are stored in MCXCOFFSection. + if (auto *DWARFSecEntry = dyn_cast(Sec)) + W.write(DWARFSecEntry->DWARFSect->MCSec->getSecFlags()); + else + W.write(Sec->Flags); } } void XCOFFObjectWriter::writeRelocation(XCOFFRelocation Reloc, - const ControlSection &CSection) { - W.write(CSection.Address + Reloc.FixupOffsetInCsect); + const XCOFFSection &Section) { + if (isa(Section)) + W.write(Section.Address + Reloc.FixupOffsetInCsect); + else { + assert(isa(Section) && "unsupport section type!"); + W.write(Reloc.FixupOffsetInCsect); + } W.write(Reloc.SymbolTableIndex); W.write(Reloc.SignAndSize); W.write(Reloc.Type); @@ -786,18 +834,21 @@ // Nothing to write for this Section. continue; - assert(isa(Section) && "Only csect entry is supported!"); - auto CsectEntry = dyn_cast(Section); - - for (const auto *Group : CsectEntry->Groups) { - if (Group->empty()) - continue; + if (auto *CsectEntry = dyn_cast(Section)) { + for (const auto *Group : CsectEntry->Groups) { + if (Group->empty()) + continue; - for (const auto &Csect : *Group) { - for (const auto Reloc : Csect.Relocations) - writeRelocation(Reloc, Csect); + for (const auto &Csect : *Group) { + for (const auto Reloc : Csect.Relocations) + writeRelocation(Reloc, Csect); + } } - } + } else if (auto *DWARFEntry = dyn_cast(Section)) { + for (const auto Reloc : DWARFEntry->DWARFSect->Relocations) + writeRelocation(Reloc, *DWARFEntry->DWARFSect); + } else + llvm_unreachable("unsupport section type!"); } } @@ -834,24 +885,27 @@ // Nothing to write for this Section. continue; - assert(isa(Section) && "Only csect entry is supported!"); - auto CsectEntry = dyn_cast(Section); - - for (const auto *Group : CsectEntry->Groups) { - if (Group->empty()) - continue; + if (auto *CsectEntry = dyn_cast(Section)) { + for (const auto *Group : CsectEntry->Groups) { + if (Group->empty()) + continue; - const int16_t SectionIndex = CsectEntry->Index; - for (const auto &Csect : *Group) { - // Write out the control section first and then each symbol in it. - writeSymbolTableEntryForControlSection( - Csect, SectionIndex, Csect.MCSec->getStorageClass()); + const int16_t SectionIndex = CsectEntry->Index; + for (const auto &Csect : *Group) { + // Write out the control section first and then each symbol in it. + writeSymbolTableEntryForControlSection( + Csect, SectionIndex, Csect.MCSec->getStorageClass()); - for (const auto &Sym : Csect.Syms) - writeSymbolTableEntryForCsectMemberLabel( - Sym, Csect, SectionIndex, Layout.getSymbolOffset(*(Sym.MCSym))); + for (const auto &Sym : Csect.Syms) + writeSymbolTableEntryForCsectMemberLabel( + Sym, Csect, SectionIndex, Layout.getSymbolOffset(*(Sym.MCSym))); + } } - } + } else if (auto *DWARFEntry = dyn_cast(Section)) + writeSymbolTableEntryForDWARFSection(*DWARFEntry->DWARFSect, + DWARFEntry->Index); + else + llvm_unreachable("unsupport section type!"); } } @@ -861,39 +915,38 @@ // Nothing to record for this Section. continue; - assert(isa(Section) && "Only csect entry is supported!"); - auto CsectEntry = dyn_cast(Section); - - for (const auto *Group : CsectEntry->Groups) { - if (Group->empty()) - continue; - - for (auto &Csect : *Group) { - const size_t CsectRelocCount = Csect.Relocations.size(); - if (CsectRelocCount >= XCOFF::RelocOverflow || - Section->RelocationCount >= XCOFF::RelocOverflow - CsectRelocCount) - report_fatal_error( - "relocation entries overflowed; overflow section is " - "not implemented yet"); - - CsectEntry->RelocationCount += CsectRelocCount; + if (auto *CsectEntry = dyn_cast(Section)) { + for (const auto *Group : CsectEntry->Groups) { + if (Group->empty()) + continue; + + for (auto &Csect : *Group) { + const size_t CsectRelocCount = Csect.Relocations.size(); + if (CsectRelocCount >= XCOFF::RelocOverflow || + Section->RelocationCount >= + XCOFF::RelocOverflow - CsectRelocCount) + report_fatal_error( + "relocation entries overflowed; overflow section is " + "not implemented yet"); + + CsectEntry->RelocationCount += CsectRelocCount; + } } - } + } else if (auto *DWARFEntry = dyn_cast(Section)) + DWARFEntry->RelocationCount = DWARFEntry->DWARFSect->Relocations.size(); + else + llvm_unreachable("unsupport section type!"); } // Calculate the file offset to the relocation entries. uint64_t RawPointer = RelocationEntryOffset; for (auto Sec : Sections) { - assert(isa(Sec) && "Only csect entry is supported!"); - auto CsectEntry = dyn_cast(Sec); - - if (CsectEntry->Index == SectionEntry::UninitializedIndex || - !CsectEntry->RelocationCount) + if (Sec->Index == SectionEntry::UninitializedIndex || !Sec->RelocationCount) continue; - CsectEntry->FileOffsetToRelocations = RawPointer; + Sec->FileOffsetToRelocations = RawPointer; const uint32_t RelocationSizeInSec = - CsectEntry->RelocationCount * XCOFF::RelocationSerializationSize32; + Sec->RelocationCount * XCOFF::RelocationSerializationSize32; RawPointer += RelocationSizeInSec; if (RawPointer > UINT32_MAX) report_fatal_error("Relocation data overflowed this object file."); @@ -927,53 +980,75 @@ int32_t SectionIndex = 1; for (auto *Section : Sections) { - assert(isa(Section) && "Only csect entry is supported!"); - auto CsectEntry = dyn_cast(Section); - const bool IsEmpty = - llvm::all_of(CsectEntry->Groups, - [](const CsectGroup *Group) { return Group->empty(); }); - if (IsEmpty) - continue; - - if (SectionIndex > MaxSectionIndex) - report_fatal_error("Section index overflow!"); - CsectEntry->Index = SectionIndex++; - SectionCount++; - - bool SectionAddressSet = false; - for (auto *Group : CsectEntry->Groups) { - if (Group->empty()) + if (auto *CsectEntry = dyn_cast(Section)) { + const bool IsEmpty = + llvm::all_of(CsectEntry->Groups, + [](const CsectGroup *Group) { return Group->empty(); }); + if (IsEmpty) continue; - for (auto &Csect : *Group) { - const MCSectionXCOFF *MCSec = Csect.MCSec; - Csect.Address = alignTo(Address, MCSec->getAlignment()); - Csect.Size = Layout.getSectionAddressSize(MCSec); - Address = Csect.Address + Csect.Size; - Csect.SymbolTableIndex = SymbolTableIndex; - SymbolIndexMap[MCSec->getQualNameSymbol()] = Csect.SymbolTableIndex; - // 1 main and 1 auxiliary symbol table entry for the csect. - SymbolTableIndex += 2; - - for (auto &Sym : Csect.Syms) { - Sym.SymbolTableIndex = SymbolTableIndex; - SymbolIndexMap[Sym.MCSym] = Sym.SymbolTableIndex; - // 1 main and 1 auxiliary symbol table entry for each contained - // symbol. + if (SectionIndex > MaxSectionIndex) + report_fatal_error("Section index overflow!"); + CsectEntry->Index = SectionIndex++; + SectionCount++; + + bool SectionAddressSet = false; + for (auto *Group : CsectEntry->Groups) { + if (Group->empty()) + continue; + + for (auto &Csect : *Group) { + const MCSectionXCOFF *MCSec = Csect.MCSec; + Csect.Address = alignTo(Address, MCSec->getAlignment()); + Csect.Size = Layout.getSectionAddressSize(MCSec); + Address = Csect.Address + Csect.Size; + Csect.SymbolTableIndex = SymbolTableIndex; + SymbolIndexMap[MCSec->getQualNameSymbol()] = Csect.SymbolTableIndex; + // 1 main and 1 auxiliary symbol table entry for the csect. SymbolTableIndex += 2; + + for (auto &Sym : Csect.Syms) { + Sym.SymbolTableIndex = SymbolTableIndex; + SymbolIndexMap[Sym.MCSym] = Sym.SymbolTableIndex; + // 1 main and 1 auxiliary symbol table entry for each contained + // symbol. + SymbolTableIndex += 2; + } } - } - if (!SectionAddressSet) { - CsectEntry->Address = Group->front().Address; - SectionAddressSet = true; + if (!SectionAddressSet) { + CsectEntry->Address = Group->front().Address; + SectionAddressSet = true; + } } - } - // Make sure the address of the next section aligned to - // DefaultSectionAlign. - Address = alignTo(Address, DefaultSectionAlign); - CsectEntry->Size = Address - CsectEntry->Address; + // Make sure the address of the next section aligned to + // DefaultSectionAlign. + Address = alignTo(Address, DefaultSectionAlign); + CsectEntry->Size = Address - CsectEntry->Address; + } else if (auto *DWARFEntry = dyn_cast(Section)) { + if (SectionIndex > MaxSectionIndex) + report_fatal_error("Section index overflow!"); + DWARFSection &DWARFSect = *DWARFEntry->DWARFSect; + const MCSectionXCOFF *MCSec = DWARFSect.MCSec; + DWARFEntry->Index = SectionIndex++; + SectionCount++; + DWARFSect.Address = alignTo(Address, MCSec->getAlignment()); + // For DWARF section, we must use the real size which which is not + // aligned. + DWARFSect.Size = Layout.getSectionAddressSize(MCSec); + Address = DWARFSect.Address + DWARFSect.Size; + DWARFSect.SymbolTableIndex = SymbolTableIndex; + SymbolIndexMap[MCSec->getQualNameSymbol()] = DWARFSect.SymbolTableIndex; + // 1 main and 1 auxiliary symbol table entry for the csect. + SymbolTableIndex += 2; + + DWARFEntry->Address = DWARFSect.Address; + + DWARFEntry->Size = DWARFSect.Size; + Address = alignTo(Address, DefaultSectionAlign); + } else + llvm_unreachable("unsupport section type!"); } SymbolTableEntryCount = SymbolTableIndex; @@ -982,14 +1057,17 @@ uint64_t RawPointer = sizeof(XCOFF::FileHeader32) + auxiliaryHeaderSize() + SectionCount * sizeof(XCOFF::SectionHeader32); for (auto *Sec : Sections) { - assert(isa(Sec) && "Only csect entry is supported!"); - auto CsectEntry = dyn_cast(Sec); - if (CsectEntry->Index == SectionEntry::UninitializedIndex || - CsectEntry->IsVirtual) + if (Sec->Index == SectionEntry::UninitializedIndex || + (isa(Sec) && + dyn_cast(Sec)->IsVirtual)) continue; - CsectEntry->FileOffsetToData = RawPointer; - RawPointer += CsectEntry->Size; + Sec->FileOffsetToData = RawPointer; + // Some section entries, like DWARF section size is not aligned, so + // RawPointer may be not aligned. + RawPointer += Sec->Size; + // Make sure RawPointer is aligned. + RawPointer = alignTo(RawPointer, DefaultSectionAlign); if (RawPointer > UINT32_MAX) report_fatal_error("Section raw data overflowed this object file."); } @@ -997,6 +1075,59 @@ RelocationEntryOffset = RawPointer; } +void XCOFFObjectWriter::writeSectionForControlSectionEntry( + const MCAssembler &Asm, const MCAsmLayout &Layout, + const CsectSectionEntry &CsectEntry, uint32_t &CurrentAddressLocation) { + // Nothing to write for this Section. + if (CsectEntry.Index == SectionEntry::UninitializedIndex || + CsectEntry.IsVirtual) + return; + + // There could be a gap (without corresponding zero padding) between + // sections. + assert(CurrentAddressLocation <= CsectEntry.Address && + "CurrentAddressLocation should be less than or equal to section " + "address."); + + CurrentAddressLocation = CsectEntry.Address; + + for (const auto *Group : CsectEntry.Groups) { + for (const auto &Csect : *Group) { + if (uint32_t PaddingSize = Csect.Address - CurrentAddressLocation) + W.OS.write_zeros(PaddingSize); + if (Csect.Size) + Asm.writeSectionData(W.OS, Csect.MCSec, Layout); + CurrentAddressLocation = Csect.Address + Csect.Size; + } + } + + // The size of the tail padding in a section is the end virtual address of + // the current section minus the the end virtual address of the last csect + // in that section. + if (uint32_t PaddingSize = + CsectEntry.Address + CsectEntry.Size - CurrentAddressLocation) { + W.OS.write_zeros(PaddingSize); + CurrentAddressLocation += PaddingSize; + } +} + +void XCOFFObjectWriter::writeSectionForDWARFSectionEntry( + const MCAssembler &Asm, const MCAsmLayout &Layout, + const DWARFSectionEntry &DWARFEntry, uint32_t &CurrentAddressLocation) { + if (uint32_t PaddingSize = DWARFEntry.Address - CurrentAddressLocation) + W.OS.write_zeros(PaddingSize); + if (DWARFEntry.Size) + Asm.writeSectionData(W.OS, DWARFEntry.DWARFSect->MCSec, Layout); + CurrentAddressLocation = DWARFEntry.Address + DWARFEntry.Size; + // DWARF section size is not align to DefaultSectionAlign, we must make sure + // current section end address is align to DefaultSectionAlign. + uint32_t Mod = CurrentAddressLocation % DefaultSectionAlign; + uint32_t TailPaddingSize = Mod ? DefaultSectionAlign - Mod : 0; + if (TailPaddingSize) + W.OS.write_zeros(TailPaddingSize); + CurrentAddressLocation = alignTo(CurrentAddressLocation, DefaultSectionAlign); +} + // Takes the log base 2 of the alignment and shifts the result into the 5 most // significant bits of a byte, then or's in the csect type into the least // significant 3 bits. diff --git a/llvm/test/DebugInfo/XCOFF/empty.ll b/llvm/test/DebugInfo/XCOFF/empty.ll --- a/llvm/test/DebugInfo/XCOFF/empty.ll +++ b/llvm/test/DebugInfo/XCOFF/empty.ll @@ -3,6 +3,8 @@ ; RUN: FileCheck %s --check-prefix=ASM32 ; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | \ ; RUN: FileCheck %s --check-prefix=ASM64 +; RUN: llc -mtriple powerpc-ibm-aix-xcoff -filetype=obj < %s | \ +; RUN: llvm-dwarfdump --all - | FileCheck %s --check-prefix=DWARF32 source_filename = "1.c" target datalayout = "E-m:a-p:32:32-i64:64-n32" @@ -434,3 +436,96 @@ ; ASM64-NEXT: .byte 1 ; ASM64-NEXT: .byte 1 ; ASM64-NEXT: L..debug_line_end0: + +; DWARF32: : file format aixcoff-rs6000 +; DWARF32: .debug_abbrev contents: +; DWARF32-NEXT: Abbrev table for offset: 0x00000000 +; DWARF32-NEXT: [1] DW_TAG_compile_unit DW_CHILDREN_yes +; DWARF32-NEXT: DW_AT_producer DW_FORM_strp +; DWARF32-NEXT: DW_AT_language DW_FORM_data2 +; DWARF32-NEXT: DW_AT_name DW_FORM_strp +; DWARF32-NEXT: DW_AT_stmt_list DW_FORM_sec_offset +; DWARF32-NEXT: DW_AT_comp_dir DW_FORM_strp +; DWARF32-NEXT: DW_AT_low_pc DW_FORM_addr +; DWARF32-NEXT: DW_AT_high_pc DW_FORM_data4 +; DWARF32: [2] DW_TAG_subprogram DW_CHILDREN_no +; DWARF32-NEXT: DW_AT_low_pc DW_FORM_addr +; DWARF32-NEXT: DW_AT_high_pc DW_FORM_data4 +; DWARF32-NEXT: DW_AT_frame_base DW_FORM_exprloc +; DWARF32-NEXT: DW_AT_name DW_FORM_strp +; DWARF32-NEXT: DW_AT_decl_file DW_FORM_data1 +; DWARF32-NEXT: DW_AT_decl_line DW_FORM_data1 +; DWARF32-NEXT: DW_AT_prototyped DW_FORM_flag_present +; DWARF32-NEXT: DW_AT_type DW_FORM_ref4 +; DWARF32-NEXT: DW_AT_external DW_FORM_flag_present +; DWARF32: [3] DW_TAG_base_type DW_CHILDREN_no +; DWARF32-NEXT: DW_AT_name DW_FORM_strp +; DWARF32-NEXT: DW_AT_encoding DW_FORM_data1 +; DWARF32-NEXT: DW_AT_byte_size DW_FORM_data1 +; DWARF32: .debug_info contents: +; DWARF32-NEXT: 0x00000000: Compile Unit: length = 0x0000003f, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x04 (next unit at 0x00000043) +; DWARF32: 0x0000000b: DW_TAG_compile_unit +; DWARF32-NEXT: DW_AT_producer ("clang version 12.0.0") +; DWARF32-NEXT: DW_AT_language (DW_LANG_C99) +; DWARF32-NEXT: DW_AT_name ("1.c") +; DWARF32-NEXT: DW_AT_stmt_list (0x00000000) +; DWARF32-NEXT: DW_AT_comp_dir ("debug") +; DWARF32-NEXT: DW_AT_low_pc (0x00000000) +; DWARF32-NEXT: DW_AT_high_pc (0x00000026) +; DWARF32: 0x00000026: DW_TAG_subprogram +; DWARF32-NEXT: DW_AT_low_pc (0x00000000) +; DWARF32-NEXT: DW_AT_high_pc (0x00000026) +; DWARF32-NEXT: DW_AT_frame_base (DW_OP_reg1 R1) +; DWARF32-NEXT: DW_AT_name ("main") +; DWARF32-NEXT: DW_AT_decl_file ("debug/1.c") +; DWARF32-NEXT: DW_AT_decl_line (1) +; DWARF32-NEXT: DW_AT_prototyped (true) +; DWARF32-NEXT: DW_AT_type (0x0000003b "int") +; DWARF32-NEXT: DW_AT_external (true) +; DWARF32: 0x0000003b: DW_TAG_base_type +; DWARF32-NEXT: DW_AT_name ("int") +; DWARF32-NEXT: DW_AT_encoding (DW_ATE_signed) +; DWARF32-NEXT: DW_AT_byte_size (0x04) +; DWARF32: 0x00000042: NULL +; DWARF32: .debug_line contents: +; DWARF32-NEXT: debug_line[0x00000000] +; DWARF32-NEXT: Line table prologue: +; DWARF32-NEXT: total_length: 0x00000032 +; DWARF32-NEXT: format: DWARF32 +; DWARF32-NEXT: version: 4 +; DWARF32-NEXT: prologue_length: 0x0000001b +; DWARF32-NEXT: min_inst_length: 4 +; DWARF32-NEXT: max_ops_per_inst: 1 +; DWARF32-NEXT: default_is_stmt: 1 +; DWARF32-NEXT: line_base: -5 +; DWARF32-NEXT: line_range: 14 +; DWARF32-NEXT: opcode_base: 13 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_copy] = 0 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_advance_pc] = 1 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_advance_line] = 1 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_set_file] = 1 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_set_column] = 1 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_negate_stmt] = 0 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_set_basic_block] = 0 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_const_add_pc] = 0 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_set_prologue_end] = 0 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0 +; DWARF32-NEXT: standard_opcode_lengths[DW_LNS_set_isa] = 1 +; DWARF32-NEXT: file_names[ 1]: +; DWARF32-NEXT: name: "1.c" +; DWARF32-NEXT: dir_index: 0 +; DWARF32-NEXT: mod_time: 0x00000000 +; DWARF32-NEXT: length: 0x00000000 +; DWARF32: Address Line Column File ISA Discriminator Flags +; DWARF32-NEXT: ------------------ ------ ------ ------ --- ------------- ------------- +; DWARF32-NEXT: 0x0000000000000000 2 0 1 0 0 is_stmt +; DWARF32-NEXT: 0x0000000000000004 3 3 1 0 0 is_stmt prologue_end +; DWARF32-NEXT: 0x0000000000000024 3 3 1 0 0 is_stmt end_sequence +; DWARF32: .debug_str contents: +; DWARF32-NEXT: 0x00000000: "clang version 12.0.0" +; DWARF32-NEXT: 0x00000015: "1.c" +; DWARF32-NEXT: 0x00000019: "debug" +; DWARF32-NEXT: 0x0000001f: "main" +; DWARF32-NEXT: 0x00000024: "int" +