aboutsummaryrefslogtreecommitdiff
path: root/gold/script.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-07-29 22:58:03 +0000
committerIan Lance Taylor <ian@airs.com>2008-07-29 22:58:03 +0000
commit7c07ececf49a7b57a84e50ca8f7040c11d1c8cfa (patch)
tree79a773c9f51c3aff56139226173900cc773bc0fd /gold/script.cc
parent1f70da6a3acba8bc6171565c0389aa1f165ca4c7 (diff)
downloadfsf-binutils-gdb-7c07ececf49a7b57a84e50ca8f7040c11d1c8cfa.zip
fsf-binutils-gdb-7c07ececf49a7b57a84e50ca8f7040c11d1c8cfa.tar.gz
fsf-binutils-gdb-7c07ececf49a7b57a84e50ca8f7040c11d1c8cfa.tar.bz2
* script.cc (Script_options::finalize_symbols): Finalize SECTIONS
symbols before other symbols. * testsuite/script_test_2.cc (test_addr): Declare. (test_addr_alias): Declare. (main): Check that test_addr and test_addr_alias have the right values. * testsuite/script_test_2.t: Define test_addr_alias and test_addr.
Diffstat (limited to 'gold/script.cc')
-rw-r--r--gold/script.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gold/script.cc b/gold/script.cc
index 4bfe33c..f6e4a39 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -1109,6 +1109,12 @@ Script_options::add_symbols_to_table(Symbol_table* symtab)
void
Script_options::finalize_symbols(Symbol_table* symtab, const Layout* layout)
{
+ // We finalize the symbols defined in SECTIONS first, because they
+ // are the ones which may have changed. This way if symbol outside
+ // SECTIONS are defined in terms of symbols inside SECTIONS, they
+ // will get the right value.
+ this->script_sections_.finalize_symbols(symtab, layout);
+
for (Symbol_assignments::iterator p = this->symbol_assignments_.begin();
p != this->symbol_assignments_.end();
++p)
@@ -1118,8 +1124,6 @@ Script_options::finalize_symbols(Symbol_table* symtab, const Layout* layout)
p != this->assertions_.end();
++p)
(*p)->check(symtab, layout);
-
- this->script_sections_.finalize_symbols(symtab, layout);
}
// Set section addresses. We set all the symbols which have absolute