summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-04-24 10:19:45 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-04-24 10:19:45 +0000
commitca53211beb5e552ed1c661844f333726eca8fd50 (patch)
tree81a65785491f6dfd449043c21bac08dfb99867f5 /llvm/tools
parentdf0497c4aaabd119d5d835bce6339be8fed58602 (diff)
downloadbcm5719-llvm-ca53211beb5e552ed1c661844f333726eca8fd50.tar.gz
bcm5719-llvm-ca53211beb5e552ed1c661844f333726eca8fd50.zip
[DWARF] - Take relocations in account when extracting ranges from .debug_ranges
I found this when investigated "Bug 32319 - .gdb_index is broken/incomplete" for LLD. When we have object file with .debug_ranges section it may be filled with zeroes. Relocations are exist in file to relocate this zeroes into real values later, but until that a pair of zeroes is treated as terminator. And DWARF parser thinks there is no ranges at all when I am trying to collect address ranges for building .gdb_index. Solution implemented in this patch is to take relocations in account when parsing ranges. Differential revision: https://reviews.llvm.org/D32228 llvm-svn: 301170
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/dsymutil/DwarfLinker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp
index ce991290d6a..f74d721e614 100644
--- a/llvm/tools/dsymutil/DwarfLinker.cpp
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp
@@ -2869,7 +2869,7 @@ void DwarfLinker::patchRangesForUnit(const CompileUnit &Unit,
DWARFDebugRangeList RangeList;
const auto &FunctionRanges = Unit.getFunctionRanges();
unsigned AddressSize = Unit.getOrigUnit().getAddressByteSize();
- DataExtractor RangeExtractor(OrigDwarf.getRangeSection(),
+ DataExtractor RangeExtractor(OrigDwarf.getRangeSection().Data,
OrigDwarf.isLittleEndian(), AddressSize);
auto InvalidRange = FunctionRanges.end(), CurrRange = InvalidRange;
DWARFUnit &OrigUnit = Unit.getOrigUnit();
@@ -2884,7 +2884,7 @@ void DwarfLinker::patchRangesForUnit(const CompileUnit &Unit,
for (const auto &RangeAttribute : Unit.getRangesAttributes()) {
uint32_t Offset = RangeAttribute.get();
RangeAttribute.set(Streamer->getRangesSectionSize());
- RangeList.extract(RangeExtractor, &Offset);
+ RangeList.extract(RangeExtractor, &Offset, OrigDwarf.getRangeSection().Relocs);
const auto &Entries = RangeList.getEntries();
if (!Entries.empty()) {
const DWARFDebugRangeList::RangeListEntry &First = Entries.front();
OpenPOWER on IntegriCloud