ELF: Re-implement -u directly and remove CanKeepUndefined flag.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 27 Apr 2016 00:05:03 +0000 (00:05 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 27 Apr 2016 00:05:03 +0000 (00:05 +0000)
commit892d4980171333c96e50859c716f9dd5ea313ae3
treeade83a14745e1db5aa9378cf1e48fcb36c2a7ae2
parente7d1e99543dcc8e2d939ebfcfd332d2c480170a2
ELF: Re-implement -u directly and remove CanKeepUndefined flag.

The semantics of the -u flag are to load the lazy symbol named by the flag. We
were previously relying on this behavior falling out of symbol resolution
against a synthetic undefined symbol, but that didn't quite give us the
correct behavior, so we needed a flag to mark symbols created with -u so
we could treat them specially in the writer. However, it's simpler and less
error prone to implement the required behavior directly and remove the flag.

This fixes an issue where symbols loaded with -u would receive hidden
visibility even when the definition in an object file had wider visibility.

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

llvm-svn: 267639
lld/ELF/Driver.cpp
lld/ELF/SymbolTable.cpp
lld/ELF/SymbolTable.h
lld/ELF/Symbols.cpp
lld/ELF/Symbols.h
lld/ELF/Writer.cpp
lld/test/ELF/undefined-opt.s