From beceef50438ccf2917744147a4fdadcc84db7d78 Mon Sep 17 00:00:00 2001 From: Vladimir Radosavljevic Date: Mon, 20 Jun 2016 12:06:56 -0700 Subject: [PATCH] Add unaligned check for R_MIPS_PC16. gold/ * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check. --- gold/ChangeLog | 4 ++++ gold/mips.cc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/gold/ChangeLog b/gold/ChangeLog index 6d315c5de9..cf8289bba7 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 cea0a81abb..e2b7855bfc 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); }