//
// Evaluate expression.
// If the expression involves only ONE external symbol, the expression is
-// UNDEFINED, but it's value includes everything but the symbol value, and
+// UNDEFINED, but its value includes everything but the symbol value, and
// 'a_esym' is set to the external symbol.
//
int evexpr(TOKEN * _tk, uint64_t * a_value, WORD * a_attr, SYM ** a_esym)
#define SIZP 0x0080 // .p (FPU pakced decimal real)
#define SIZQ 0x0100 // .q (quad word)
+// Extended attributes
#define EQUATEDREG 0x0008 // Equated register symbol
#define UNDEF_EQUR 0x0010
#define EQUATEDCC 0x0020
if (evexpr(fup->expr, &eval, &eattr, &esym) != OK)
continue;
+ if (esym)
+ if (!(esym->sattr & DEFINED))
+ {
+ // If our expression still has an undefined symbol at this stage, it's bad news.
+ // The linker is never going to resolve the expression, so that's an error.
+ error("cannot export complex expression with unresloved symbol '%s'", esym->sname);
+ continue;
+ }
+
if ((CHECK_OPTS(OPT_PC_RELATIVE)) && (eattr & (DEFINED | REFERENCED | EQUATED)) == (DEFINED | REFERENCED))
{
error("relocation not allowed when o30 is enabled");