[ELF] Set MAXPAGESIZE to 2MiB on x86-64 to match bfd and gold.

The FreeBSD kernel relies on this behavior to not overwrite the boot loader.

llvm-svn: 278889
This commit is contained in:
Michael J. Spencer
2016-08-17 02:10:51 +00:00
parent 53d55f45a1
commit e2cc07bc0b
7 changed files with 13 additions and 9 deletions

View File

@@ -1138,8 +1138,10 @@ Expr ScriptParser::readExpr1(Expr Lhs, int MinPrec) {
}
uint64_t static getConstant(StringRef S) {
if (S == "COMMONPAGESIZE" || S == "MAXPAGESIZE")
if (S == "COMMONPAGESIZE")
return Target->PageSize;
if (S == "MAXPAGESIZE")
return Target->MaxPageSize;
error("unknown constant: " + S);
return 0;
}