aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2009-01-20 16:12:00 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2009-01-20 16:12:00 +0000
commit83d22aa85543ae8a089b13cd6d0a26b21050bf1d (patch)
treed62f71ff58fe140a4cb9d299bedbaef36d949454 /gold
parent5d277928c8e2371ebe7f7ca84fba4e277106c14e (diff)
downloadgdb-83d22aa85543ae8a089b13cd6d0a26b21050bf1d.zip
gdb-83d22aa85543ae8a089b13cd6d0a26b21050bf1d.tar.gz
gdb-83d22aa85543ae8a089b13cd6d0a26b21050bf1d.tar.bz2
* powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
read the value in the contents, since we don't use it. Use the template endianness when writing. (Relocate::relocate): Use it for R_PPC_REL16_HA.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/powerpc.cc10
2 files changed, 9 insertions, 8 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 8c9a97e..ddfe7b3 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-20 Andreas Schwab <schwab@suse.de>
+
+ * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
+ read the value in the contents, since we don't use it. Use the
+ template endianness when writing.
+ (Relocate::relocate): Use it for R_PPC_REL16_HA.
+
2009-01-19 Andreas Schwab <schwab@suse.de>
* configure.tgt (powerpc64-*): Fix targ_obj.
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 05ce4fc..2d1d984 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -663,9 +663,6 @@ public:
typename elfcpp::Elf_types<size>::Elf_Addr addend,
typename elfcpp::Elf_types<size>::Elf_Addr address)
{
- typedef typename elfcpp::Swap<16, true>::Valtype Valtype;
- Valtype* wv = reinterpret_cast<Valtype*>(view);
- Valtype val = elfcpp::Swap<16, true>::readval(wv);
typename elfcpp::Elf_types<size>::Elf_Addr reloc;
reloc = (psymval->value(object, addend) - address);
@@ -673,10 +670,7 @@ public:
reloc += 0x10000;
reloc >>= 16;
- val &= ~static_cast<Valtype>(0xffff);
- reloc &= static_cast<Valtype>(0xffff);
-
- elfcpp::Swap<16, true>::writeval(wv, val | reloc);
+ elfcpp::Swap<16, big_endian>::writeval(view, reloc);
}
};
@@ -1681,7 +1675,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
break;
case elfcpp::R_PPC_REL16_HA:
- Reloc::rel16_lo(view, object, psymval, addend, address);
+ Reloc::rel16_ha(view, object, psymval, addend, address);
break;
case elfcpp::R_POWERPC_GOT16: