[PATCH] D50475: ELF: Only add libcall symbols to the link if defined in bitcode.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 14:54:31 PDT 2018


pcc added a comment.

In https://reviews.llvm.org/D50475#1193055, @ruiu wrote:

> You don't need to call fetch again to add a file that you already have to the symbol table. You can directly add it by calling SymbolTable::addFile().


In more detail the scenario is:

1. in `handleLibcall` we call `fetch` on the `LazyArchive`, which gives us an `ObjFile`. As a side effect we add an entry to `Seen` for that object file
2. we do nothing with it
3. while adding the LTO object file, we call `SymbolTable::addLazyArchive` on one of the libcall symbols that the LTO object file needs (via `SymbolTable::addCombinedLTOObject` -> `ObjFile::parse`)
4. the call to ` F.fetch(Sym)` in that function returns nullptr because we added the entry to `Seen` in step 1, so we never add the object file to the link


Repository:
  rL LLVM

https://reviews.llvm.org/D50475





More information about the llvm-commits mailing list