Add a fallback mechanism for undefined atom.

In COFF, an undefined symbol can have up to one alternative name. If a symbol
is resolved by its regular name, then it's linked normally. If a symbol is not
found in any input files, all references to the regular name are resolved using
the alternative name. If the alternative name is not found, it's a link error.
This mechanism is called "weak externals".

To support this mechanism, I added a new member function fallback() to undefined
atom. If an undefined atom has the second name, fallback() returns a new undefined
atom that should be used instead of the original one to resolve undefines. If it
does not have the second name, the function returns nullptr.

Differential Revision: http://llvm-reviews.chandlerc.com/D1550

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@190625 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Add a field for machine type to PECOFFLinkingContext.

So that we can determine what the target architecture is. Adding this
field does not mean that we are going to support non-i386 architectures
soon; there are many things to do to support them, and I'm focusing on
i386 now. But this is the first step toward multi architecture support.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@190627 91177308-0d34-0410-b5e6-96231b3b80d8
Do not prepend "_" to external symbols if non-i386.

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