aboutsummaryrefslogtreecommitdiff
path: root/gold/resolve.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2012-03-13 16:08:53 +0000
committerIan Lance Taylor <ian@airs.com>2012-03-13 16:08:53 +0000
commitfd325007590a9f768fa93840eb1f6af48e9d25f7 (patch)
treeafe2a929d91b92ad9e84d361a8b6f325b76a09a0 /gold/resolve.cc
parent87b0bb13cbbea83ec1896b3ab915c8ce48ab6d44 (diff)
downloadgdb-fd325007590a9f768fa93840eb1f6af48e9d25f7.zip
gdb-fd325007590a9f768fa93840eb1f6af48e9d25f7.tar.gz
gdb-fd325007590a9f768fa93840eb1f6af48e9d25f7.tar.bz2
* resolve.cc (Symbol_table::resolve): When merging common symbols,
keep the larger alignment.
Diffstat (limited to 'gold/resolve.cc')
-rw-r--r--gold/resolve.cc19
1 files changed, 15 insertions, 4 deletions
diff --git a/gold/resolve.cc b/gold/resolve.cc
index 780038a..0da8da2 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -356,9 +356,15 @@ Symbol_table::resolve(Sized_symbol<size>* to,
&adjust_dyndef))
{
elfcpp::STB tobinding = to->binding();
+ typename Sized_symbol<size>::Value_type tovalue = to->value();
this->override(to, sym, st_shndx, is_ordinary, object, version);
- if (adjust_common_sizes && tosize > to->symsize())
- to->set_symsize(tosize);
+ if (adjust_common_sizes)
+ {
+ if (tosize > to->symsize())
+ to->set_symsize(tosize);
+ if (tovalue > to->value())
+ to->set_value(tovalue);
+ }
if (adjust_dyndef)
{
// We are overriding an UNDEF or WEAK UNDEF with a DYN DEF.
@@ -368,8 +374,13 @@ Symbol_table::resolve(Sized_symbol<size>* to,
}
else
{
- if (adjust_common_sizes && sym.get_st_size() > tosize)
- to->set_symsize(sym.get_st_size());
+ if (adjust_common_sizes)
+ {
+ if (sym.get_st_size() > tosize)
+ to->set_symsize(sym.get_st_size());
+ if (sym.get_st_value() > to->value())
+ to->set_value(sym.get_st_value());
+ }
if (adjust_dyndef)
{
// We are keeping a DYN DEF after seeing an UNDEF or WEAK UNDEF.