diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2013-06-06 15:16:46 +0400 |
---|---|---|
committer | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2013-06-06 15:16:46 +0400 |
commit | 1c4cd9c960a712116312670da9844f9df8af8e1c (patch) | |
tree | eb1562b5b57a7dda739b1f11446abb34df6a8b02 /binutils-2.22/gold/layout.cc | |
parent | 6e4f9ded07a7e180ad3f38be99b3a027351a7e67 (diff) | |
download | toolchain_binutils-1c4cd9c960a712116312670da9844f9df8af8e1c.tar.gz toolchain_binutils-1c4cd9c960a712116312670da9844f9df8af8e1c.tar.bz2 toolchain_binutils-1c4cd9c960a712116312670da9844f9df8af8e1c.zip |
[2.21], [2.22], [2.23] Backport of the patch for fixing large symbol alignment.
2013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
gold/
* layout.cc (Layout::set_segment_offsets): Taking care of the case when
the maximum segment alignment is larger than the page size.
* testsuite/Makefile.am (large_symbol_alignment): Test that Gold
correctly aligns the symbols with large alignemnt.
* testsuite/Makefile.in: Regenerate.
* testsuite/large_symbol_alignment.cc: New file.
Change-Id: I2fe5b73b9e76050f0f42bbbc9086d0d5824c0020
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
Diffstat (limited to 'binutils-2.22/gold/layout.cc')
-rw-r--r-- | binutils-2.22/gold/layout.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/binutils-2.22/gold/layout.cc b/binutils-2.22/gold/layout.cc index fbad2723..fb53c217 100644 --- a/binutils-2.22/gold/layout.cc +++ b/binutils-2.22/gold/layout.cc @@ -3327,7 +3327,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 |