[PATCH] D14218: [ELF2] Implements -z relro: create an ELF "PT_GNU_RELRO" segment header in the object.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 1 09:57:48 PST 2015


grimar added inline comments.

================
Comment at: ELF/Driver.cpp:192
@@ -189,1 +191,3 @@
+    else if (S == "norelro")
+      Config->ZRelro = false;
   }
----------------
davide wrote:
> You already assign ZRelro to false so the last two lines (I think) can be removed, no?
I am not sure about that.  What will be if we specify both ones in the command line (-z relro -z norelro ... -z relro) ? I guess that processing both ones can also be helpfull here since that can be feature that is already used and works for overriding the option for somebody. 

But if first argument is not fine then it is still questionable which exactly lines should be removed then.
Like notes mentioned: looks like ld has ZRelro set to true by default. 
So I need to know should I do the same in this patch or not. If yes then not the last ones, but two lines before the last two are becoming redundant.


http://reviews.llvm.org/D14218





More information about the llvm-commits mailing list