diff options
author | Ian Lance Taylor <ian@airs.com> | 2009-10-16 05:19:07 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2009-10-16 05:19:07 +0000 |
commit | 12edd763cc3b83a257eb3173caca075f027e9afa (patch) | |
tree | de7243bf3401d94dc825b2604068a61a0792d086 /gold/script-sections.cc | |
parent | 68b6574b4d15cd06198aac40c7ad9624a80c1bdb (diff) | |
download | gdb-12edd763cc3b83a257eb3173caca075f027e9afa.zip gdb-12edd763cc3b83a257eb3173caca075f027e9afa.tar.gz gdb-12edd763cc3b83a257eb3173caca075f027e9afa.tar.bz2 |
* script.cc (Script_options::add_symbol_assignment): Always add a
dot assginment to script_sections_.
* script-sections.cc (Script_sections::add_dot_assignment):
Initialize if necessary.
Diffstat (limited to 'gold/script-sections.cc')
-rw-r--r-- | gold/script-sections.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gold/script-sections.cc b/gold/script-sections.cc index 7ecf142..a541e9a 100644 --- a/gold/script-sections.cc +++ b/gold/script-sections.cc @@ -2540,6 +2540,15 @@ Script_sections::add_dot_assignment(Expression* val) this->output_section_->add_dot_assignment(val); else { + // The GNU linker permits assignments to . to appears outside of + // a SECTIONS clause, and treats it as appearing inside, so + // sections_elements_ may be NULL here. + if (this->sections_elements_ == NULL) + { + this->sections_elements_ = new Sections_elements; + this->saw_sections_clause_ = true; + } + Sections_element* p = new Sections_element_dot_assignment(val); this->sections_elements_->push_back(p); } |