<div dir="ltr">Out of curiosity - would it be possible/useful to avoid keeping all the pubnames sections uncompressed at the same time? Would they be able to be processed one at a time (uncompress 1, process it, delete it, uncompress the second, process it, delete it, etc)?</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 14, 2018 at 4:00 PM Rui Ueyama via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rLLD342297: Discard uncompressed buffer after creating .gdb_index contents. (authored by ruiu, committed by ).<br>
<br>
Changed prior to commit:<br>
  <a href="https://reviews.llvm.org/D52126?vs=165605&id=165607#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D52126?vs=165605&id=165607#toc</a><br>
<br>
Repository:<br>
  rLLD LLVM Linker<br>
<br>
<a href="https://reviews.llvm.org/D52126" rel="noreferrer" target="_blank">https://reviews.llvm.org/D52126</a><br>
<br>
Files:<br>
  ELF/InputSection.h<br>
  ELF/SyntheticSections.cpp<br>
<br>
<br>
Index: ELF/SyntheticSections.cpp<br>
===================================================================<br>
--- ELF/SyntheticSections.cpp<br>
+++ ELF/SyntheticSections.cpp<br>
@@ -2495,13 +2495,6 @@<br>
 template <class ELFT> GdbIndexSection *GdbIndexSection::create() {<br>
   std::vector<InputSection *> Sections = getDebugInfoSections();<br>
<br>
-  // .debug_gnu_pub{names,types} are useless in executables.<br>
-  // They are present in input object files solely for creating<br>
-  // a .gdb_index. So we can remove them from the output.<br>
-  for (InputSectionBase *S : InputSections)<br>
-    if (S->Name == ".debug_gnu_pubnames" || S->Name == ".debug_gnu_pubtypes")<br>
-      S->Live = false;<br>
-<br>
   std::vector<GdbChunk> Chunks(Sections.size());<br>
   std::vector<std::vector<NameTypeEntry>> NameTypes(Sections.size());<br>
<br>
@@ -2515,6 +2508,16 @@<br>
     NameTypes[I] = readPubNamesAndTypes(Dwarf, I);<br>
   });<br>
<br>
+  // .debug_gnu_pub{names,types} are useless in executables.<br>
+  // They are present in input object files solely for creating<br>
+  // a .gdb_index. So we can remove them from the output.<br>
+  for (InputSectionBase *S : InputSections) {<br>
+    if (S->Name != ".debug_gnu_pubnames" && S->Name != ".debug_gnu_pubtypes")<br>
+      continue;<br>
+    S->Live = false;<br>
+    S->DecompressBuf.reset();<br>
+  }<br>
+<br>
   auto *Ret = make<GdbIndexSection>();<br>
   Ret->Chunks = std::move(Chunks);<br>
   Ret->Symbols = createSymbols(NameTypes);<br>
Index: ELF/InputSection.h<br>
===================================================================<br>
--- ELF/InputSection.h<br>
+++ ELF/InputSection.h<br>
@@ -205,7 +205,6 @@<br>
     return llvm::makeArrayRef<T>((const T *)Data.data(), S / sizeof(T));<br>
   }<br>
<br>
-private:<br>
   // A pointer that owns decompressed data if a section is compressed by zlib.<br>
   // Since the feature is not used often, this is usually a nullptr.<br>
   std::unique_ptr<char[]> DecompressBuf;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>