This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][gold] Mips: Add unaligned check for R_MIPS_PC16.


This patch adds unaligned check for R_MIPS_PC16.
Depends on https://sourceware.org/ml/binutils/2016-06/msg00180.html.

Regards,
Vladimir

ChangeLog -

gold/
	* mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
diff --git a/gold/mips.cc b/gold/mips.cc
index cea0a81..e2b7855 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -4690,6 +4690,9 @@ class Mips_relocate_functions : public Relocate_functions<size, big_endian>
     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);
   }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]