Fix .debug_range for linux. Patch by Krister Wombell.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2010-09-02 16:43:44 +00:00
parent 5a0fabae5a
commit b1fcfbe89b
6 changed files with 49 additions and 4 deletions

View File

@ -3130,10 +3130,17 @@ void DwarfDebug::emitDIE(DIE *Die) {
case dwarf::DW_AT_ranges: {
// DW_AT_range Value encodes offset in debug_range section.
DIEInteger *V = cast<DIEInteger>(Values[i]);
Asm->EmitLabelOffsetDifference(DwarfDebugRangeSectionSym,
V->getValue(),
DwarfDebugRangeSectionSym,
4);
if (Asm->MAI->doesDwarfUsesLabelOffsetForRanges()) {
Asm->EmitLabelPlusOffset(DwarfDebugRangeSectionSym,
V->getValue(),
4);
} else {
Asm->EmitLabelOffsetDifference(DwarfDebugRangeSectionSym,
V->getValue(),
DwarfDebugRangeSectionSym,
4);
}
break;
}
case dwarf::DW_AT_location: {