[PATCH] D13815: [ELF2] Add support for Gnu Hash section

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 14:01:15 PDT 2015


On Fri, Oct 16, 2015 at 1:57 PM, Joerg Sonnenberger via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Fri, Oct 16, 2015 at 07:36:43PM +0000, Rui Ueyama via llvm-commits
> wrote:
> > ================
> > Comment at: ELF/OutputSections.cpp:233
> > @@ +232,3 @@
> > +  uint32_t H = 5381;
> > +  for (unsigned char C : Name)
> > +    H = (H << 5) + H + C;
> > ----------------
> > Remove unsigned.
>
> That would change the semantic, wouldn't it?
>

Because H is uint32_t, C will be promoted to uint32_t, no?

I wanted this change for consistency with HashSysv which is defined above.


>
> > ================
> > Comment at: ELF/OutputSections.h:263
> > @@ +262,3 @@
> > +  static const unsigned NBucketsEstimation[];
> > +  static const unsigned NBucketsEstimationCount;
> > +  std::vector<HashData> HashedSymbols;
> > ----------------
> > Remove this. You can use sizeof(Primes) / sizeof(Prime[0]).
>
> Even better: array_lengthof.
>
> Joerg
> _______________________________________________
> 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/20151016/195e5ced/attachment.html>


More information about the llvm-commits mailing list