+2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * read.c (pseudo_set): Don't allow global register symbol only
+ if TC_GLOBAL_REGISTER_SYMBOL_OK is undefined.
+ * symbols.c (S_SET_EXTERNAL): Likewise.
+
+ * config/tc-mmix.h (TC_GLOBAL_REGISTER_SYMBOL_OK): Defined.
+
+ * doc/internals.texi: Document TC_GLOBAL_REGISTER_SYMBOL_OK.
+
2008-10-06 Bob Wilson <bob.wilson@acm.org>
* doc/as.texinfo (Local): New description of ELF .local directive.
/* This target is buggy, and sets fix size too large. */
#define TC_FX_SIZE_SLACK(FIX) 6
+
+/* MMIX has global register symbols. */
+#define TC_GLOBAL_REGISTER_SYMBOL_OK
@code{fixup_segment} cannot reduce to a number. If the macro returns
@code{false} an error will be reported.
+@item TC_GLOBAL_REGISTER_SYMBOL_OK
+@cindex TC_GLOBAL_REGISTER_SYMBOL_OK
+Define this macro if global register symbols are supported. The default
+is to disallow global register symbols.
+
@item MD_APPLY_SYM_VALUE (@var{fix})
@cindex MD_APPLY_SYM_VALUE
This macro controls whether the symbol value becomes part of the value passed
break;
case O_register:
+#ifndef TC_GLOBAL_REGISTER_SYMBOL_OK
if (S_IS_EXTERNAL (symbolP))
{
as_bad ("can't equate global symbol `%s' with register name",
S_GET_NAME (symbolP));
return;
}
+#endif
S_SET_SEGMENT (symbolP, reg_section);
S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
set_zero_frag (symbolP);
_("section symbols are already global"));
return;
}
+#ifndef TC_GLOBAL_REGISTER_SYMBOL_OK
if (S_GET_SEGMENT (s) == reg_section)
{
as_bad ("can't make register symbol `%s' global",
S_GET_NAME (s));
return;
}
+#endif
s->bsym->flags |= BSF_GLOBAL;
s->bsym->flags &= ~(BSF_LOCAL | BSF_WEAK);