fix a range check for 12bit PC relative access
This commit is contained in:
parent
67312df72f
commit
bb44231698
2
gnu/dist/gas/config/tc-sh.c
vendored
2
gnu/dist/gas/config/tc-sh.c
vendored
@ -1924,7 +1924,7 @@ md_apply_fix (fixP, val)
|
||||
|
||||
case BFD_RELOC_SH_PCDISP12BY2:
|
||||
val /= 2;
|
||||
if (val < -0x800 || val >= 0x7ff)
|
||||
if (val < -0x800 || val > 0x7ff)
|
||||
as_bad_where (fixP->fx_file, fixP->fx_line, "pcrel too far");
|
||||
buf[lowbyte] = val & 0xff;
|
||||
buf[highbyte] |= (val >> 8) & 0xf;
|
||||
|
Loading…
Reference in New Issue
Block a user