New option --relax-checks that disable the check for a match beween size oif

an expression and the address size. Will allow short branches between segments
among other things. Suggested by Spiro Trikaliotis.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5810 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2012-08-20 20:07:05 +00:00
parent da4bc2bcaa
commit c1bbf69d72
5 changed files with 38 additions and 12 deletions

View File

@@ -407,20 +407,18 @@ void SegDone (void)
}
F->Type = FRAG_LITERAL;
} else {
} else if (RelaxChecks == 0) {
/* Simplify the expression */
/* ### F->V.Expr = SimplifyExpr (F->V.Expr, &ED); */
/* We cannot evaluate the expression now, leave the job for
* the linker. However, we can check if the address size
* matches the fragment size, and we will do so.
*/
/* We cannot evaluate the expression now, leave the job for
* the linker. However, we can check if the address size
* matches the fragment size. Mismatches are errors in
* most situations.
*/
if ((F->Len == 1 && ED.AddrSize > ADDR_SIZE_ZP) ||
(F->Len == 2 && ED.AddrSize > ADDR_SIZE_ABS) ||
(F->Len == 3 && ED.AddrSize > ADDR_SIZE_FAR)) {
LIError (&F->LI, "Range error");
}
LIError (&F->LI, "Range error");
}
}
/* Release memory allocated for the expression decriptor */