[ELF] Use MaxPageSize for aligning PT_LOAD
This matches the behavior of Binutils linkers. We also change the
default MaxPageSize on x86-64 to 0x1000 to preserver the current
behavior, which is the same as the behavior implemented by gold.
https://llvm.org/bugs/show_bug.cgi?id=30541
Differential Revision: https://reviews.llvm.org/D24987
llvm-svn: 282560
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 7690071..fb9c648 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -546,7 +546,6 @@
}
template <class ELFT> X86_64TargetInfo<ELFT>::X86_64TargetInfo() {
- MaxPageSize = 0x200000; // 2MiB
CopyRel = R_X86_64_COPY;
GotRel = R_X86_64_GLOB_DAT;
PltRel = R_X86_64_JUMP_SLOT;
@@ -989,7 +988,7 @@
// We need 64K pages (at least under glibc/Linux, the loader won't
// set different permissions on a finer granularity than that).
- PageSize = 65536;
+ MaxPageSize = 65536;
// The PPC64 ELF ABI v1 spec, says:
//
@@ -1855,7 +1854,7 @@
template <class ELFT> MipsTargetInfo<ELFT>::MipsTargetInfo() {
GotPltHeaderEntriesNum = 2;
- PageSize = 65536;
+ MaxPageSize = 65536;
GotEntrySize = sizeof(typename ELFT::uint);
GotPltEntrySize = sizeof(typename ELFT::uint);
PltEntrySize = 16;