[PATCH] D44923: [ELF] Disable ICF for synthetic sections

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 06:23:16 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/ICF.cpp:166
+  // Don't merge read only data sections unless --ignore-data-address-equality
+  // was passed. Don't merge synthetic sections.
+  if ((!(S->Flags & SHF_EXECINSTR) && !Config->IgnoreDataAddressEquality) ||
----------------
Please explain why. We don't merge synthetic sections because their Data member doesn't have a meaningful value.


================
Comment at: ELF/ICF.cpp:168
+  if ((!(S->Flags & SHF_EXECINSTR) && !Config->IgnoreDataAddressEquality) ||
+      dyn_cast<SyntheticSection>(S))
     return false;
----------------
Maybe it's better to write this as two if's because the boolean expression is a bit too complicated.


https://reviews.llvm.org/D44923





More information about the llvm-commits mailing list