aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
diff options
context:
space:
mode:
authorAlexander Yermolovich <ayermolo@fb.com>2021-08-02 10:41:35 -0700
committerAlexander Yermolovich <ayermolo@fb.com>2021-08-02 10:41:47 -0700
commit5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6 (patch)
treeb8ca23a66ddd019ff24a3d9a30fd54e9641c9078 /llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
parentce1c59dea6d01e8ec3d4cb911438254283e4646c (diff)
downloadllvm-5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6.zip
llvm-5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6.tar.gz
llvm-5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6.tar.bz2
[DWARF] Don't process .debug_info relocations for DWO Context
When we build with split dwarf in single mode the .o files that contain both "normal" debug sections and dwo sections, along with relocaiton sections for "normal" debug sections. When we create DWARF context in DWARFObjInMemory we process relocations and store them in the map for .debug_info, etc section. For DWO Context we also do it for non dwo dwarf sections. Which I believe is not necessary. This leads to a lot of memory being wasted. We observed 70GB extra memory being used. I went with context sensitive approach, flag is passed in. I am not sure if it's always safe not to process relocations for regular debug sections if Obj contains .dwo sections. If it is alternatvie might be just to scan, in constructor, sections and if there are .dwo sections not to process regular debug ones. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D106624
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index a324ff7..54bfde0 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -536,8 +536,9 @@ static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
};
if (auto *Obj = dyn_cast<ObjectFile>(BinOrErr->get())) {
if (filterArch(*Obj)) {
- std::unique_ptr<DWARFContext> DICtx =
- DWARFContext::create(*Obj, nullptr, "", RecoverableErrorHandler);
+ std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(
+ *Obj, DWARFContext::ProcessDebugRelocations::Process, nullptr, "",
+ RecoverableErrorHandler);
if (!HandleObj(*Obj, *DICtx, Filename, OS))
Result = false;
}
@@ -548,8 +549,9 @@ static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
if (auto MachOOrErr = ObjForArch.getAsObjectFile()) {
auto &Obj = **MachOOrErr;
if (filterArch(Obj)) {
- std::unique_ptr<DWARFContext> DICtx =
- DWARFContext::create(Obj, nullptr, "", RecoverableErrorHandler);
+ std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(
+ Obj, DWARFContext::ProcessDebugRelocations::Process, nullptr, "",
+ RecoverableErrorHandler);
if (!HandleObj(Obj, *DICtx, ObjName, OS))
Result = false;
}