Improve jr out-of-reach error message

This commit is contained in:
ISSOtm
2020-01-02 14:06:40 +01:00
parent 3564b3f9ea
commit d3328406a2

View File

@@ -306,7 +306,7 @@ static void applyPatches(struct Section *section, void *arg)
int16_t offset = value - address; int16_t offset = value - address;
if (offset < -128 || offset > 127) if (offset < -128 || offset > 127)
errx(1, "%s(%d): jr target out of reach (%d)", errx(1, "%s(%d): jr target out of reach (expected -129 < %d < 128)",
patch->fileName, patch->lineNo, offset); patch->fileName, patch->lineNo, offset);
section->data[patch->offset] = offset & 0xFF; section->data[patch->offset] = offset & 0xFF;
} else { } else {