aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-m68k.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-10-26 21:58:41 +0000
committerIan Lance Taylor <ian@airs.com>1993-10-26 21:58:41 +0000
commitf3751617c3f3f34e1edbbf0dc4b8650aad66e8cf (patch)
treec1339b32673863f30130d4418ff12fe51c12e30f /gas/config/tc-m68k.c
parent56a2f3410f287967a3b7a6dc38ca1466090281e9 (diff)
downloadgdb-f3751617c3f3f34e1edbbf0dc4b8650aad66e8cf.zip
gdb-f3751617c3f3f34e1edbbf0dc4b8650aad66e8cf.tar.gz
gdb-f3751617c3f3f34e1edbbf0dc4b8650aad66e8cf.tar.bz2
* config/tc-m68k.c (md_apply_fix_2): Error if a short branch uses
an illegal offset of 0 or -1.
Diffstat (limited to 'gas/config/tc-m68k.c')
-rw-r--r--gas/config/tc-m68k.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 5fe9ff9..0e9ddbe 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -4032,7 +4032,17 @@ md_apply_fix_2 (fixP, val)
upper_limit = upper_limit * 2 + 1;
if ((unsigned) val > upper_limit && (val > 0 || val < lower_limit))
- as_bad ("value out of range");
+ as_bad_where (fixP->fx_file, fixP->fx_line, "value out of range");
+
+ /* A one byte PC-relative reloc means a short branch. We can't use
+ a short branch with a value of 0 or -1, because those indicate
+ different opcodes (branches with longer offsets). */
+ if (fixP->fx_pcrel
+ && fixP->fx_size == 1
+ && (fixP->fx_addsy == NULL
+ || S_IS_DEFINED (fixP->fx_addsy))
+ && (val == 0 || val == -1))
+ as_bad_where (fixP->fx_file, fixP->fx_line, "invalid byte branch offset");
}
#ifdef BFD_ASSEMBLER