summaryrefslogtreecommitdiff
path: root/gold/script.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-13 01:20:38 +0000
committerIan Lance Taylor <iant@google.com>2008-02-13 01:20:38 +0000
commitcc6b5bc180db8fd21c438bd713e8b6c1e9097ff6 (patch)
tree3940512079294b285de1b54b962efb3b9f5fb9b5 /gold/script.cc
parentbaa70c7ab03a6ba1bb7d17fc669e9d0e1aa8793d (diff)
downloadbinutils-redhat-cc6b5bc180db8fd21c438bd713e8b6c1e9097ff6.tar.gz
Assignments in linker scripts override definitions from object files.
Diffstat (limited to 'gold/script.cc')
-rw-r--r--gold/script.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gold/script.cc b/gold/script.cc
index 128acae746..321311570d 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -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.