aboutsummaryrefslogtreecommitdiff
path: root/gold/script.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-28 04:45:47 +0000
committerIan Lance Taylor <iant@google.com>2008-02-28 04:45:47 +0000
commit919ed24cbc56717156ee86a754281cc08919d2ba (patch)
tree87151a758daf5709e798f285c607fb459b72523b /gold/script.cc
parent15cf077ef4df71bb31c803ed9cf94d8ccdb72dc5 (diff)
downloadgdb-919ed24cbc56717156ee86a754281cc08919d2ba.zip
gdb-919ed24cbc56717156ee86a754281cc08919d2ba.tar.gz
gdb-919ed24cbc56717156ee86a754281cc08919d2ba.tar.bz2
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.
Diffstat (limited to 'gold/script.cc')
-rw-r--r--gold/script.cc18
1 files changed, 14 insertions, 4 deletions
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,
&section);
@@ -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