diff options
author | Frederic Riss <friss@apple.com> | 2014-11-14 19:30:08 +0000 |
---|---|---|
committer | Frederic Riss <friss@apple.com> | 2014-11-14 19:30:08 +0000 |
commit | 7c5004768402da67864a24f9bf02784354f2b79b (patch) | |
tree | eebcfa18a8d3d1a2643f3ff0337f487788dd67fa /llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp | |
parent | 0ee6800a3128f7afadb9131562660bd5f55438ef (diff) | |
download | bcm5719-llvm-7c5004768402da67864a24f9bf02784354f2b79b.tar.gz bcm5719-llvm-7c5004768402da67864a24f9bf02784354f2b79b.zip |
[dwarfdump] Handle relocations in Dwarf accelerator tables
ELF targets (and maybe COFF) use relocations when referring
to strings in the .debug_str section. Handle that in the
accelerator table dumper. This commit restores the
test/DebugInfo/cross-cu-inlining.ll test to its expected
platform independant form, validating that the fix works
(this test failed on linux boxes).
llvm-svn: 222029
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp index 4b844e999eb..50283b40ca8 100644 --- a/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp +++ b/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp @@ -92,7 +92,13 @@ void DWARFAcceleratorTable::dump(raw_ostream &OS) { OS << " Invalid section offset\n"; continue; } - while (unsigned StringOffset = AccelSection.getU32(&DataOffset)) { + while (AccelSection.isValidOffsetForDataOfSize(DataOffset, 4)) { + unsigned StringOffset = AccelSection.getU32(&DataOffset); + RelocAddrMap::const_iterator Reloc = Relocs.find(DataOffset-4); + if (Reloc != Relocs.end()) + StringOffset += Reloc->second.second; + if (!StringOffset) + break; OS << format(" Name: %08x \"%s\"\n", StringOffset, StringSection.getCStr(&StringOffset)); unsigned NumData = AccelSection.getU32(&DataOffset); |