mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add the DW_AT_GNU_ranges_base attribute if we've emitted any ranges
into the debug_ranges section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191721 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2928,8 +2928,7 @@ void DwarfDebug::emitDebugMacInfo() {
|
||||
|
||||
// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
|
||||
// DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
|
||||
// DW_AT_ranges_base, DW_AT_addr_base. If DW_AT_ranges is present,
|
||||
// DW_AT_low_pc and DW_AT_high_pc are not used, and vice versa.
|
||||
// DW_AT_ranges_base, DW_AT_addr_base.
|
||||
CompileUnit *DwarfDebug::constructSkeletonCU(const CompileUnit *CU) {
|
||||
|
||||
DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
|
||||
@@ -2983,6 +2982,16 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const CompileUnit *CU) {
|
||||
DwarfGnuPubTypesSectionSym);
|
||||
}
|
||||
|
||||
// Flag if we've emitted any ranges and their location for the compile unit.
|
||||
if (DebugRangeSymbols.size()) {
|
||||
if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
|
||||
NewCU->addLabel(Die, dwarf::DW_AT_GNU_ranges_base,
|
||||
dwarf::DW_FORM_sec_offset, DwarfDebugRangeSectionSym);
|
||||
else
|
||||
NewCU->addUInt(Die, dwarf::DW_AT_GNU_ranges_base, dwarf::DW_FORM_data4,
|
||||
0);
|
||||
}
|
||||
|
||||
SkeletonHolder.addUnit(NewCU);
|
||||
SkeletonCUs.push_back(NewCU);
|
||||
|
||||
|
Reference in New Issue
Block a user