Home | History | Annotate | Download | only in ARM
      1 //===- ARMSectLinker.cpp --------------------------------------------------===//
      2 //
      3 //                     The MCLinker Project
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 #include <llvm/ADT/Triple.h>
     10 #include <mcld/Support/TargetRegistry.h>
     11 #include "ARM.h"
     12 #include "ARMAndroidSectLinker.h"
     13 #include "ARMELFSectLinker.h"
     14 
     15 
     16 using namespace mcld;
     17 
     18 namespace mcld {
     19 //===----------------------------------------------------------------------===//
     20 // createARMSectLinker - the help function to create corresponding ARMSectLinker
     21 //
     22 SectLinker* createARMSectLinker(const std::string &pTriple,
     23                                 SectLinkerOption &pOption,
     24                                 mcld::TargetLDBackend &pLDBackend)
     25 {
     26   Triple theTriple(pTriple);
     27   if (theTriple.isOSDarwin()) {
     28     assert(0 && "MachO linker has not supported yet");
     29   }
     30   if (theTriple.isOSWindows()) {
     31     assert(0 && "COFF linker has not supported yet");
     32   }
     33 
     34   // For now, use Android SectLinker directly
     35   return new ARMAndroidSectLinker(pOption,
     36                                   pLDBackend);
     37 }
     38 
     39 } // namespace of mcld
     40 
     41 //==========================
     42 // ARMSectLinker
     43 extern "C" void LLVMInitializeARMSectLinker() {
     44   // Register the linker frontend
     45   mcld::TargetRegistry::RegisterSectLinker(TheARMTarget, createARMSectLinker);
     46 }
     47