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

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 13:09:07 PDT 2015


ikudrin added inline comments.

================
Comment at: ELF/OutputSections.cpp:237
@@ +236,3 @@
+    H = (H << 5) + H + C;
+  return H & 0xffffffff;
+}
----------------
ruiu wrote:
> ikudrin wrote:
> > ruiu wrote:
> > > ikudrin wrote:
> > > > rafael wrote:
> > > > > Given that you are using a uint32_t, this is a nop, no?
> > > > Thanks for reminding. The reference implementation uses uint_fast32_t, I think we should do the same.
> > > Unlike uint_fast32_t, uint32_t is always 32-bit. You don't need this mask.
> > Yep, but I'd prefer to replace the H's type with uint_fast32_t. What do you think?
> I don't prefer to use uint_fast32_t. I don't expect that would make any observable difference because I think the type would be mapped to uint32_t. In addition to that, the type is used so rarely that that would make the code look a bit odd. (If you are a reader, you'd have to stop and think about the type.)
OK.


http://reviews.llvm.org/D13815





More information about the llvm-commits mailing list