aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.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
commitcaa9d5d9191af934ff7949fea080d72524c92cfa (patch)
tree4735eee01bed88199f39c2ef31ce1a4170e4a358 /gold/symtab.cc
parent7508a0934ec2fad27f393d3b1a6e1207dab3fd2d (diff)
downloadgdb-caa9d5d9191af934ff7949fea080d72524c92cfa.zip
gdb-caa9d5d9191af934ff7949fea080d72524c92cfa.tar.gz
gdb-caa9d5d9191af934ff7949fea080d72524c92cfa.tar.bz2
Assignments in linker scripts override definitions from object files.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 86d8b11..86b69b4 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1332,14 +1332,16 @@ Symbol_table::define_as_constant(const char* name,
elfcpp::STB binding,
elfcpp::STV visibility,
unsigned char nonvis,
- bool only_if_ref)
+ bool only_if_ref,
+ bool force_override)
{
if (parameters->get_size() == 32)
{
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
return this->do_define_as_constant<32>(name, version, value,
symsize, type, binding,
- visibility, nonvis, only_if_ref);
+ visibility, nonvis, only_if_ref,
+ force_override);
#else
gold_unreachable();
#endif
@@ -1349,7 +1351,8 @@ Symbol_table::define_as_constant(const char* name,
#if defined(HAVE_TARGET_64_LITTLE) || defined(HAVE_TARGET_64_BIG)
return this->do_define_as_constant<64>(name, version, value,
symsize, type, binding,
- visibility, nonvis, only_if_ref);
+ visibility, nonvis, only_if_ref,
+ force_override);
#else
gold_unreachable();
#endif
@@ -1371,7 +1374,8 @@ Symbol_table::do_define_as_constant(
elfcpp::STB binding,
elfcpp::STV visibility,
unsigned char nonvis,
- bool only_if_ref)
+ bool only_if_ref,
+ bool force_override)
{
Sized_symbol<size>* sym;
Sized_symbol<size>* oldsym;
@@ -1411,7 +1415,7 @@ Symbol_table::do_define_as_constant(
return sym;
}
- if (Symbol_table::should_override_with_special(oldsym))
+ if (force_override || Symbol_table::should_override_with_special(oldsym))
this->override_with_special(oldsym, sym);
delete sym;
return oldsym;
@@ -1436,7 +1440,8 @@ Symbol_table::define_symbols(const Layout* layout, int count,
else
this->define_as_constant(p->name, NULL, 0, p->size, p->type,
p->binding, p->visibility, p->nonvis,
- only_if_ref || p->only_if_ref);
+ only_if_ref || p->only_if_ref,
+ false);
}
}
@@ -1461,7 +1466,8 @@ Symbol_table::define_symbols(const Layout* layout, int count,
else
this->define_as_constant(p->name, NULL, 0, p->size, p->type,
p->binding, p->visibility, p->nonvis,
- only_if_ref || p->only_if_ref);
+ only_if_ref || p->only_if_ref,
+ false);
}
}