ELF: Implement basic support for --version-script.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 22 Apr 2016 20:21:26 +0000 (20:21 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 22 Apr 2016 20:21:26 +0000 (20:21 +0000)
commit66ac1d61526268d1f81db8ed1d5caccfed2452ec
treebf5c38f8b3876f120bcda9b8585ae73166fcb823
parente2eb5f837be29eaa9459ce62887df83e058c6acf
ELF: Implement basic support for --version-script.

This patch only implements support for version scripts of the form:
  { [ global: symbol1; symbol2; [...]; symbolN; ] local: *; };
No wildcards are supported, other than for the local entry. Symbol versioning
is also not supported.

It works by introducing a new Symbol flag which tracks whether a symbol
appears in the global section of a version script.

This patch also simplifies the logic in SymbolBody::isPreemptible(), and
teaches it to handle the case where symbols with default visibility in DSOs
do not appear in the dynamic symbol table because of a version script.

Fixes PR27482.

Differential Revision: http://reviews.llvm.org/D19430

llvm-svn: 267208
14 files changed:
lld/ELF/CMakeLists.txt
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/Driver.h
lld/ELF/Options.td
lld/ELF/SymbolListFile.cpp [moved from lld/ELF/DynamicList.cpp with 61% similarity]
lld/ELF/SymbolListFile.h [moved from lld/ELF/DynamicList.h with 71% similarity]
lld/ELF/SymbolTable.cpp
lld/ELF/SymbolTable.h
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/test/ELF/lto/internalize-version-script.ll [new file with mode: 0644]
lld/test/ELF/no-inhibit-exec.s
lld/test/ELF/version-script.s [new file with mode: 0644]