[PATCH] D37009: [ELF] - Fix for "Bug 34238 - LTO is optimizing away symbols referenced from linker scripts"

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 09:46:57 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Driver.cpp:1017-1018
+  // are undefined symbols for them, so we add these to trigger that logic.
+  // We also want to add symbols referenced by linker script so that LTO
+  // can see them and perform DCE correctly.
+  for (StringRef Sym : Script->Opt.ReferencedSymbols)
----------------
You don't need to mention that because that is also applicable to all code that adds undefined symbols. If you add this comment, you need to add the same comment to line 1026, for example. Essentially, all undefined symbols must be added line 1025 as the comment for that line explains.


https://reviews.llvm.org/D37009





More information about the llvm-commits mailing list