summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/X86_64/ExampleSubTarget/ExampleLinkingContext.cpp
blob: dbbb3ad3bc90da5ca00ddfa43d3fc91715fbe99d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//===- lib/ReaderWriter/ELF/X86_64/ExampleTarget/ExampleLinkingContext.cpp ----===//
//
//                             The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "ExampleLinkingContext.h"
#include "ExampleTargetHandler.h"

using namespace lld;
using namespace elf;

std::unique_ptr<ELFLinkingContext>
ExampleLinkingContext::create(llvm::Triple triple) {
  if (triple.getVendorName() == "example")
    return llvm::make_unique<ExampleLinkingContext>(triple);
  return nullptr;
}

ExampleLinkingContext::ExampleLinkingContext(llvm::Triple triple)
    : X86_64LinkingContext(triple, std::unique_ptr<TargetHandlerBase>(
                                       new ExampleTargetHandler(*this))) {
  _outputELFType = llvm::ELF::ET_LOPROC;
}

StringRef ExampleLinkingContext::entrySymbolName() const {
  return "_start";
}

void ExampleLinkingContext::addPasses(PassManager &p) {
  ELFLinkingContext::addPasses(p);
}
OpenPOWER on IntegriCloud