diff options
author | George Rimar <grimar@accesssoftek.com> | 2018-03-23 14:43:51 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2018-03-23 14:43:51 +0000 |
commit | 98fe8229909930d7589500b138bc4adc223b4719 (patch) | |
tree | 2909decab9224baf9f3b309c40386f382e8a4b98 | |
parent | 957abdf333de4bfc96fdac44b253fda8b17123a5 (diff) |
[ELF] - Simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@328319 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | ELF/Writer.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ELF/Writer.cpp b/ELF/Writer.cpp index 99ce1c7ce..ffa29209e 100644 --- a/ELF/Writer.cpp +++ b/ELF/Writer.cpp @@ -1757,11 +1757,9 @@ template <class ELFT> std::vector<PhdrEntry *> Writer<ELFT>::createPhdrs() { // pages for the stack non-executable. If you really want an executable // stack, you can pass -z execstack, but that's not recommended for // security reasons. - unsigned Perm; + unsigned Perm = PF_R | PF_W; if (Config->ZExecstack) - Perm = PF_R | PF_W | PF_X; - else - Perm = PF_R | PF_W; + Perm |= PF_X; AddHdr(PT_GNU_STACK, Perm)->p_memsz = Config->ZStackSize; // PT_OPENBSD_WXNEEDED is a OpenBSD-specific header to mark the executable |