Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a

compile unit. Make these relocations on the platforms that need
relocations and add a routine to ensure that we don't put the
addresses in an offset table for split dwarf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2014-01-24 11:40:29 +00:00
parent 45cd8c8ac1
commit a268ba84d7
6 changed files with 46 additions and 17 deletions

View File

@ -187,6 +187,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
DwarfAddrSectionSym = 0;
DwarfAbbrevDWOSectionSym = DwarfStrDWOSectionSym = 0;
FunctionBeginSym = FunctionEndSym = 0;
TextSectionBeginSym = TextSectionEndSym = 0;
CurFn = 0;
CurMI = 0;
@ -1061,9 +1062,12 @@ void DwarfDebug::finalizeModuleInfo() {
addSectionLabel(Asm, U, U->getUnitDie(), dwarf::DW_AT_ranges,
Asm->GetTempSymbol("cu_ranges", U->getUniqueID()),
DwarfDebugRangeSectionSym);
else
U->addUInt(U->getUnitDie(), dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr,
0);
else {
U->addLocalLabelAddress(U->getUnitDie(), dwarf::DW_AT_low_pc,
TextSectionBeginSym);
U->addLocalLabelAddress(U->getUnitDie(), dwarf::DW_AT_high_pc,
TextSectionEndSym);
}
}
}
@ -1117,6 +1121,10 @@ void DwarfDebug::endSections() {
Sym = Asm->GetTempSymbol("debug_end", ID);
Asm->OutStreamer.SwitchSection(Section);
Asm->OutStreamer.EmitLabel(Sym);
// If this is the end of the text section keep track of where the end of
// the section is so that we can use it later.
if (Section == Asm->getObjFileLowering().getTextSection())
TextSectionEndSym = Sym;
}
// Insert a final terminator.
@ -2012,6 +2020,8 @@ void DwarfDebug::emitSectionLabels() {
DwarfDebugLocSectionSym =
emitSectionSym(Asm, TLOF.getDwarfLocSection(), "section_debug_loc");
TextSectionBeginSym = emitSectionSym(Asm, TLOF.getTextSection(), "text_begin");
}
// Recursively emits a debug information entry.