MachO: support atomization of dylibs.

For .dylib files, we refrain from actually creating any atoms until they're
requested via the "exports" method.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@212027 91177308-0d34-0410-b5e6-96231b3b80d8
MachO: calculate segment offsets in final MachO files properly.

Because of how we were calculating fileOffset and fileSize for segments, most
ended up at a single offset in a finalised MachO file. This meant the data
often didn't even get written in the final object, let alone where it would be
useful.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@212030 91177308-0d34-0410-b5e6-96231b3b80d8
MachO: align segment virtual addresses to page size.

Segments must occupy a multiple of the page size in memory (4096 currently). We
check for this when emitting files, but the placement algorithm broke down for
the second non-__TEXT segment encountered: the offset wasn't aligned up to 4096
before starting its layout.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@212031 91177308-0d34-0410-b5e6-96231b3b80d8
MachO: re-enable writing of compact-unwind sections.

This isn't really the right place to put them in final object files (that would
be __TEXT,__unwind_info), but the format is different between relocatable and
final objects, which means we really need a pass to handle the translation.

For now, re-emitting in __LD,__compact_unwind is harmless (dyld ignores it and
moves straight on to inspecting __TEXT,__eh_frame), and sidesteps an assertion
failure when processing files containing compact-unwind info.

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