Assignments in linker scripts override definitions from object files.

This commit is contained in:
Ian Lance Taylor
2008-02-13 01:20:38 +00:00
parent 7508a0934e
commit caa9d5d919
4 changed files with 23 additions and 11 deletions

View File

@@ -895,6 +895,10 @@ class Script_unblock : public Task
// necessarily evaluate the expression until all ordinary symbols have
// been finalized.
// The GNU linker lets symbol assignments in the linker script
// silently override defined symbols in object files. We are
// compatible. FIXME: Should we issue a warning?
void
Symbol_assignment::add_to_table(Symbol_table* symtab)
{
@@ -907,7 +911,8 @@ Symbol_assignment::add_to_table(Symbol_table* symtab)
elfcpp::STB_GLOBAL,
vis,
0, // nonvis
this->provide_);
this->provide_,
true); // force_override
}
// Finalize a symbol value.