summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Driver.cpp18
-rw-r--r--lld/ELF/Target.cpp18
-rw-r--r--lld/ELF/Target.h1
3 files changed, 19 insertions, 18 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 4ca1485dc1d..6897ce2194e 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -54,24 +54,6 @@ static std::pair<ELFKind, uint16_t> parseEmulation(StringRef S) {
error("Unknown emulation: " + S);
}
-static TargetInfo *createTarget() {
- switch (Config->EMachine) {
- case EM_386:
- return new X86TargetInfo();
- case EM_AARCH64:
- return new AArch64TargetInfo();
- case EM_MIPS:
- return new MipsTargetInfo();
- case EM_PPC:
- return new PPCTargetInfo();
- case EM_PPC64:
- return new PPC64TargetInfo();
- case EM_X86_64:
- return new X86_64TargetInfo();
- }
- error("Unknown target machine");
-}
-
// Opens and parses a file. Path has to be resolved already.
// Newly created memory buffers are owned by this driver.
void LinkerDriver::addFile(StringRef Path) {
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 1a1e0bed767..7009b7f721a 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -27,6 +27,24 @@ namespace elf2 {
std::unique_ptr<TargetInfo> Target;
+TargetInfo *createTarget() {
+ switch (Config->EMachine) {
+ case EM_386:
+ return new X86TargetInfo();
+ case EM_AARCH64:
+ return new AArch64TargetInfo();
+ case EM_MIPS:
+ return new MipsTargetInfo();
+ case EM_PPC:
+ return new PPCTargetInfo();
+ case EM_PPC64:
+ return new PPC64TargetInfo();
+ case EM_X86_64:
+ return new X86_64TargetInfo();
+ }
+ error("Unknown target machine");
+}
+
TargetInfo::~TargetInfo() {}
bool TargetInfo::relocPointsToGot(uint32_t Type) const { return false; }
diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h
index 77352e6ed4c..0ffaddc36f0 100644
--- a/lld/ELF/Target.h
+++ b/lld/ELF/Target.h
@@ -125,6 +125,7 @@ public:
};
extern std::unique_ptr<TargetInfo> Target;
+TargetInfo *createTarget();
}
}
OpenPOWER on IntegriCloud