[lld] r314095 - Do not sort CU vectors.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 18:19:28 PDT 2017


Looks like that's what gold prepared for.

On Wed, Oct 11, 2017 at 6:11 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:
>
> > Author: ruiu
> > Date: Sun Sep 24 22:30:39 2017
> > New Revision: 314095
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=314095&view=rev
> > Log:
> > Do not sort CU vectors.
> >
> > We used to sort and uniquify CU vectors, but looks like CU vectors in
> > .gdb_index sections created by gold are not guaranteed to be sorted.
> >
> > Modified:
> >     lld/trunk/ELF/SyntheticSections.cpp
> >
> > Modified: lld/trunk/ELF/SyntheticSections.cpp
> > URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/
> SyntheticSections.cpp?rev=314095&r1=314094&r2=314095&view=diff
> > ============================================================
> ==================
> > --- lld/trunk/ELF/SyntheticSections.cpp (original)
> > +++ lld/trunk/ELF/SyntheticSections.cpp Sun Sep 24 22:30:39 2017
> > @@ -1797,16 +1797,17 @@ std::vector<std::vector<uint32_t>> GdbIn
> >          Off += Ent.Name.size() + 1;
> >          Ret.push_back({});
> >        }
> > -      Ret[Sym->CuVectorIndex].push_back((Ent.Type << 24) | Idx);
> > +
> > +      // gcc 5.4.1 produces a buggy .debug_gnu_pubnames that contains
> > +      // duplicate entries, so we want to dedup them.
> > +      std::vector<uint32_t> &Vec = Ret[Sym->CuVectorIndex];
> > +      uint32_t Val = (Ent.Type << 24) | Idx;
> > +      if (Vec.empty() || Vec.back() != Val)
> > +        Vec.push_back(Val);
>
> Are the duplicates always (or at lest frequently) adjacent?
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171011/c249730a/attachment.html>


More information about the llvm-commits mailing list