diff options
Diffstat (limited to 'gold/resolve.cc')
-rw-r--r-- | gold/resolve.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gold/resolve.cc b/gold/resolve.cc index abb5d90..52dae8b 100644 --- a/gold/resolve.cc +++ b/gold/resolve.cc @@ -309,11 +309,26 @@ Symbol_table::resolve(Sized_symbol<size>* to, { Pluginobj* obj = to->object()->pluginobj(); if (obj != NULL - && parameters->options().plugins()->in_replacement_phase() - && !to->is_common()) + && parameters->options().plugins()->in_replacement_phase()) { - this->override(to, sym, st_shndx, is_ordinary, object, version); - return; + bool adjust_common = false; + typename Sized_symbol<size>::Size_type tosize = 0; + typename Sized_symbol<size>::Value_type tovalue = 0; + if (to->is_common() && !is_ordinary && st_shndx == elfcpp::SHN_COMMON) + { + adjust_common = true; + typename Sized_symbol<size>::Size_type tosize = to->symsize(); + typename Sized_symbol<size>::Value_type tovalue = to->value(); + } + this->override(to, sym, st_shndx, is_ordinary, object, version); + if (adjust_common) + { + if (tosize > to->symsize()) + to->set_symsize(tosize); + if (tovalue > to->value()) + to->set_value(tovalue); + } + return; } } |