Back to index

cell-binutils  2.17cvs20070401
symbols.h
Go to the documentation of this file.
00001 /* symbols.h -
00002    Copyright 1987, 1990, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
00003    2002, 2003, 2004, 2005 Free Software Foundation, Inc.
00004 
00005    This file is part of GAS, the GNU Assembler.
00006 
00007    GAS is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2, or (at your option)
00010    any later version.
00011 
00012    GAS is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with GAS; see the file COPYING.  If not, write to the Free
00019    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
00020    02110-1301, USA.  */
00021 
00022 extern struct obstack notes;       /* eg FixS live here.  */
00023 
00024 extern struct obstack cond_obstack;       /* this is where we track .ifdef/.endif
00025                                    (if we do that at all).  */
00026 
00027 extern symbolS *symbol_rootP;      /* all the symbol nodes */
00028 extern symbolS *symbol_lastP;      /* last struct symbol we made, or NULL */
00029 
00030 extern symbolS abs_symbol;
00031 
00032 extern int symbol_table_frozen;
00033 
00034 /* This is non-zero if symbols are case sensitive, which is the
00035    default.  */
00036 extern int symbols_case_sensitive;
00037 
00038 char * symbol_relc_make_expr  (expressionS *);
00039 char * symbol_relc_make_sym   (symbolS *);
00040 char * symbol_relc_make_value (offsetT);
00041 char *decode_local_label_name (char *s);
00042 symbolS *symbol_find (const char *name);
00043 symbolS *symbol_find_noref (const char *name, int noref);
00044 symbolS *symbol_find_exact (const char *name);
00045 symbolS *symbol_find_exact_noref (const char *name, int noref);
00046 symbolS *symbol_find_or_make (const char *name);
00047 symbolS *symbol_make (const char *name);
00048 symbolS *symbol_new (const char *name, segT segment, valueT value,
00049                    fragS * frag);
00050 symbolS *symbol_create (const char *name, segT segment, valueT value,
00051                      fragS * frag);
00052 symbolS *symbol_clone (symbolS *, int);
00053 #undef symbol_clone_if_forward_ref
00054 symbolS *symbol_clone_if_forward_ref (symbolS *, int);
00055 #define symbol_clone_if_forward_ref(s) symbol_clone_if_forward_ref (s, 0)
00056 symbolS *symbol_temp_new (segT, valueT, fragS *);
00057 symbolS *symbol_temp_new_now (void);
00058 symbolS *symbol_temp_make (void);
00059 
00060 symbolS *colon (const char *sym_name);
00061 void local_colon (int n);
00062 void symbol_begin (void);
00063 void symbol_print_statistics (FILE *);
00064 void symbol_table_insert (symbolS * symbolP);
00065 valueT resolve_symbol_value (symbolS *);
00066 void resolve_local_symbol_values (void);
00067 int snapshot_symbol (symbolS **, valueT *, segT *, fragS **);
00068 
00069 void print_symbol_value (symbolS *);
00070 void print_expr (expressionS *);
00071 void print_expr_1 (FILE *, expressionS *);
00072 void print_symbol_value_1 (FILE *, symbolS *);
00073 
00074 int dollar_label_defined (long l);
00075 void dollar_label_clear (void);
00076 void define_dollar_label (long l);
00077 char *dollar_label_name (long l, int augend);
00078 
00079 void fb_label_instance_inc (long label);
00080 char *fb_label_name (long n, long augend);
00081 
00082 extern void copy_symbol_attributes (symbolS *, symbolS *);
00083 
00084 /* Get and set the values of symbols.  These used to be macros.  */
00085 extern valueT S_GET_VALUE (symbolS *);
00086 extern void S_SET_VALUE (symbolS *, valueT);
00087 
00088 extern int S_IS_FUNCTION (symbolS *);
00089 extern int S_IS_EXTERNAL (symbolS *);
00090 extern int S_IS_WEAK (symbolS *);
00091 extern int S_IS_WEAKREFR (symbolS *);
00092 extern int S_IS_WEAKREFD (symbolS *);
00093 extern int S_IS_COMMON (symbolS *);
00094 extern int S_IS_DEFINED (symbolS *);
00095 extern int S_FORCE_RELOC (symbolS *, int);
00096 extern int S_IS_DEBUG (symbolS *);
00097 extern int S_IS_LOCAL (symbolS *);
00098 extern int S_IS_STABD (symbolS *);
00099 extern int S_IS_VOLATILE (const symbolS *);
00100 extern int S_IS_FORWARD_REF (const symbolS *);
00101 extern const char *S_GET_NAME (symbolS *);
00102 extern segT S_GET_SEGMENT (symbolS *);
00103 extern void S_SET_SEGMENT (symbolS *, segT);
00104 extern void S_SET_EXTERNAL (symbolS *);
00105 extern void S_SET_NAME (symbolS *, const char *);
00106 extern void S_CLEAR_EXTERNAL (symbolS *);
00107 extern void S_SET_WEAK (symbolS *);
00108 extern void S_SET_WEAKREFR (symbolS *);
00109 extern void S_CLEAR_WEAKREFR (symbolS *);
00110 extern void S_SET_WEAKREFD (symbolS *);
00111 extern void S_CLEAR_WEAKREFD (symbolS *);
00112 extern void S_SET_THREAD_LOCAL (symbolS *);
00113 extern void S_SET_VOLATILE (symbolS *);
00114 extern void S_CLEAR_VOLATILE (symbolS *);
00115 extern void S_SET_FORWARD_REF (symbolS *);
00116 
00117 #ifndef WORKING_DOT_WORD
00118 struct broken_word
00119   {
00120     /* Linked list -- one of these structures per ".word x-y+C"
00121        expression.  */
00122     struct broken_word *next_broken_word;
00123     /* Segment and subsegment for broken word.  */
00124     segT seg;
00125     subsegT subseg;
00126     /* Which frag is this broken word in?  */
00127     fragS *frag;
00128     /* Where in the frag is it?  */
00129     char *word_goes_here;
00130     /* Where to add the break.  */
00131     fragS *dispfrag;        /* where to add the break */
00132     /* Operands of expression.  */
00133     symbolS *add;
00134     symbolS *sub;
00135     offsetT addnum;
00136 
00137     int added;                     /* nasty thing happened yet? */
00138     /* 1: added and has a long-jump */
00139     /* 2: added but uses someone elses long-jump */
00140 
00141     /* Pointer to broken_word with a similar long-jump.  */
00142     struct broken_word *use_jump;
00143   };
00144 extern struct broken_word *broken_words;
00145 #endif /* ndef WORKING_DOT_WORD */
00146 
00147 /*
00148  * Current means for getting from symbols to segments and vice verse.
00149  * This will change for infinite-segments support (e.g. COFF).
00150  */
00151 extern const segT N_TYPE_seg[];    /* subseg.c */
00152 
00153 #define       SEGMENT_TO_SYMBOL_TYPE(seg)  ( seg_N_TYPE [(int) (seg)] )
00154 extern const short seg_N_TYPE[];/* subseg.c */
00155 
00156 #define       N_REGISTER    30     /* Fake N_TYPE value for SEG_REGISTER */
00157 
00158 void symbol_clear_list_pointers (symbolS * symbolP);
00159 
00160 void symbol_insert (symbolS * addme, symbolS * target,
00161                   symbolS ** rootP, symbolS ** lastP);
00162 void symbol_remove (symbolS * symbolP, symbolS ** rootP,
00163                   symbolS ** lastP);
00164 
00165 extern symbolS *symbol_previous (symbolS *);
00166 
00167 void verify_symbol_chain (symbolS * rootP, symbolS * lastP);
00168 
00169 void symbol_append (symbolS * addme, symbolS * target,
00170                   symbolS ** rootP, symbolS ** lastP);
00171 
00172 extern symbolS *symbol_next (symbolS *);
00173 
00174 extern expressionS *symbol_get_value_expression (symbolS *);
00175 extern void symbol_set_value_expression (symbolS *, const expressionS *);
00176 extern offsetT *symbol_X_add_number (symbolS *);
00177 extern void symbol_set_value_now (symbolS *);
00178 extern void symbol_set_frag (symbolS *, fragS *);
00179 extern fragS *symbol_get_frag (symbolS *);
00180 extern void symbol_mark_used (symbolS *);
00181 extern void symbol_clear_used (symbolS *);
00182 extern int symbol_used_p (symbolS *);
00183 extern void symbol_mark_used_in_reloc (symbolS *);
00184 extern void symbol_clear_used_in_reloc (symbolS *);
00185 extern int symbol_used_in_reloc_p (symbolS *);
00186 extern void symbol_mark_mri_common (symbolS *);
00187 extern void symbol_clear_mri_common (symbolS *);
00188 extern int symbol_mri_common_p (symbolS *);
00189 extern void symbol_mark_written (symbolS *);
00190 extern void symbol_clear_written (symbolS *);
00191 extern int symbol_written_p (symbolS *);
00192 extern void symbol_mark_resolved (symbolS *);
00193 extern int symbol_resolved_p (symbolS *);
00194 extern int symbol_section_p (symbolS *);
00195 extern int symbol_equated_p (symbolS *);
00196 extern int symbol_equated_reloc_p (symbolS *);
00197 extern int symbol_constant_p (symbolS *);
00198 extern int symbol_shadow_p (symbolS *);
00199 extern asymbol *symbol_get_bfdsym (symbolS *);
00200 extern void symbol_set_bfdsym (symbolS *, asymbol *);
00201 
00202 #ifdef OBJ_SYMFIELD_TYPE
00203 OBJ_SYMFIELD_TYPE *symbol_get_obj (symbolS *);
00204 void symbol_set_obj (symbolS *, OBJ_SYMFIELD_TYPE *);
00205 #endif
00206 
00207 #ifdef TC_SYMFIELD_TYPE
00208 TC_SYMFIELD_TYPE *symbol_get_tc (symbolS *);
00209 void symbol_set_tc (symbolS *, TC_SYMFIELD_TYPE *);
00210 #endif