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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 13:07:25 PDT 2015


ruiu added inline comments.

================
Comment at: ELF/OutputSections.cpp:237
@@ +236,3 @@
+    H = (H << 5) + H + C;
+  return H & 0xffffffff;
+}
----------------
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.)


http://reviews.llvm.org/D13815





More information about the llvm-commits mailing list