summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFContext.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/DWARFContext.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/DWARFContext.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFContext.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp
index 845718d195d..9a2c7cc1962 100644
--- a/llvm/lib/DebugInfo/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARFContext.cpp
@@ -60,12 +60,13 @@ static void dumpPubSection(raw_ostream &OS, StringRef Name, StringRef Data,
}
}
-static void dumpAccelSection(raw_ostream &OS, StringRef Name, StringRef Data,
- StringRef StringSection, bool LittleEndian) {
- DataExtractor AccelSection(Data, LittleEndian, 0);
+static void dumpAccelSection(raw_ostream &OS, StringRef Name,
+ const DWARFSection& Section, StringRef StringSection,
+ bool LittleEndian) {
+ DataExtractor AccelSection(Section.Data, LittleEndian, 0);
DataExtractor StrData(StringSection, LittleEndian, 0);
OS << "\n." << Name << " contents:\n";
- DWARFAcceleratorTable Accel(AccelSection, StrData);
+ DWARFAcceleratorTable Accel(AccelSection, StrData, Section.Relocs);
if (!Accel.extract())
return;
Accel.dump(OS);
@@ -593,11 +594,11 @@ DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj)
.Case("debug_str.dwo", &StringDWOSection)
.Case("debug_str_offsets.dwo", &StringOffsetDWOSection)
.Case("debug_addr", &AddrSection)
- .Case("apple_names", &AppleNamesSection)
- .Case("apple_types", &AppleTypesSection)
- .Case("apple_namespaces", &AppleNamespacesSection)
- .Case("apple_namespac", &AppleNamespacesSection)
- .Case("apple_objc", &AppleObjCSection)
+ .Case("apple_names", &AppleNamesSection.Data)
+ .Case("apple_types", &AppleTypesSection.Data)
+ .Case("apple_namespaces", &AppleNamespacesSection.Data)
+ .Case("apple_namespac", &AppleNamespacesSection.Data)
+ .Case("apple_objc", &AppleObjCSection.Data)
// Any more debug info sections go here.
.Default(nullptr);
if (SectionData) {
@@ -630,6 +631,11 @@ DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj)
.Case("debug_loc", &LocSection.Relocs)
.Case("debug_info.dwo", &InfoDWOSection.Relocs)
.Case("debug_line", &LineSection.Relocs)
+ .Case("apple_names", &AppleNamesSection.Relocs)
+ .Case("apple_types", &AppleTypesSection.Relocs)
+ .Case("apple_namespaces", &AppleNamespacesSection.Relocs)
+ .Case("apple_namespac", &AppleNamespacesSection.Relocs)
+ .Case("apple_objc", &AppleObjCSection.Relocs)
.Default(nullptr);
if (!Map) {
// Find debug_types relocs by section rather than name as there are
OpenPOWER on IntegriCloud