Output error message if diff of labels not defined

When calculating the difference of addresses between two labels, for it
to be defined, either:

- Both of them must have their absolute address defined.
- They belong to the same section, so their relative addresses are
  compatible.

This patch adds a check to make sure that any other case is detected so
that the programmer can correct the code.

This applies to rgbasm. The difference of labels can be used, for
example, as argument of DS. The linker can't resize sections, which
means that the final value must be defined when creating the object
file.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
This commit is contained in:
AntonioND
2017-04-04 21:21:23 +01:00
parent 2abdc9c59d
commit e63e801e9c
3 changed files with 51 additions and 2 deletions

View File

@@ -71,5 +71,6 @@ ULONG sym_GetDefinedValue(char *s);
ULONG sym_isDefined(char *tzName);
void sym_Purge(char *tzName);
ULONG sym_isConstDefined(char *tzName);
int sym_IsRelocDiffDefined(char *tzSym1, char *tzSym2);
#endif