diff options
author | Ian Lance Taylor <ian@airs.com> | 2008-06-30 16:36:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2008-06-30 16:36:40 +0000 |
commit | e6fde208761f4c42ddf2409566437b4114a87429 (patch) | |
tree | 24167e514749eddc01fb99af2c7fcdc7c738f747 /gold | |
parent | 3dccd7b794c78caf1a91142f275edf70c08334ca (diff) | |
download | gdb-e6fde208761f4c42ddf2409566437b4114a87429.zip gdb-e6fde208761f4c42ddf2409566437b4114a87429.tar.gz gdb-e6fde208761f4c42ddf2409566437b4114a87429.tar.bz2 |
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.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 8 | ||||
-rw-r--r-- | gold/powerpc.cc | 16 |
2 files changed, 10 insertions, 14 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index b8d8118..4eae474 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,11 @@ +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. diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 4f44fee..4e7406e 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -594,9 +594,6 @@ public: 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; @@ -605,10 +602,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); } static inline void @@ -617,9 +611,6 @@ public: 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); @@ -628,10 +619,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); } // R_PPC_REL16: (Symbol + Addend - Address) & 0xffff |