blob: 7a3082cb1f312c19ef65a7d5aae0714f84a34c0e [file] [log] [blame]
//===- MipsSectLinker.cpp -------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include <llvm/ADT/Triple.h>
#include <mcld/Support/TargetRegistry.h>
#include "Mips.h"
#include "MipsELFSectLinker.h"
using namespace mcld;
namespace mcld {
//===----------------------------------------------------------------------===//
/// createMipsSectLinker - the help funtion to create
/// corresponding MipsSectLinker
///
SectLinker* createMipsSectLinker(const std::string &pTriple,
SectLinkerOption &pOption,
mcld::TargetLDBackend &pLDBackend)
{
llvm::Triple theTriple(pTriple);
if (theTriple.isOSDarwin()) {
assert(0 && "MachO linker has not supported yet");
}
if (theTriple.isOSWindows()) {
assert(0 && "COFF linker has not supported yet");
}
return new MipsELFSectLinker(pOption, pLDBackend);
}
} // namespace of mcld
//==========================
// MipsSectLinker
extern "C" void LLVMInitializeMipsSectLinker() {
// Register the linker frontend
mcld::TargetRegistry::RegisterSectLinker(TheMipselTarget,
createMipsSectLinker);
}