ELF: Implement --start-lib and --end-lib
authorRui Ueyama <ruiu@google.com>
Thu, 7 Apr 2016 19:24:51 +0000 (19:24 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 7 Apr 2016 19:24:51 +0000 (19:24 +0000)
commitf8baa6605674e1a1ff3fd60b750e42291a4442c5
treefa77552d5ac507bcbf461c7cfb662c5527616a59
parent43b7b5b846e17011e94569bf76e25beada30ca56
ELF: Implement --start-lib and --end-lib

start-lib and end-lib are options to link object files in the same
semantics as archive files. If an object is in start-lib and end-lib,
the object is linked only when the file is needed to resolve
undefined symbols. That means, if an object is in start-lib and end-lib,
it behaves as if it were in an archive file.

In this patch, I introduced a new notion, LazyObjectFile. That is
analogous to Archive file type, but that works for a single object
file instead of for an archive file.

http://reviews.llvm.org/D18814

llvm-svn: 265710
13 files changed:
lld/ELF/Driver.cpp
lld/ELF/Driver.h
lld/ELF/InputFiles.cpp
lld/ELF/InputFiles.h
lld/ELF/Options.td
lld/ELF/OutputSections.cpp
lld/ELF/SymbolTable.cpp
lld/ELF/SymbolTable.h
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/test/ELF/lto/Inputs/start-lib.ll [new file with mode: 0644]
lld/test/ELF/lto/start-lib.ll [new file with mode: 0644]
lld/test/ELF/start-lib.s [new file with mode: 0644]