[ELF] Fix --soname option.

Currently LLD accepts only "-soname <string>", but all the following
options are actually valid.

  --soname=foo
  --soname foo
  -soname=foo
  -soname foo
  -h foo

This patch fixes that issue.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205662 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Add a test for -rpath.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205663 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Use typedefs to make class field declarations shorter.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205692 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Fix driver bug.

GNU LD-comptaible driver wrongly requires a space after '=' for a few
options such as "-init=<symbol>" or "-entry=<symbol>". This patch is
to fix that bug and add a few tests for it.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205693 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Accept "-rpath=<foo>" as well as "-rpath <foo>".

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205694 91177308-0d34-0410-b5e6-96231b3b80d8
Update Phabricator server.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205698 91177308-0d34-0410-b5e6-96231b3b80d8
[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
No else after return.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205736 91177308-0d34-0410-b5e6-96231b3b80d8
Early continue to reduce nesting.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205737 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Fix common symbol alignment.

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

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205826 91177308-0d34-0410-b5e6-96231b3b80d8
Update to match changes made in r205955

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205956 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] R_MIPS_PC32 relocation support.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206018 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Rewrite R_MIPS_32 handling test using the yaml2obj tool.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206019 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Rewrite R_MIPS_26 handling test using the yaml2obj tool.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206020 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Remove redundant conversion of section content from ArrayRef to
StringRef before calling the createSectionAtom() method and reverse
conversion inside the method.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206022 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Factor out MIPS relocation addend reading to the separate
function.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206023 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Regroup code creates ELF relocations references ELFReference into
a couple of new virtual functions.

Follow-up to the rL203408. Two virtual functions `createRelocationReference()`
responsible for creation of `ELFReference` have been replaced by a couple of
new virtual functions `createRelocationReferences()` (plural). Each former
function creates a //single// ELFReference for a specified `Elf_Rela`
or `Elf_Rel` relocation records. The new functions responsible for creation
of //all// relocation references for provided symbol.

For all targets except MIPS there are no functional changes.

MIPS ABI has a notion of //paired// relocations. An effective addend of such
relocations are calculated using addends of both pair's members.
Each `R_MIPS_HI16` and `R_MIPS_GOT16` (for local symbols) relocations must have
an associated `R_MIPS_LO16` entry immediately following it in the list
of relocations. Immediately does not mean "next record" in relocations section
but "next record referenced the same symbol". Moreover a single `R_MIPS_LO16`
relocation can be paired with multiple preceding `R_MIPS_HI16/R_MIPS_GOT16`
relocations.

The paired relocation can have offsets belong to the different symbols.
That is why we need to have access to list of all relocations during
construction of `ELFReference` for MIPS target.

The patch reviewed by Shankar Easwaran.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206102 91177308-0d34-0410-b5e6-96231b3b80d8
Add missing includes.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206113 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Emit PLT entries for more static relocations.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@206358 91177308-0d34-0410-b5e6-96231b3b80d8
[ELF] Support --defsym=<symbol>=<symbol>.

Summary:
Currently LLD supports --defsym only in the form of
--defsym=<symbol>=<integer>, where the integer is interpreted as the
absolute address of the symbol. This patch extends it to allow other
symbol name to be given as an RHS value. If a RHS value is a symbol
name, a LHS symbol will be defined as an alias for the RHS symbol.

Internally, a LHS symbol is represented as a zero-size defined atom
who has an LayoutAfter reference to an undefined atom, whose name is
the RHS value. Everything else is already implemented -- Resolver
will resolve the undefined symbol, and the layout pass will layout
the two atoms at the same location. Looks like it's working fine.

Note that GNU LD supports --defsym=<symbol>=<symbol>+<addend>. That
feature is out of scope of this patch.

Reviewers: Bigcheese, shankarke, kledzik

CC: llvm-commits

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