From 919ed24cbc56717156ee86a754281cc08919d2ba Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 28 Feb 2008 04:45:47 +0000 Subject: Don't check assertions until symbols are finalized. Create an output section if the script uses a data statement with no input sections. Don't create a loadable segment for the headers if there is no room. --- gold/script.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gold/script.cc') diff --git a/gold/script.cc b/gold/script.cc index ee54e9d..42fb71c 100644 --- a/gold/script.cc +++ b/gold/script.cc @@ -980,7 +980,7 @@ Symbol_assignment::sized_finalize(Symbol_table* symtab, const Layout* layout, Output_section* dot_section) { Output_section* section; - uint64_t final_val = this->val_->eval_maybe_dot(symtab, layout, + uint64_t final_val = this->val_->eval_maybe_dot(symtab, layout, true, is_dot_available, dot_value, dot_section, §ion); @@ -1000,8 +1000,9 @@ Symbol_assignment::set_if_absolute(Symbol_table* symtab, const Layout* layout, return; Output_section* val_section; - uint64_t val = this->val_->eval_maybe_dot(symtab, layout, is_dot_available, - dot_value, NULL, &val_section); + uint64_t val = this->val_->eval_maybe_dot(symtab, layout, false, + is_dot_available, dot_value, + NULL, &val_section); if (val_section != NULL) return; @@ -1055,7 +1056,7 @@ Symbol_assignment::print(FILE* f) const void Script_assertion::check(const Symbol_table* symtab, const Layout* layout) { - if (!this->check_->eval(symtab, layout)) + if (!this->check_->eval(symtab, layout, true)) gold_error("%s", this->message_.c_str()); } @@ -1122,6 +1123,15 @@ Script_options::add_assertion(Expression* check, const char* message, } } +// Create sections required by any linker scripts. + +void +Script_options::create_script_sections(Layout* layout) +{ + if (this->saw_sections_clause()) + this->script_sections_.create_sections(layout); +} + // Add any symbols we are defining to the symbol table. void -- cgit v1.1