+2008-06-30 Ian Lance Taylor <iant@google.com>
+
+ PR 6660
+ PR 6682
+ * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
+ versions]: Don't try to read the value in the contents, since we
+ don't use it. Use the template endianness when writing.
+
2008-06-25 Cary Coutant <ccoutant@google.com>
* fileread.cc (File_read::make_view): Assert on zero-length view.
typename elfcpp::Elf_types<size>::Elf_Addr value,
typename elfcpp::Elf_types<size>::Elf_Addr addend)
{
- 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 = value + addend;
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);
}
static inline void
const Symbol_value<size>* psymval,
typename elfcpp::Elf_types<size>::Elf_Addr addend)
{
- 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);
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);
}
// R_PPC_REL16: (Symbol + Addend - Address) & 0xffff