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

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 12:02:48 PST 2015


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

LGTM with two small changes.


================
Comment at: ELF/Writer.cpp:435
@@ -411,1 +434,3 @@
 
+  bool AIsRelRo = isRelroSection(A);
+  bool BIsRelRo = isRelroSection(B);
----------------
Add a comment saying that relro go before plain rw sections.

================
Comment at: ELF/Writer.cpp:757
@@ -728,1 +756,3 @@
     OutputSections[I]->SectionIndex = I + 1;
+    HasRelro =
+        HasRelro || (Config->ZRelro && isRelroSection(OutputSections[I]));
----------------
Use |=


http://reviews.llvm.org/D14218





More information about the llvm-commits mailing list