error("-image-base: number expected, but got " + S);
return 0;
}
- if ((V % Target->MaxPageSize) != 0)
+ if ((V % Config->MaxPageSize) != 0)
warn("-image-base: address isn't multiple of page size: " + S);
return V;
}
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->MaxPageSize);
+ if (!isPowerOf2_64(Config->MaxPageSize))
+ error("max-page-size: value isn't a power of 2");
+
Config->ImageBase = getImageBase(Args);
// Default output filename is "a.out" by the Unix tradition.
for (auto *Arg : Args.filtered(OPT_trace_symbol))
Symtab.trace(Arg->getValue());
- // Initialize Config->MaxPageSize. The default value is defined by
- // each target.
- Config->MaxPageSize =
- getZOptionValue(Args, "max-page-size", Target->MaxPageSize);
- if (!isPowerOf2_64(Config->MaxPageSize))
- error("max-page-size: value isn't a power of 2");
-
// Add all files to the symbol table. This will add almost all
// symbols that we need to the symbol table.
for (InputFile *F : Files)
# RUN: ld.lld -image-base=0x1000000 %t -o %t1
# RUN: llvm-readobj -program-headers %t1 | FileCheck %s
+# RUN: ld.lld -image-base=0x1000 -z max-page-size=0x2000 %t -o %t1 2>&1 | FileCheck --check-prefix=WARN %s
+# WARN: warning: -image-base: address isn't multiple of page size: 0x1000
+
+
.global _start
_start:
nop