[lld] r289078 - Split LinkerDriver::link. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 09:44:38 PST 2016
Author: ruiu
Date: Thu Dec 8 11:44:37 2016
New Revision: 289078
URL: http://llvm.org/viewvc/llvm-project?rev=289078&view=rev
Log:
Split LinkerDriver::link. NFC.
Modified:
lld/trunk/ELF/Driver.cpp
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=289078&r1=289077&r2=289078&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Dec 8 11:44:37 2016
@@ -720,6 +720,16 @@ void LinkerDriver::inferMachineType() {
error("target emulation unknown: -m or at least one .o file required");
}
+// Parse -z max-page-size=<value>. The default value is defined by
+// each target.
+static uint64_t getMaxPageSize(opt::InputArgList &Args) {
+ uint64_t Val =
+ getZOptionValue(Args, "max-page-size", Target->DefaultMaxPageSize);
+ if (!isPowerOf2_64(Val))
+ error("max-page-size: value isn't a power of 2");
+ return Val;
+}
+
// Parses -image-base option.
static uint64_t getImageBase(opt::InputArgList &Args) {
// Use default if no -image-base option is given.
@@ -755,14 +765,7 @@ template <class ELFT> void LinkerDriver:
ELFT::Is64Bits || Config->EMachine == EM_X86_64 || Config->MipsN32Abi;
Config->Mips64EL =
(Config->EMachine == EM_MIPS && Config->EKind == ELF64LEKind);
-
- // Initialize Config->MaxPageSize. The default value is defined by
- // each target.
- Config->MaxPageSize =
- getZOptionValue(Args, "max-page-size", Target->DefaultMaxPageSize);
- if (!isPowerOf2_64(Config->MaxPageSize))
- error("max-page-size: value isn't a power of 2");
-
+ Config->MaxPageSize = getMaxPageSize(Args);
Config->ImageBase = getImageBase(Args);
// Default output filename is "a.out" by the Unix tradition.
More information about the llvm-commits
mailing list