diff options
author | David Blaikie <dblaikie@gmail.com> | 2018-12-22 22:20:40 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2018-12-22 22:20:40 +0000 |
commit | 2a38c17b34b3893c1557446f19097b045110301f (patch) | |
tree | c70d91962ce72ae9c7bffaae9d27b34794574aa6 /llvm/lib/DebugInfo | |
parent | 25179613f67ddf037ab378a3966187d1d986fa92 (diff) | |
download | bcm5719-llvm-2a38c17b34b3893c1557446f19097b045110301f.tar.gz bcm5719-llvm-2a38c17b34b3893c1557446f19097b045110301f.zip |
DebugInfo: Accurately propagate the section used by a relocation when accessing ranges defined by low/high_pc
This is difficult/not possible to test in LLVM, but is visible as a
crash in LLD when parsing DWARF to generate gdb-index.
This function is called by llvm-dwarfdump when parsing high_pc for
non-verbose output (to print the actual high_pc rather than the low_pc
relative value), but in that case llvm-dwarfdump doesn't print section
names (if it did, it would hit this problem).
We could add some other features to llvm-dwarfdump to expose this, but
nothing really springs to my mind. I will add a test to lld, though.
llvm-svn: 350010
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index fd692ab519c..81ef0c8c7ae 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -466,13 +466,13 @@ Optional<uint64_t> DWARFDie::getHighPC(uint64_t LowPC) const { bool DWARFDie::getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC, uint64_t &SectionIndex) const { auto F = find(DW_AT_low_pc); - auto LowPcAddr = toAddress(F); + auto LowPcAddr = toSectionedAddress(F); if (!LowPcAddr) return false; - if (auto HighPcAddr = getHighPC(*LowPcAddr)) { - LowPC = *LowPcAddr; + if (auto HighPcAddr = getHighPC(LowPcAddr->Address)) { + LowPC = LowPcAddr->Address; HighPC = *HighPcAddr; - SectionIndex = F->getSectionIndex(); + SectionIndex = LowPcAddr->SectionIndex; return true; } return false; |