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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 04:12:20 PDT 2016


grimar added a comment.

In https://reviews.llvm.org/D25472#567483, @ruiu wrote:

> Could you give me a pointer to the OpenBSD-local patch to GNU ld which implements this -z wxneeded feature? I'd like to look at that patch to see if this patch does the same thing.


https://github.com/openbsd/src/commit/2a5a8fc7e30928c2cff57cfe5fb491c90d8478ad



================
Comment at: ELF/Config.h:129
   bool ZRelro;
+  bool ZWXNeeded;
   DiscardPolicy Discard;
----------------
ruiu wrote:
> The variable naming rule here is to camel-case words with "-" as a word separator. Because "wxneeded" contains no hyphens, it should be handled as one word. Thus, `ZWxneeded`.
Done.


================
Comment at: ELF/LinkerScript.cpp:1717
                      .Case("PT_GNU_RELRO", PT_GNU_RELRO)
+                     .Case("PT_OPENBSD_WXNEEDED", PT_OPENBSD_WXNEEDED)
                      .Default(-1);
----------------
ruiu wrote:
> Sort.
This switch is sorted by constant value I think.


https://reviews.llvm.org/D25472





More information about the llvm-commits mailing list