[mach-o] refactor KindHandler into ArchHandler and simplify passes.

All architecture specific handling is now done in the appropriate
ArchHandler subclass.

The StubsPass and GOTPass have been simplified.  All architecture specific
variations in stubs are now encoded in a table which is vended by the
current ArchHandler.

llvm-svn: 213187
diff --git a/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp b/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
index 94d4fad..e12b881 100644
--- a/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
+++ b/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp
@@ -31,15 +31,22 @@
 class CRuntimeFile : public SimpleFile {
 public:
   CRuntimeFile(const MachOLinkingContext &context)
-      : SimpleFile("C runtime"), _undefMain(*this, context.entrySymbolName()) {
+      : SimpleFile("C runtime"), 
+       _undefMain(*this, context.entrySymbolName()),
+       _undefBinder(*this, context.binderSymbolName()) {
       // only main executables need _main
       if (context.outputMachOType() == llvm::MachO::MH_EXECUTE) {
         this->addAtom(_undefMain);
       }
+      // only dynamic binaries use stubs
+      if (context.needsStubsPass()) {
+        this->addAtom(_undefBinder);
+      }
    }
 
 private:
   SimpleUndefinedAtom   _undefMain;
+  SimpleUndefinedAtom   _undefBinder;
 };
 
 } // namespace mach_o