diff options
author | Alan Modra <amodra@gmail.com> | 2015-02-24 18:16:26 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-02-24 18:21:39 +1030 |
commit | ec86f43468e2591127c493d67882de59dbfd79de (patch) | |
tree | 162bf55f2438fbd9bc5e6c575d65ec630d5308fa /gold | |
parent | ecfe5151674f7837eb05f0f05dea868586ce2848 (diff) | |
download | gdb-ec86f43468e2591127c493d67882de59dbfd79de.zip gdb-ec86f43468e2591127c493d67882de59dbfd79de.tar.gz gdb-ec86f43468e2591127c493d67882de59dbfd79de.tar.bz2 |
PowerPC64 GOLD: complain on misaligned _DS relocs
PR 18010
* powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
complain if value is not a multiple of four.
(Target_powerpc::Relocate::relocate): Correct handling of
R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 8 | ||||
-rw-r--r-- | gold/powerpc.cc | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index b73da0a..31d123e 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,11 @@ +2015-02-24 Alan Modra <amodra@gmail.com> + + PR 18010 + * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always + complain if value is not a multiple of four. + (Target_powerpc::Relocate::relocate): Correct handling of + R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64. + 2015-02-21 H.J. Lu <hongjiu.lu@intel.com> * configure.ac (default_size): Set to 32 for x32. diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 4deb5af..d9a61ad 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -1650,7 +1650,7 @@ public: addr16_ds(unsigned char* view, Address value, Overflow_check overflow) { Status stat = This::template rela<16,16>(view, 0, 0xfffc, value, overflow); - if (overflow != CHECK_NONE && (value & 3) != 0) + if ((value & 3) != 0) stat = STATUS_OVERFLOW; return stat; } @@ -7597,8 +7597,11 @@ Target_powerpc<size, big_endian>::Relocate::relocate( case elfcpp::R_POWERPC_GOT_DTPREL16: case elfcpp::R_POWERPC_GOT_DTPREL16_LO: + case elfcpp::R_POWERPC_GOT_TPREL16: + case elfcpp::R_POWERPC_GOT_TPREL16_LO: if (size == 64) { + // On ppc64 these are all ds form status = Reloc::addr16_ds(view, value, overflow); break; } @@ -7611,7 +7614,6 @@ Target_powerpc<size, big_endian>::Relocate::relocate( case elfcpp::R_POWERPC_DTPREL16: case elfcpp::R_POWERPC_GOT_TLSGD16: case elfcpp::R_POWERPC_GOT_TLSLD16: - case elfcpp::R_POWERPC_GOT_TPREL16: case elfcpp::R_POWERPC_ADDR16_LO: case elfcpp::R_POWERPC_REL16_LO: case elfcpp::R_PPC64_TOC16_LO: @@ -7621,7 +7623,6 @@ Target_powerpc<size, big_endian>::Relocate::relocate( case elfcpp::R_POWERPC_DTPREL16_LO: case elfcpp::R_POWERPC_GOT_TLSGD16_LO: case elfcpp::R_POWERPC_GOT_TLSLD16_LO: - case elfcpp::R_POWERPC_GOT_TPREL16_LO: status = Reloc::addr16(view, value, overflow); break; |