[PATCH] D41928: [ELF] Fix SysV hash tables with --no-rosegment

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 22:42:16 PST 2018


ruiu added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:1839
 void HashTableSection::writeTo(uint8_t *Buf) {
   unsigned NumSymbols = InX::DynSymTab->getNumSymbols();
 
----------------
I'd do `memset(Buf, 0, Size)` here just like we did at beginning of GnuHashTableSection::writeTo(). That's less error-prone and easy to understand than filling holes with zeros. Zero-clearing a contiguous chunk of memory is very fast, so we don't have to minimize the number of bytes written to memory in this case.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41928





More information about the llvm-commits mailing list