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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 11:53:58 PST 2015


ruiu added a comment.

This is probably naive but obligatory question. Is relro segments considered actually useful? How many projects are using this for what?


================
Comment at: ELF/Driver.cpp:192
@@ -189,1 +191,3 @@
+    else if (S == "norelro")
+      Config->ZRelro = false;
   }
----------------
Why do they have norelro although they don't have nonow nor noorigin or such?

================
Comment at: ELF/Writer.cpp:739
@@ -732,1 +738,3 @@
       } else {
+        if (Config->ZRelro && !GnuRelroPhdr.p_filesz) {
+          // If section is .data or .bss, we should calculate the current
----------------
I don't really want to make this for-loop longer than that is now. This is getting hard to understand over time. Can you create another for loop and move this piece of code outside of the loop?


http://reviews.llvm.org/D14218





More information about the llvm-commits mailing list