[PATCH] D50017: ELF: Add libcall symbols to the link when LTO is being used.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 16:14:21 PDT 2018


pcc added a comment.

In https://reviews.llvm.org/D50017#1181305, @ruiu wrote:

> I'm wondering if we have to keep the list of symbols that could be added as undefined symbols by LTO. If LTO adds new undefined symbol, we always have to resolve them whatever they are, no?


The code generator should, in principle, never be adding a new undefined symbol during LTO that the linker doesn't already know about either via the bitcode symbol table or the list of libcall functions. It is a bug for it to add any other undefined symbols. We need the list of undefined symbols from libcalls for the same reason why we need the list of undefined symbols from bitcode symbol tables: to make sure that we've added everything we need to the link before starting LTO. To do otherwise creates the possibility of needing to do LTO multiple times (once for the initial set of bitcode files and again (possibly multiple times) for the expanded set of bitcode files after discovering the undefined references), which could lead to subtle bugs if not done correctly, complicates the implementation of LTO and could make it (even) slower.


Repository:
  rL LLVM

https://reviews.llvm.org/D50017





More information about the llvm-commits mailing list