+S_SET_VOLATILE (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_flags.sy_volatile = 1;
+}
+
+void
+S_CLEAR_VOLATILE (symbolS *s)
+{
+ if (!LOCAL_SYMBOL_CHECK (s))
+ s->sy_flags.sy_volatile = 0;
+}
+
+void
+S_SET_FORWARD_REF (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_flags.sy_forward_ref = 1;
+}
+
+/* Return the previous symbol in a chain. */
+
+symbolS *
+symbol_previous (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ abort ();
+ return s->sy_previous;
+}
+
+/* Return the next symbol in a chain. */
+
+symbolS *
+symbol_next (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ abort ();
+ return s->sy_next;
+}
+
+/* Return a pointer to the value of a symbol as an expression. */
+
+expressionS *
+symbol_get_value_expression (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ return &s->sy_value;
+}
+
+/* Set the value of a symbol to an expression. */
+
+void
+symbol_set_value_expression (symbolS *s, const expressionS *exp)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_value = *exp;
+ S_CLEAR_WEAKREFR (s);
+}
+
+/* Return whether 2 symbols are the same. */
+
+int
+symbol_same_p (symbolS *s1, symbolS *s2)
+{
+ s1 = get_real_sym (s1);
+ s2 = get_real_sym (s2);
+ return s1 == s2;
+}
+
+/* Return a pointer to the X_add_number component of a symbol. */
+
+offsetT *
+symbol_X_add_number (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return (offsetT *) &((struct local_symbol *) s)->lsy_value;
+
+ return &s->sy_value.X_add_number;
+}
+
+/* Set the value of SYM to the current position in the current segment. */
+
+void
+symbol_set_value_now (symbolS *sym)
+{
+ S_SET_SEGMENT (sym, now_seg);
+ S_SET_VALUE (sym, frag_now_fix ());
+ symbol_set_frag (sym, frag_now);
+}
+
+/* Set the frag of a symbol. */
+
+void
+symbol_set_frag (symbolS *s, fragS *f)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ {
+ local_symbol_set_frag ((struct local_symbol *) s, f);
+ return;
+ }
+ s->sy_frag = f;
+ S_CLEAR_WEAKREFR (s);
+}
+
+/* Return the frag of a symbol. */
+
+fragS *
+symbol_get_frag (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return local_symbol_get_frag ((struct local_symbol *) s);
+ return s->sy_frag;
+}
+
+/* Mark a symbol as having been used. */
+
+void
+symbol_mark_used (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return;
+ s->sy_flags.sy_used = 1;
+ if (S_IS_WEAKREFR (s))
+ symbol_mark_used (s->sy_value.X_add_symbol);
+}
+
+/* Clear the mark of whether a symbol has been used. */
+
+void
+symbol_clear_used (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_flags.sy_used = 0;
+}
+
+/* Return whether a symbol has been used. */
+
+int
+symbol_used_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 1;
+ return s->sy_flags.sy_used;
+}
+
+/* Mark a symbol as having been used in a reloc. */
+
+void
+symbol_mark_used_in_reloc (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_flags.sy_used_in_reloc = 1;
+}
+
+/* Clear the mark of whether a symbol has been used in a reloc. */
+
+void
+symbol_clear_used_in_reloc (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return;
+ s->sy_flags.sy_used_in_reloc = 0;
+}
+
+/* Return whether a symbol has been used in a reloc. */
+
+int
+symbol_used_in_reloc_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 0;
+ return s->sy_flags.sy_used_in_reloc;
+}
+
+/* Mark a symbol as an MRI common symbol. */
+
+void
+symbol_mark_mri_common (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_flags.sy_mri_common = 1;
+}
+
+/* Clear the mark of whether a symbol is an MRI common symbol. */
+
+void
+symbol_clear_mri_common (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return;
+ s->sy_flags.sy_mri_common = 0;
+}
+
+/* Return whether a symbol is an MRI common symbol. */
+
+int
+symbol_mri_common_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 0;
+ return s->sy_flags.sy_mri_common;
+}
+
+/* Mark a symbol as having been written. */
+
+void
+symbol_mark_written (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return;
+ s->sy_flags.sy_written = 1;
+}
+
+/* Clear the mark of whether a symbol has been written. */
+
+void
+symbol_clear_written (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return;
+ s->sy_flags.sy_written = 0;
+}
+
+/* Return whether a symbol has been written. */
+
+int
+symbol_written_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 0;
+ return s->sy_flags.sy_written;
+}
+
+/* Mark a symbol has having been resolved. */
+
+void
+symbol_mark_resolved (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ {
+ local_symbol_mark_resolved ((struct local_symbol *) s);
+ return;
+ }
+ s->sy_flags.sy_resolved = 1;
+}
+
+/* Return whether a symbol has been resolved. */
+
+int
+symbol_resolved_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return local_symbol_resolved_p ((struct local_symbol *) s);
+ return s->sy_flags.sy_resolved;
+}
+
+/* Return whether a symbol is a section symbol. */
+
+int
+symbol_section_p (symbolS *s ATTRIBUTE_UNUSED)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 0;
+ return (s->bsym->flags & BSF_SECTION_SYM) != 0;
+}
+
+/* Return whether a symbol is equated to another symbol. */
+
+int
+symbol_equated_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 0;
+ return s->sy_value.X_op == O_symbol;
+}
+
+/* Return whether a symbol is equated to another symbol, and should be
+ treated specially when writing out relocs. */
+
+int
+symbol_equated_reloc_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 0;
+ /* X_op_symbol, normally not used for O_symbol, is set by
+ resolve_symbol_value to flag expression syms that have been
+ equated. */
+ return (s->sy_value.X_op == O_symbol
+#if defined (OBJ_COFF) && defined (TE_PE)
+ && ! S_IS_WEAK (s)
+#endif
+ && ((s->sy_flags.sy_resolved && s->sy_value.X_op_symbol != NULL)
+ || ! S_IS_DEFINED (s)
+ || S_IS_COMMON (s)));
+}
+
+/* Return whether a symbol has a constant value. */
+
+int
+symbol_constant_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 1;
+ return s->sy_value.X_op == O_constant;
+}
+
+/* Return whether a symbol was cloned and thus removed from the global
+ symbol list. */
+
+int
+symbol_shadow_p (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return 0;
+ return s->sy_next == s;
+}
+
+/* If S was created as a struct symbol, return S, otherwise if S is a
+ converted local_symbol return the converted symbol, otherwise
+ return NULL. */
+
+symbolS *
+symbol_symbolS (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return NULL;
+ return s;
+}
+
+/* Return the BFD symbol for a symbol. */
+
+asymbol *
+symbol_get_bfdsym (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ return s->bsym;
+}
+
+/* Set the BFD symbol for a symbol. */
+
+void
+symbol_set_bfdsym (symbolS *s, asymbol *bsym)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ /* Usually, it is harmless to reset a symbol to a BFD section
+ symbol. For example, obj_elf_change_section sets the BFD symbol
+ of an old symbol with the newly created section symbol. But when
+ we have multiple sections with the same name, the newly created
+ section may have the same name as an old section. We check if the
+ old symbol has been already marked as a section symbol before
+ resetting it. */
+ if ((s->bsym->flags & BSF_SECTION_SYM) == 0)
+ s->bsym = bsym;
+ /* else XXX - What do we do now ? */
+}
+
+#ifdef OBJ_SYMFIELD_TYPE
+
+/* Get a pointer to the object format information for a symbol. */
+
+OBJ_SYMFIELD_TYPE *
+symbol_get_obj (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ return &s->sy_obj;
+}
+
+/* Set the object format information for a symbol. */
+
+void
+symbol_set_obj (symbolS *s, OBJ_SYMFIELD_TYPE *o)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_obj = *o;
+}
+
+#endif /* OBJ_SYMFIELD_TYPE */
+
+#ifdef TC_SYMFIELD_TYPE
+
+/* Get a pointer to the processor information for a symbol. */
+
+TC_SYMFIELD_TYPE *
+symbol_get_tc (symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ return &s->sy_tc;
+}
+
+/* Set the processor information for a symbol. */
+
+void
+symbol_set_tc (symbolS *s, TC_SYMFIELD_TYPE *o)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ s = local_symbol_convert ((struct local_symbol *) s);
+ s->sy_tc = *o;
+}
+
+#endif /* TC_SYMFIELD_TYPE */
+
+void
+symbol_begin (void)