diff options
-rw-r--r-- | gas/ChangeLog | 10 | ||||
-rw-r--r-- | gas/config/tc-mmix.h | 3 | ||||
-rw-r--r-- | gas/doc/internals.texi | 5 | ||||
-rw-r--r-- | gas/read.c | 2 | ||||
-rw-r--r-- | gas/symbols.c | 2 |
5 files changed, 22 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 000667f..14811cf 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +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. diff --git a/gas/config/tc-mmix.h b/gas/config/tc-mmix.h index 0e72d98..1fa3463 100644 --- a/gas/config/tc-mmix.h +++ b/gas/config/tc-mmix.h @@ -224,3 +224,6 @@ extern void mmix_md_do_align (int, char *, int, int); /* 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 diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi index 7c6172c..89e9198 100644 --- a/gas/doc/internals.texi +++ b/gas/doc/internals.texi @@ -1325,6 +1325,11 @@ This macro is evaluated for any fixup with a @code{fx_subsy} that @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 @@ -3621,12 +3621,14 @@ pseudo_set (symbolS *symbolP) 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); diff --git a/gas/symbols.c b/gas/symbols.c index 84f394c..7e4f982 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -2191,12 +2191,14 @@ S_SET_EXTERNAL (symbolS *s) _("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); |