aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 65c3de6..818773a 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -3485,7 +3485,13 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg,
if (!parameters->options().nmagic()
&& !parameters->options().omagic())
- off = align_file_offset(off, addr, abi_pagesize);
+ {
+ // Here we are also taking care of the case when
+ // the maximum segment alignment is larger than the page size.
+ off = align_file_offset(off, addr,
+ std::max(abi_pagesize,
+ (*p)->maximum_alignment()));
+ }
else
{
// This is -N or -n with a section script which prevents