Line 981... |
Line 981... |
{
|
{
|
Output_section* section;
|
Output_section* section;
|
uint64_t final_val = this->val_->eval_maybe_dot(symtab, layout, true,
|
uint64_t final_val = this->val_->eval_maybe_dot(symtab, layout, true,
|
is_dot_available,
|
is_dot_available,
|
dot_value, dot_section,
|
dot_value, dot_section,
|
§ion, NULL);
|
§ion, NULL, false);
|
Sized_symbol<size>* ssym = symtab->get_sized_symbol<size>(this->sym_);
|
Sized_symbol<size>* ssym = symtab->get_sized_symbol<size>(this->sym_);
|
ssym->set_value(final_val);
|
ssym->set_value(final_val);
|
if (section != NULL)
|
if (section != NULL)
|
ssym->set_output_section(section);
|
ssym->set_output_section(section);
|
}
|
}
|
|
|
// Set the symbol value if the expression yields an absolute value.
|
// Set the symbol value if the expression yields an absolute value or
|
|
// a value relative to DOT_SECTION.
|
|
|
void
|
void
|
Symbol_assignment::set_if_absolute(Symbol_table* symtab, const Layout* layout,
|
Symbol_assignment::set_if_absolute(Symbol_table* symtab, const Layout* layout,
|
bool is_dot_available, uint64_t dot_value)
|
bool is_dot_available, uint64_t dot_value,
|
|
Output_section* dot_section)
|
{
|
{
|
if (this->sym_ == NULL)
|
if (this->sym_ == NULL)
|
return;
|
return;
|
|
|
Output_section* val_section;
|
Output_section* val_section;
|
uint64_t val = this->val_->eval_maybe_dot(symtab, layout, false,
|
uint64_t val = this->val_->eval_maybe_dot(symtab, layout, false,
|
is_dot_available, dot_value,
|
is_dot_available, dot_value,
|
NULL, &val_section, NULL);
|
dot_section, &val_section, NULL,
|
if (val_section != NULL)
|
false);
|
|
if (val_section != NULL && val_section != dot_section)
|
return;
|
return;
|
|
|
if (parameters->target().get_size() == 32)
|
if (parameters->target().get_size() == 32)
|
{
|
{
|
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
|
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
|
Line 1024... |
Line 1027... |
gold_unreachable();
|
gold_unreachable();
|
#endif
|
#endif
|
}
|
}
|
else
|
else
|
gold_unreachable();
|
gold_unreachable();
|
|
if (val_section != NULL)
|
|
this->sym_->set_output_section(val_section);
|
}
|
}
|
|
|
// Print for debugging.
|
// Print for debugging.
|
|
|
void
|
void
|
Line 1213... |
Line 1218... |
Script_options::set_section_addresses(Symbol_table* symtab, Layout* layout)
|
Script_options::set_section_addresses(Symbol_table* symtab, Layout* layout)
|
{
|
{
|
for (Symbol_assignments::iterator p = this->symbol_assignments_.begin();
|
for (Symbol_assignments::iterator p = this->symbol_assignments_.begin();
|
p != this->symbol_assignments_.end();
|
p != this->symbol_assignments_.end();
|
++p)
|
++p)
|
(*p)->set_if_absolute(symtab, layout, false, 0);
|
(*p)->set_if_absolute(symtab, layout, false, 0, NULL);
|
|
|
return this->script_sections_.set_section_addresses(symtab, layout);
|
return this->script_sections_.set_section_addresses(symtab, layout);
|
}
|
}
|
|
|
// This class holds data passed through the parser to the lexer and to
|
// This class holds data passed through the parser to the lexer and to
|