From: Alan Modra Date: Tue, 24 Feb 2015 07:46:26 +0000 (+1030) Subject: PowerPC64 GOLD: complain on misaligned _DS relocs X-Git-Tag: binutils-2_25_1~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cff59f06b3b54ae3f5b61795c2719d4e28abf5d4;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 4fc46e4b370..90c3aa75e09 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,6 +1,13 @@ 2015-03-18 Alan Modra Apply from master + 2015-02-24 Alan Modra + 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-18 Alan Modra PR 17954 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 9843f2fb603..93f2fcccba9 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -1626,7 +1626,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; } @@ -7518,8 +7518,11 @@ Target_powerpc::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; } @@ -7532,7 +7535,6 @@ Target_powerpc::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: @@ -7542,7 +7544,6 @@ Target_powerpc::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;