[mach-o] add initial support for modes in arm code.

This patch just supports marking ranges that are thumb code (vs arm code).
Future patches will mark data and jump table ranges. The ranges are encoded
as References with offsetInAtom being the start of the range and the target
being the same atom.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@213712 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Fix entry point functions selection

On Windows there are four "main" functions -- main, wmain, WinMain,
or wWinMain. Their parameter types are diffferent. The standard
library provides four different entry functions (i.e.
{w,}{WinMain,main}CRTStartup) for them. You need to use the right
entry routine for your "main" function.

If you give an /entry option, the specified name is used
unconditionally.

Otherwise, the linker needs to select the right one based on
user-supplied entry point function. This can be done after the
linker reads all the input files.

This patch moves the code to determine the entry point function
from the driver to a virtual input file. It also implements the
correct logic for the entry point function selection.

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