summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Writer.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Writer.h')
-rw-r--r--lld/ELF/Writer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/Writer.h b/lld/ELF/Writer.h
index a91057bec33..3698544d977 100644
--- a/lld/ELF/Writer.h
+++ b/lld/ELF/Writer.h
@@ -9,6 +9,7 @@
#ifndef LLD_ELF_WRITER_H
#define LLD_ELF_WRITER_H
+#include "Config.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include <cstdint>
@@ -28,7 +29,9 @@ template <class ELFT> void writeResult();
// Each contains type, access flags and range of output sections that will be
// placed in it.
struct PhdrEntry {
- PhdrEntry(unsigned type, unsigned flags) : p_type(type), p_flags(flags) {}
+ PhdrEntry(unsigned type, unsigned flags)
+ : p_align(type == llvm::ELF::PT_LOAD ? config->maxPageSize : 0),
+ p_type(type), p_flags(flags) {}
void add(OutputSection *sec);
uint64_t p_paddr = 0;
OpenPOWER on IntegriCloud