summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Driver.cpp')
-rw-r--r--lld/ELF/Driver.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 6799ea9c041..27f186414d3 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -441,6 +441,11 @@ void LinkerDriver::main(ArrayRef<const char *> ArgsArr) {
if (errorCount())
return;
+ // The Target instance handles target-specific stuff, such as applying
+ // relocations or writing a PLT section. It also contains target-dependent
+ // values such as a default image base address.
+ Target = getTarget();
+
switch (Config->EKind) {
case ELF32LEKind:
link<ELF32LE>(Args);
@@ -1617,11 +1622,6 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {
if (Config->Strip != StripPolicy::None)
llvm::erase_if(InputSections, [](InputSectionBase *S) { return S->Debug; });
- // The Target instance handles target-specific stuff, such as applying
- // relocations or writing a PLT section. It also contains target-dependent
- // values such as a default image base address.
- Target = getTarget();
-
Config->EFlags = Target->calcEFlags();
Config->MaxPageSize = getMaxPageSize(Args);
Config->ImageBase = getImageBase(Args);
OpenPOWER on IntegriCloud