[Lldb-commits] [PATCH] D44041: Only replace object file sections when non-empty

Francis Ricci via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 2 12:34:38 PST 2018


fjricci created this revision.
fjricci added reviewers: clayborg, zturner, labath.
Herald added subscribers: JDevlieghere, arichardson, emaste.

In order to allow some sections to exist either in split debug-info or in the main binary,
don't replace non-empty sections with empty sections.


https://reviews.llvm.org/D44041

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp


Index: source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
===================================================================
--- source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -141,7 +141,7 @@
             SectionType section_type = g_sections[idx];
             SectionSP section_sp(
                 objfile_section_list->FindSectionByType(section_type, true));
-            if (section_sp) {
+            if (section_sp && section_sp->GetFileSize()) {
               SectionSP module_section_sp(
                   module_section_list->FindSectionByType(section_type, true));
               if (module_section_sp)
Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -2004,7 +2004,7 @@
         SectionType section_type = g_sections[idx];
         SectionSP section_sp(
             elf_section_list->FindSectionByType(section_type, true));
-        if (section_sp) {
+        if (section_sp && section_sp->GetFileSize()) {
           SectionSP module_section_sp(
               unified_section_list.FindSectionByType(section_type, true));
           if (module_section_sp)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44041.136829.patch
Type: text/x-patch
Size: 1320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180302/4a129053/attachment.bin>


More information about the lldb-commits mailing list