summaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2010-09-09 00:13:08 +0000
committerRafael Ávila de Espíndola <respindola@mozilla.com>2010-09-09 00:13:08 +0000
commita6577478747c667c553f5464cf6de81b0052cb37 (patch)
tree5b7d96ce6726854f8448b4aa545e9fb7bdd24ddb /gold
parent3d5229c58f5b552908e130905bbd2abbffb53bdb (diff)
downloadbinutils-a6577478747c667c553f5464cf6de81b0052cb37.tar.gz
binutils-a6577478747c667c553f5464cf6de81b0052cb37.tar.bz2
binutils-a6577478747c667c553f5464cf6de81b0052cb37.zip
2010-09-03 Rafael Espindola <espindola@google.com>
* layout.cc (Layout::set_segment_offsets): Always advance to a new page.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog4
-rw-r--r--gold/layout.cc22
2 files changed, 11 insertions, 15 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index a8a11075e92..0ed1a2ff918 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-03 Rafael Espindola <espindola@google.com>
+
+ * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
+
2010-09-08 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
diff --git a/gold/layout.cc b/gold/layout.cc
index bfe6a5eea66..f0a431e75a2 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -2567,7 +2567,6 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg,
const bool check_sections = parameters->options().check_sections();
Output_segment* last_load_segment = NULL;
- bool was_readonly = false;
for (Segment_list::iterator p = this->segment_list_.begin();
p != this->segment_list_.end();
++p)
@@ -2614,21 +2613,17 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg,
if (!are_addresses_set)
{
- // If the last segment was readonly, and this one is
- // not, then skip the address forward one page,
- // maintaining the same position within the page. This
- // lets us store both segments overlapping on a single
- // page in the file, but the loader will put them on
- // different pages in memory.
+ // Skip the address forward one page, maintaining the same
+ // position within the page. This lets us store both segments
+ // overlapping on a single page in the file, but the loader will
+ // 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());
aligned_addr = addr;
- if (was_readonly && ((*p)->flags() & elfcpp::PF_W) != 0)
- {
- if ((addr & (abi_pagesize - 1)) != 0)
- addr = addr + abi_pagesize;
- }
+ if ((addr & (abi_pagesize - 1)) != 0)
+ addr = addr + abi_pagesize;
off = orig_off + ((addr - orig_addr) & (abi_pagesize - 1));
}
@@ -2686,9 +2681,6 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg,
addr = new_addr;
- if (((*p)->flags() & elfcpp::PF_W) == 0)
- was_readonly = true;
-
// Implement --check-sections. We know that the segments
// are sorted by LMA.
if (check_sections && last_load_segment != NULL)