[PATCH] D52126: Discard uncompressed buffer after creating .gdb_index contents.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 17 16:01:03 PDT 2018
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)?
On Fri, Sep 14, 2018 at 4:00 PM Rui Ueyama via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rLLD342297: Discard uncompressed buffer after creating
> .gdb_index contents. (authored by ruiu, committed by ).
>
> Changed prior to commit:
> https://reviews.llvm.org/D52126?vs=165605&id=165607#toc
>
> Repository:
> rLLD LLVM Linker
>
> https://reviews.llvm.org/D52126
>
> Files:
> ELF/InputSection.h
> ELF/SyntheticSections.cpp
>
>
> Index: ELF/SyntheticSections.cpp
> ===================================================================
> --- ELF/SyntheticSections.cpp
> +++ ELF/SyntheticSections.cpp
> @@ -2495,13 +2495,6 @@
> template <class ELFT> GdbIndexSection *GdbIndexSection::create() {
> std::vector<InputSection *> Sections = getDebugInfoSections();
>
> - // .debug_gnu_pub{names,types} are useless in executables.
> - // They are present in input object files solely for creating
> - // a .gdb_index. So we can remove them from the output.
> - for (InputSectionBase *S : InputSections)
> - if (S->Name == ".debug_gnu_pubnames" || S->Name ==
> ".debug_gnu_pubtypes")
> - S->Live = false;
> -
> std::vector<GdbChunk> Chunks(Sections.size());
> std::vector<std::vector<NameTypeEntry>> NameTypes(Sections.size());
>
> @@ -2515,6 +2508,16 @@
> NameTypes[I] = readPubNamesAndTypes(Dwarf, I);
> });
>
> + // .debug_gnu_pub{names,types} are useless in executables.
> + // They are present in input object files solely for creating
> + // a .gdb_index. So we can remove them from the output.
> + for (InputSectionBase *S : InputSections) {
> + if (S->Name != ".debug_gnu_pubnames" && S->Name !=
> ".debug_gnu_pubtypes")
> + continue;
> + S->Live = false;
> + S->DecompressBuf.reset();
> + }
> +
> auto *Ret = make<GdbIndexSection>();
> Ret->Chunks = std::move(Chunks);
> Ret->Symbols = createSymbols(NameTypes);
> Index: ELF/InputSection.h
> ===================================================================
> --- ELF/InputSection.h
> +++ ELF/InputSection.h
> @@ -205,7 +205,6 @@
> return llvm::makeArrayRef<T>((const T *)Data.data(), S / sizeof(T));
> }
>
> -private:
> // A pointer that owns decompressed data if a section is compressed by
> zlib.
> // Since the feature is not used often, this is usually a nullptr.
> std::unique_ptr<char[]> DecompressBuf;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180917/34d9a2e0/attachment.html>
More information about the llvm-commits
mailing list