[PATCH] D81052: [ELF] Handle -u before input files

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 08:12:23 PDT 2020


psmith added a comment.

Looks sensible to me. A couple of comment suggestions only.



================
Comment at: lld/ELF/Driver.cpp:1473
 
 // Force Sym to be entered in the output. Used for -u or equivalent.
 static void handleUndefined(Symbol *sym) {
----------------
We now no longer use this function for -u, will be worth updating comment.


================
Comment at: lld/ELF/Driver.cpp:1885
 
-  // Handle the `--undefined <sym>` options.
-  for (StringRef arg : config->undefined)
-    if (Symbol *sym = symtab->find(arg))
-      handleUndefined(sym);
+  // Keep bitcode definitions in the symbol table.
+  for (StringRef name : config->undefined)
----------------
IIUC this is to prevent LTO from removing definitions. May be worth saying
```
// Prevent LTO from removing any definition referenced by an undefined.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81052





More information about the llvm-commits mailing list