[PATCH] D47234: ELF: Allow ICF on .data.rel.ro sections.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 16:06:19 PDT 2018


ruiu added inline comments.


================
Comment at: lld/ELF/ICF.cpp:165-167
   if (!S->Live || S->KeepUnique || !(S->Flags & SHF_ALLOC) ||
-      (S->Flags & SHF_WRITE))
+      ((S->Flags & SHF_WRITE) && S->Name != ".data.rel.ro" &&
+       !S->Name.startswith(".data.rel.ro.")))
----------------
This expressionis perhaps a bit too long. I'd split it by defining `bool IsWritable` or something, with a comment explaning that .data.rel.ro is essentially read-only.


https://reviews.llvm.org/D47234





More information about the llvm-commits mailing list