+2014-06-20 Chung-Lin Tang <cltang@codesourcery.com>
+
+ Backport from mainline
+
+ 2014-06-20 Julian Brown <julian@codesourcery.com>
+ Chung-Lin Tang <cltang@codesourcery.com>
+
+ * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
+ TARGET_THUMB1_ONLY. Add comments.
+
2014-06-18 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline
fputs (":\n", file);
if (flag_pic)
{
- /* Output ".word .LTHUNKn-7-.LTHUNKPCn". */
+ /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn". */
rtx tem = XEXP (DECL_RTL (function), 0);
- tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
+ /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC
+ pipeline offset is four rather than eight. Adjust the offset
+ accordingly. */
+ tem = plus_constant (GET_MODE (tem), tem,
+ TARGET_THUMB1_ONLY ? -3 : -7);
tem = gen_rtx_MINUS (GET_MODE (tem),
tem,
gen_rtx_SYMBOL_REF (Pmode,