[PATCH] D44943: Fill the last page of each executable section with 0xcc or equivalent.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 09:19:07 PDT 2018


ruiu added inline comments.


================
Comment at: lld/ELF/Writer.cpp:2202
+    if ((Sec->Offset + Sec->Size) % Target->PageSize == 0)
+      continue;
+
----------------
grimar wrote:
> Does it really make sense to optimize here? If so, then probably my patch was better,
> since it writes fewer bytes and is more straightforward. 
> If no (and I expect it is the case), then I would remove the check to simplify the code,
> writing few more pages should not be slow.
Writing to a single page is extremely fast, so no. And your patch is not straightforward because the code is more complicated. The point of this patch is that you don't need to iterate over Phdrs. You should just iterate over OutputSections.


https://reviews.llvm.org/D44943





More information about the llvm-commits mailing list