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

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 20:37:59 PDT 2018


espindola added inline comments.


================
Comment at: lld/ELF/Writer.cpp:2211
+      continue;
+    fillTrap(Buf + alignDown(Sec->Offset + Sec->Size, Target->PageSize));
+  }
----------------
ruiu wrote:
> espindola wrote:
> > Iterating over OutputSections seems like a good idea, but couldn't this fill just the area between two sections?
> We can. The reason why I'm doing this is because this way, trap instructions are always 4 byte aligned even if the last segment is not 4 byte aligned. But I can fix it some way.
Interesting. We have the same latent bug in OutputSection::writeTo. I guess we have to add nop for ppc (where not all bytes are the same) to test a fix.



https://reviews.llvm.org/D44943





More information about the llvm-commits mailing list