mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Don't align start of segment unless alignment is larger than page size.
This fixes an issue where a page-aligned data section, combined with -z relro, could lead to a gap between text and data segments larger than a page, and we would fail to overlap the segments in the file. gold/ * layout.cc (Layout::set_segment_offsets): Don't align start of segment unless alignment is larger than page size.
This commit is contained in:
@@ -3524,7 +3524,9 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg,
|
||||
// put them on different pages in memory. We will revisit this
|
||||
// decision once we know the size of the segment.
|
||||
|
||||
addr = align_address(addr, (*p)->maximum_alignment());
|
||||
uint64_t max_align = (*p)->maximum_alignment();
|
||||
if (max_align > abi_pagesize)
|
||||
addr = align_address(addr, max_align);
|
||||
aligned_addr = addr;
|
||||
|
||||
if (load_seg == *p)
|
||||
|
||||
Reference in New Issue
Block a user