[PATCH] D23326: [ELF] - Linkerscript: reimplemented output sections constrains matching functionality.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 13:48:56 PDT 2016


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

LGTM


================
Comment at: ELF/LinkerScript.cpp:263-264
@@ +262,4 @@
+    bool Writable = Sec->getSectionHdr()->sh_flags & SHF_WRITE;
+    bool RO = (Kind == ConstraintKind::ReadOnly);
+    bool RW = (Kind == ConstraintKind::ReadWrite);
+    return (RO && Writable) || (RW && !Writable);
----------------
Hoist RO and RW because they are actually constants.

   bool RO = (Kind == ConstraintKind::ReadOnly);
   bool RW = (Kind == ConstraintKind:: ReadWriter);
   return !llvm::any_of(Sections, [=](InputSectionBase<ELFT> *Sec) {
     bool Writable = ...;
     return (RO && Writable) || (RW && !Writable);
   });



https://reviews.llvm.org/D23326





More information about the llvm-commits mailing list