mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
[DWARF parser] Use distinction between DW_AT_ranges_base and DW_AT_GNU_ranges_base instead of DWARF version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210945 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -225,12 +225,10 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
|
||||
setBaseAddress(BaseAddr);
|
||||
AddrOffsetSectionBase = DieArray[0].getAttributeValueAsSectionOffset(
|
||||
this, DW_AT_GNU_addr_base, 0);
|
||||
// Users of old DWARF may not know about DW_AT_ranges_base, so it is ignored
|
||||
// for skeleton CU DIE (e.g. DW_AT_ranges are *not* relative to it).
|
||||
if (Version > 4) {
|
||||
RangeSectionBase = DieArray[0].getAttributeValueAsSectionOffset(
|
||||
this, DW_AT_GNU_ranges_base, 0);
|
||||
}
|
||||
RangeSectionBase = DieArray[0].getAttributeValueAsSectionOffset(
|
||||
this, DW_AT_ranges_base, 0);
|
||||
// Don't fall back to DW_AT_GNU_ranges_base: it should be ignored for
|
||||
// skeleton CU DIE, so that DWARF users not aware of it are not broken.
|
||||
}
|
||||
|
||||
setDIERelations();
|
||||
@ -276,8 +274,7 @@ bool DWARFUnit::parseDWO() {
|
||||
}
|
||||
// Share .debug_addr and .debug_ranges section with compile unit in .dwo
|
||||
DWOCU->setAddrOffsetSection(AddrOffsetSection, AddrOffsetSectionBase);
|
||||
uint32_t DWORangesBase = DieArray[0].getAttributeValueAsSectionOffset(
|
||||
this, DW_AT_GNU_ranges_base, 0);
|
||||
uint32_t DWORangesBase = DieArray[0].getRangesBaseAttribute(this, 0);
|
||||
DWOCU->setRangesSection(RangeSection, DWORangesBase);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user