Use the correct page size.
Config->MaxPageSize is what we use for the segment alignment, so that
is the one that we have to use for placing the header.
llvm-svn: 287569
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index cdc6695..c3d1976 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -717,7 +717,7 @@
// ELF and Program headers need to be right before the first section in
// memory. Set their addresses accordingly.
- MinVA = alignDown(MinVA - HeaderSize, Target->PageSize);
+ MinVA = alignDown(MinVA - HeaderSize, Config->MaxPageSize);
Out<ELFT>::ElfHeader->Addr = MinVA;
Out<ELFT>::ProgramHeaders->Addr = Out<ELFT>::ElfHeader->Size + MinVA;