[PATCH] D25472: [ELF] - Implemented -z wxneeded.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 15:27:36 PDT 2016


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM with this fix.



================
Comment at: ELF/Writer.cpp:1112
 
+  if (Config->ZWxneeded)
+    AddHdr(PT_OPENBSD_WXNEEDED, PF_X);
----------------
Just like other PT_ values in this function, this needs comment. We essentially should write more comments what it is and why we are doing this, because it is easy to forget and cannot always be inferred from what we are doing.

  // PT_OPENBSD_WXNEEDED is a OpenBSD-specific header to mark the executable
  // is expected to perform W^X violations, such as calling mprotect(2) or mmap(2)
  // with PROT_WRITE | PROT_EXEC, which is prohibited by default on OpenBSD.


https://reviews.llvm.org/D25472





More information about the llvm-commits mailing list