[ELF] Unit tests for -o and --noinhibit-exec.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205735 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Fix undefined symbol handling in DSO.

Summary:
Currently LLD ignores undefined symbols found in DSOs when linking against
DSO files, if -shared flag is given. Internally, it's achieved by enabling
"useShlibUndefines" flag, which makes the file reader to ignore all undefined
symbols in DSO, so that Resolver don't see any undefined symbols when
handling DSO files.

The above behavior is not compatible with GNU LD.

GNU LD does not also warn on undefined symbols found in DSOs if -shared flag
is given. However, it actually tries to resolve such undefined symbols. As a
result, if an undefined symbol can be resolved by other objects/DSOs appears
later in the same command line, linking output will be different from LLD's
result.

This patch fixes the compatibilty issue. GNU LD seems to just not print
warning messages on undefined symbols if -shared is given. This patch
implements the same behavior.

Reviewers: Bigcheese, shankarke, kledzik

CC: llvm-commits

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