summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/gold/output.cc
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.25/gold/output.cc')
-rw-r--r--binutils-2.25/gold/output.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/binutils-2.25/gold/output.cc b/binutils-2.25/gold/output.cc
index 3361991a..e9dd522b 100644
--- a/binutils-2.25/gold/output.cc
+++ b/binutils-2.25/gold/output.cc
@@ -1,6 +1,6 @@
// output.cc -- manage the output file for gold
-// Copyright (C) 2006-2014 Free Software Foundation, Inc.
+// Copyright (C) 2006-2015 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
@@ -4311,8 +4311,8 @@ Output_segment::set_section_addresses(const Target* target,
else
{
// FIXME: This could be faster.
- (*p)->set_address_and_file_offset(addr + relro_size,
- off + relro_size);
+ (*p)->set_address_and_file_offset(relro_size,
+ relro_size);
relro_size += (*p)->data_size();
(*p)->reset_address_and_file_offset();
}
@@ -4332,11 +4332,12 @@ Output_segment::set_section_addresses(const Target* target,
// Align to offset N such that (N + RELRO_SIZE) % PAGE_ALIGN == 0.
uint64_t desired_align = page_align - (aligned_size % page_align);
- if (desired_align < *poff % page_align)
- *poff += page_align - *poff % page_align;
- *poff += desired_align - *poff % page_align;
- addr += *poff - orig_off;
- orig_off = *poff;
+ if (desired_align < off % page_align)
+ off += page_align;
+ off += desired_align - off % page_align;
+ addr += off - orig_off;
+ orig_off = off;
+ *poff = off;
}
if (!reset && this->are_addresses_set_)