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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 10:42:29 PDT 2019


pcc added inline comments.


================
Comment at: lld/COFF/SymbolTable.cpp:588
+void SymbolTable::addLibcall(StringRef name) {
+  Symbol *sym = find(name);
+  if (!sym)
----------------
The logic here should depend on the name. If it begins with `\01` use `find` on `name.substr(1)`, otherwise use `findUnderscore`.


================
Comment at: lld/COFF/SymbolTable.cpp:595
+  if (Lazy *l = dyn_cast<Lazy>(sym))
+    addUndefined(sym->getName());
+}
----------------
In D50475 we limited this to symbols defined in bitcode. We should do the same for COFF.


================
Comment at: lld/test/COFF/libcall-archive.ll:10
+
+; CHECK-NOT: T __sync_val_compare_and_swap_8
+; CHECK: T _memcpy
----------------
I think this isn't actually testing for what you expect here because you're looking at the LTO output file, which won't contain `libcall-archive.s` since that isn't a bitcode file. Maybe you could test this by running FileCheck on the map file (`/lldmap:` output).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66355/new/

https://reviews.llvm.org/D66355





More information about the llvm-commits mailing list