summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2014-11-14 19:30:08 +0000
committerFrederic Riss <friss@apple.com>2014-11-14 19:30:08 +0000
commit7c5004768402da67864a24f9bf02784354f2b79b (patch)
treeeebcfa18a8d3d1a2643f3ff0337f487788dd67fa /llvm/lib/DebugInfo/DWARFAcceleratorTable.cpp
parent0ee6800a3128f7afadb9131562660bd5f55438ef (diff)
downloadbcm5719-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.cpp8
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);
OpenPOWER on IntegriCloud