From dae1b34eabf9669f84490afb384c0281485b67ef Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 23 Nov 2004 14:49:12 +0000 Subject: * config/tc-mn10300.c (md_relax_table): More fixes to the offsets in this table. They should be correct now. * gas/mn10300/relax.s: Add further tests of the relaxing of branch instructions. * gas/mn10300/relax.d: Add expected relocations. --- gas/config/tc-mn10300.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'gas/config/tc-mn10300.c') diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index e2fcf75..847c974 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -54,15 +54,20 @@ const char EXP_CHARS[] = "eE"; as in 0d1.0. */ const char FLT_CHARS[] = "dD"; -const relax_typeS md_relax_table[] = { +const relax_typeS md_relax_table[] = +{ + /* The plus values for the bCC and fBCC instructions in the table below + are because the branch instruction is translated into a jump + instruction that is now +2 or +3 bytes further on in memory, and the + correct size of jump instruction must be selected. */ /* bCC relaxing */ {0x7f, -0x80, 2, 1}, - {0x7fff, -0x8000 + 1, 5, 2}, + {0x7fff + 2, -0x8000 + 2, 5, 2}, {0x7fffffff, -0x80000000, 7, 0}, - /* bCC relaxing (uncommon cases) */ + /* bCC relaxing (uncommon cases for 3byte length instructions) */ {0x7f, -0x80, 3, 4}, - {0x7fff, -0x8000 + 1, 6, 5}, + {0x7fff + 3, -0x8000 + 3, 6, 5}, {0x7fffffff, -0x80000000, 8, 0}, /* call relaxing */ @@ -80,7 +85,7 @@ const relax_typeS md_relax_table[] = { /* fbCC relaxing */ {0x7f, -0x80, 3, 14}, - {0x7fff, -0x8000 + 1, 6, 15}, + {0x7fff + 3, -0x8000 + 3, 6, 15}, {0x7fffffff, -0x80000000, 8, 0}, }; -- cgit v1.1