[PATCH] D66848: [lld-link] implement -start-lib and -end-lib

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 18:11:37 PDT 2019


inglorion added a comment.

Primarily, this change adds a LazyObject Symbol kind, and a LazyObjFile InputFile kind. A LazyObject represents a symbol defined in a LazyObjFile, and a LazyObjFile is either a native object file or a bitcode file that we know of, but have not yet decided to link in. As with the LazyArchive symbols we already had, when we encounter both a lazy symbol and an Undefined symbol, we resolve this by linking in the file that defines the symbol, so the result is a Defined symbol.

The change also modifies the way we track wholearchive. This was previously passed as a boolean. Because it doesn't make sense to have both wholearchive (which says to link in all objects in an archive regardless of whether their symbols are referenced) and -start-lib (which says to only link in objects only when their symbols are referenced), this change replaces this with a mode enum which can be wholearchive, lazy, or neither.

Finally, -start-lib and -end-lib are added to the options the linker accepts, and we perform some sanity checks (no -end-lib without -start-lib, for example).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66848





More information about the llvm-commits mailing list