aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-04 06:45:50 +0000
committerIan Lance Taylor <iant@google.com>2008-02-04 06:45:50 +0000
commit3802b2dd6b937e2904b6e2de087e224437eab493 (patch)
treeac185197a2a44c92c3785020c2ce1e389f2b0287 /gold/output.cc
parentae7d22a6f2f59251b85ef5655b800f2dfe2dfbee (diff)
downloadgdb-3802b2dd6b937e2904b6e2de087e224437eab493.zip
gdb-3802b2dd6b937e2904b6e2de087e224437eab493.tar.gz
gdb-3802b2dd6b937e2904b6e2de087e224437eab493.tar.bz2
Implement SIZEOF_HEADERS, section constraints, other minor linker
script items.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gold/output.cc b/gold/output.cc
index c0db1af..8eb79fa 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -2324,21 +2324,22 @@ Output_segment::set_section_list_addresses(bool reset, Output_data_list* pdl,
p != pdl->end();
++p)
{
- off = align_address(off, (*p)->addralign());
-
if (reset)
(*p)->reset_address_and_file_offset();
// When using a linker script the section will most likely
// already have an address.
if (!(*p)->is_address_valid())
- (*p)->set_address_and_file_offset(addr + (off - startoff), off);
+ {
+ off = align_address(off, (*p)->addralign());
+ (*p)->set_address_and_file_offset(addr + (off - startoff), off);
+ }
else
{
// The script may have inserted a skip forward, but it
// better not have moved backward.
- gold_assert((*p)->address() >= addr);
- off = startoff + ((*p)->address() - addr);
+ gold_assert((*p)->address() >= addr + (off - startoff));
+ off += (*p)->address() - (addr + (off - startoff));
(*p)->set_file_offset(off);
(*p)->finalize_data_size();
}