Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* symbols.h - |
9758f3fc | 2 | Copyright 1987, 1990, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, |
be95a9c1 | 3 | 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
252b5132 RH |
4 | |
5 | This file is part of GAS, the GNU Assembler. | |
6 | ||
7 | GAS is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2, or (at your option) | |
10 | any later version. | |
11 | ||
12 | GAS is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GAS; see the file COPYING. If not, write to the Free | |
4b4da160 NC |
19 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
20 | 02110-1301, USA. */ | |
252b5132 | 21 | |
a01b9fa4 | 22 | extern struct obstack notes; /* eg FixS live here. */ |
252b5132 RH |
23 | |
24 | extern struct obstack cond_obstack; /* this is where we track .ifdef/.endif | |
25 | (if we do that at all). */ | |
26 | ||
27 | extern symbolS *symbol_rootP; /* all the symbol nodes */ | |
28 | extern symbolS *symbol_lastP; /* last struct symbol we made, or NULL */ | |
29 | ||
30 | extern symbolS abs_symbol; | |
31 | ||
32 | extern int symbol_table_frozen; | |
33 | ||
34 | /* This is non-zero if symbols are case sensitive, which is the | |
35 | default. */ | |
36 | extern int symbols_case_sensitive; | |
37 | ||
74937d39 KH |
38 | char *decode_local_label_name (char *s); |
39 | symbolS *symbol_find (const char *name); | |
40 | symbolS *symbol_find_exact (const char *name); | |
74937d39 KH |
41 | symbolS *symbol_find_or_make (const char *name); |
42 | symbolS *symbol_make (const char *name); | |
43 | symbolS *symbol_new (const char *name, segT segment, valueT value, | |
44 | fragS * frag); | |
45 | symbolS *symbol_create (const char *name, segT segment, valueT value, | |
46 | fragS * frag); | |
9497f5ac NC |
47 | symbolS *symbol_clone (symbolS *, int); |
48 | #undef symbol_clone_if_forward_ref | |
49 | symbolS *symbol_clone_if_forward_ref (symbolS *, int); | |
50 | #define symbol_clone_if_forward_ref(s) symbol_clone_if_forward_ref (s, 0) | |
74937d39 KH |
51 | symbolS *symbol_temp_new (segT, valueT, fragS *); |
52 | symbolS *symbol_temp_new_now (void); | |
53 | symbolS *symbol_temp_make (void); | |
54 | ||
55 | symbolS *colon (const char *sym_name); | |
56 | void local_colon (int n); | |
57 | void symbol_begin (void); | |
58 | void symbol_print_statistics (FILE *); | |
59 | void symbol_table_insert (symbolS * symbolP); | |
60 | valueT resolve_symbol_value (symbolS *); | |
61 | void resolve_local_symbol_values (void); | |
9497f5ac | 62 | int snapshot_symbol (symbolS *, valueT *, segT *, fragS **); |
74937d39 KH |
63 | |
64 | void print_symbol_value (symbolS *); | |
65 | void print_expr (expressionS *); | |
66 | void print_expr_1 (FILE *, expressionS *); | |
67 | void print_symbol_value_1 (FILE *, symbolS *); | |
68 | ||
69 | int dollar_label_defined (long l); | |
70 | void dollar_label_clear (void); | |
71 | void define_dollar_label (long l); | |
72 | char *dollar_label_name (long l, int augend); | |
73 | ||
74 | void fb_label_instance_inc (long label); | |
75 | char *fb_label_name (long n, long augend); | |
76 | ||
77 | extern void copy_symbol_attributes (symbolS *, symbolS *); | |
252b5132 RH |
78 | |
79 | /* Get and set the values of symbols. These used to be macros. */ | |
74937d39 KH |
80 | extern valueT S_GET_VALUE (symbolS *); |
81 | extern void S_SET_VALUE (symbolS *, valueT); | |
252b5132 | 82 | |
74937d39 KH |
83 | extern int S_IS_FUNCTION (symbolS *); |
84 | extern int S_IS_EXTERNAL (symbolS *); | |
85 | extern int S_IS_WEAK (symbolS *); | |
86 | extern int S_IS_COMMON (symbolS *); | |
87 | extern int S_IS_DEFINED (symbolS *); | |
88 | extern int S_FORCE_RELOC (symbolS *, int); | |
89 | extern int S_IS_DEBUG (symbolS *); | |
90 | extern int S_IS_LOCAL (symbolS *); | |
74937d39 | 91 | extern int S_IS_STABD (symbolS *); |
9497f5ac NC |
92 | extern int S_IS_VOLATILE (const symbolS *); |
93 | extern int S_IS_FORWARD_REF (const symbolS *); | |
74937d39 KH |
94 | extern const char *S_GET_NAME (symbolS *); |
95 | extern segT S_GET_SEGMENT (symbolS *); | |
96 | extern void S_SET_SEGMENT (symbolS *, segT); | |
97 | extern void S_SET_EXTERNAL (symbolS *); | |
977cdf5a | 98 | extern void S_SET_NAME (symbolS *, const char *); |
74937d39 KH |
99 | extern void S_CLEAR_EXTERNAL (symbolS *); |
100 | extern void S_SET_WEAK (symbolS *); | |
101 | extern void S_SET_THREAD_LOCAL (symbolS *); | |
9497f5ac NC |
102 | extern void S_SET_VOLATILE (symbolS *); |
103 | extern void S_SET_FORWARD_REF (symbolS *); | |
252b5132 | 104 | |
49309057 ILT |
105 | #ifndef WORKING_DOT_WORD |
106 | struct broken_word | |
107 | { | |
108 | /* Linked list -- one of these structures per ".word x-y+C" | |
109 | expression. */ | |
110 | struct broken_word *next_broken_word; | |
111 | /* Segment and subsegment for broken word. */ | |
112 | segT seg; | |
113 | subsegT subseg; | |
114 | /* Which frag is this broken word in? */ | |
115 | fragS *frag; | |
116 | /* Where in the frag is it? */ | |
117 | char *word_goes_here; | |
118 | /* Where to add the break. */ | |
119 | fragS *dispfrag; /* where to add the break */ | |
120 | /* Operands of expression. */ | |
121 | symbolS *add; | |
122 | symbolS *sub; | |
123 | offsetT addnum; | |
124 | ||
47eebc20 | 125 | int added; /* nasty thing happened yet? */ |
49309057 ILT |
126 | /* 1: added and has a long-jump */ |
127 | /* 2: added but uses someone elses long-jump */ | |
128 | ||
129 | /* Pointer to broken_word with a similar long-jump. */ | |
130 | struct broken_word *use_jump; | |
131 | }; | |
132 | extern struct broken_word *broken_words; | |
133 | #endif /* ndef WORKING_DOT_WORD */ | |
134 | ||
135 | /* | |
136 | * Current means for getting from symbols to segments and vice verse. | |
137 | * This will change for infinite-segments support (e.g. COFF). | |
138 | */ | |
139 | extern const segT N_TYPE_seg[]; /* subseg.c */ | |
140 | ||
141 | #define SEGMENT_TO_SYMBOL_TYPE(seg) ( seg_N_TYPE [(int) (seg)] ) | |
142 | extern const short seg_N_TYPE[];/* subseg.c */ | |
143 | ||
144 | #define N_REGISTER 30 /* Fake N_TYPE value for SEG_REGISTER */ | |
145 | ||
74937d39 | 146 | void symbol_clear_list_pointers (symbolS * symbolP); |
49309057 | 147 | |
74937d39 KH |
148 | void symbol_insert (symbolS * addme, symbolS * target, |
149 | symbolS ** rootP, symbolS ** lastP); | |
150 | void symbol_remove (symbolS * symbolP, symbolS ** rootP, | |
151 | symbolS ** lastP); | |
49309057 | 152 | |
74937d39 | 153 | extern symbolS *symbol_previous (symbolS *); |
49309057 | 154 | |
74937d39 | 155 | void verify_symbol_chain (symbolS * rootP, symbolS * lastP); |
74937d39 KH |
156 | |
157 | void symbol_append (symbolS * addme, symbolS * target, | |
158 | symbolS ** rootP, symbolS ** lastP); | |
159 | ||
160 | extern symbolS *symbol_next (symbolS *); | |
161 | ||
162 | extern expressionS *symbol_get_value_expression (symbolS *); | |
163 | extern void symbol_set_value_expression (symbolS *, const expressionS *); | |
514d955d | 164 | extern offsetT *symbol_X_add_number (symbolS *); |
74937d39 KH |
165 | extern void symbol_set_value_now (symbolS *); |
166 | extern void symbol_set_frag (symbolS *, fragS *); | |
167 | extern fragS *symbol_get_frag (symbolS *); | |
168 | extern void symbol_mark_used (symbolS *); | |
169 | extern void symbol_clear_used (symbolS *); | |
170 | extern int symbol_used_p (symbolS *); | |
171 | extern void symbol_mark_used_in_reloc (symbolS *); | |
172 | extern void symbol_clear_used_in_reloc (symbolS *); | |
173 | extern int symbol_used_in_reloc_p (symbolS *); | |
174 | extern void symbol_mark_mri_common (symbolS *); | |
175 | extern void symbol_clear_mri_common (symbolS *); | |
176 | extern int symbol_mri_common_p (symbolS *); | |
177 | extern void symbol_mark_written (symbolS *); | |
178 | extern void symbol_clear_written (symbolS *); | |
179 | extern int symbol_written_p (symbolS *); | |
180 | extern void symbol_mark_resolved (symbolS *); | |
181 | extern int symbol_resolved_p (symbolS *); | |
182 | extern int symbol_section_p (symbolS *); | |
183 | extern int symbol_equated_p (symbolS *); | |
184 | extern int symbol_equated_reloc_p (symbolS *); | |
185 | extern int symbol_constant_p (symbolS *); | |
74937d39 KH |
186 | extern asymbol *symbol_get_bfdsym (symbolS *); |
187 | extern void symbol_set_bfdsym (symbolS *, asymbol *); | |
49309057 ILT |
188 | |
189 | #ifdef OBJ_SYMFIELD_TYPE | |
74937d39 KH |
190 | OBJ_SYMFIELD_TYPE *symbol_get_obj (symbolS *); |
191 | void symbol_set_obj (symbolS *, OBJ_SYMFIELD_TYPE *); | |
49309057 ILT |
192 | #endif |
193 | ||
194 | #ifdef TC_SYMFIELD_TYPE | |
74937d39 KH |
195 | TC_SYMFIELD_TYPE *symbol_get_tc (symbolS *); |
196 | void symbol_set_tc (symbolS *, TC_SYMFIELD_TYPE *); | |
49309057 | 197 | #endif |