Пример #1
0
//===----------------------------------------------------------------------===//
// emulateARMLD - the help function to emulate ARM ld
//===----------------------------------------------------------------------===//
bool emulateARMLD(const std::string& pTriple, LinkerConfig& pConfig)
{
  llvm::Triple theTriple(pTriple);
  if (theTriple.isOSDarwin()) {
    assert(0 && "MachO linker has not supported yet");
    return false;
  }
  if (theTriple.isOSWindows()) {
    assert(0 && "COFF linker has not supported yet");
    return false;
  }

  return MCLDEmulateARMELF(pConfig);
}
Пример #2
0
//===----------------------------------------------------------------------===//
/// createX86MCLinker - the help funtion to create corresponding X86MCLinker
//===----------------------------------------------------------------------===//
MCLinker* createX86MCLinker(const std::string &pTriple,
                            LinkerConfig& pConfig,
                            mcld::Module& pModule,
                            MemoryArea& pOutput)
{
  llvm::Triple theTriple(pTriple);
  if (theTriple.isOSDarwin()) {
    assert(0 && "MachO linker has not supported yet");
    return NULL;
  }
  if (theTriple.isOSWindows()) {
    assert(0 && "COFF linker has not supported yet");
    return NULL;
  }

  return new X86ELFMCLinker(pConfig, pModule, pOutput);
}
Пример #3
0
//===----------------------------------------------------------------------===//
// createAArch64MCLinker - the help function to create corresponding
// AArch64MCLinker
//===----------------------------------------------------------------------===//
MCLinker* createAArch64MCLinker(const std::string& pTriple,
                                LinkerConfig& pConfig,
                                mcld::Module& pModule,
                                FileHandle& pFileHandle)
{
  llvm::Triple theTriple(pTriple);
  if (theTriple.isOSDarwin()) {
    assert(0 && "MachO linker has not supported yet");
    return NULL;
  }
  if (theTriple.isOSWindows()) {
    assert(0 && "COFF linker has not supported yet");
    return NULL;
  }

  return new AArch64ELFMCLinker(pConfig, pModule, pFileHandle);
}
/// createHexagonMCLinker - the help funtion to create corresponding
/// HexagonMCLinker
MCLinker* createHexagonMCLinker(const std::string &pTriple,
                                LinkerConfig& pConfig,
                                mcld::Module& pModule,
                                MemoryArea& pOutput)
{
  Triple theTriple(pTriple);
  if (theTriple.isOSDarwin()) {
    assert(0 && "MachO linker has not supported yet");
    return NULL;
  }
  if (theTriple.isOSWindows()) {
    assert(0 && "COFF linker has not supported yet");
    return NULL;
  }

  if (theTriple.isArch32Bit())
    return new HexagonELFMCLinker(pConfig, pModule, pOutput);

  assert(0 && "Hexagon_64 has not supported yet");
  return NULL;
}
//===----------------------------------------------------------------------===//
/// createARMLDBackend - the help funtion to create corresponding ARMLDBackend
///
TargetLDBackend* createARMLDBackend(const llvm::Target& pTarget,
                                    const std::string& pTriple)
{
  Triple theTriple(pTriple);
  if (theTriple.isOSDarwin()) {
    assert(0 && "MachO linker is not supported yet");
    /**
    return new ARMMachOLDBackend(createARMMachOArchiveReader,
                               createARMMachOObjectReader,
                               createARMMachOObjectWriter);
    **/
  }
  if (theTriple.isOSWindows()) {
    assert(0 && "COFF linker is not supported yet");
    /**
    return new ARMCOFFLDBackend(createARMCOFFArchiveReader,
                               createARMCOFFObjectReader,
                               createARMCOFFObjectWriter);
    **/
  }
  return new ARMGNULDBackend();
}