[PATCH] D30530: [ELF] - Implemented -z text/-znotext

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 09:31:24 PST 2017


ruiu added inline comments.


================
Comment at: ELF/Driver.cpp:272
+  bool ZText = true;
+  for (auto *Arg : Args.filtered(OPT_z)) {
+    StringRef S = Arg->getValue();
----------------
Use llvm::reverse and return early.


================
Comment at: ELF/SyntheticSections.cpp:1109-1110
   add({DT_STRSZ, In<ELFT>::DynStrTab->getSize()});
+  if (Config->HasTextRel)
+    add({DT_TEXTREL, (uint64_t)0});
   if (In<ELFT>::GnuHashTab)
----------------
I don't think you need to check if there's actually text relocations. Set it unconditionally as long as Config->ZText is true.


https://reviews.llvm.org/D30530





More information about the llvm-commits mailing list