From: Vladimir Radosavljevic Date: Mon, 20 Jun 2016 19:06:56 +0000 (-0700) Subject: Add unaligned check for R_MIPS_PC16. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=beceef50438ccf2917744147a4fdadcc84db7d78;p=binutils-gdb.git Add unaligned check for R_MIPS_PC16. gold/ * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 6d315c5de98..cf8289bba7a 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,7 @@ +2016-06-20 Vladimir Radosavljevic + + * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check. + 2016-06-20 Vladimir Radosavljevic * mips.cc (relocation_needs_la25_stub): Add support for relocs: diff --git a/gold/mips.cc b/gold/mips.cc index cea0a81abbc..e2b7855bfce 100644 --- a/gold/mips.cc +++ b/gold/mips.cc @@ -4690,6 +4690,9 @@ class Mips_relocate_functions : public Relocate_functions else elfcpp::Swap<32, big_endian>::writeval(wv, val); + if (psymval->value(object, addend) & 3) + return This::STATUS_PCREL_UNALIGNED; + return check_overflow<18>(x); }