gas/ChangeLog:
[deliverable/binutils-gdb.git] / gas / symbols.h
1 /* symbols.h -
2 Copyright 1987, 1990, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
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
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20 02110-1301, USA. */
21
22 extern struct obstack notes; /* eg FixS live here. */
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
38 char *decode_local_label_name (char *s);
39 symbolS *symbol_find (const char *name);
40 symbolS *symbol_find_noref (const char *name, int noref);
41 symbolS *symbol_find_exact (const char *name);
42 symbolS *symbol_find_exact_noref (const char *name, int noref);
43 symbolS *symbol_find_or_make (const char *name);
44 symbolS *symbol_make (const char *name);
45 symbolS *symbol_new (const char *name, segT segment, valueT value,
46 fragS * frag);
47 symbolS *symbol_create (const char *name, segT segment, valueT value,
48 fragS * frag);
49 symbolS *symbol_clone (symbolS *, int);
50 #undef symbol_clone_if_forward_ref
51 symbolS *symbol_clone_if_forward_ref (symbolS *, int);
52 #define symbol_clone_if_forward_ref(s) symbol_clone_if_forward_ref (s, 0)
53 symbolS *symbol_temp_new (segT, valueT, fragS *);
54 symbolS *symbol_temp_new_now (void);
55 symbolS *symbol_temp_make (void);
56
57 symbolS *colon (const char *sym_name);
58 void local_colon (int n);
59 void symbol_begin (void);
60 void symbol_print_statistics (FILE *);
61 void symbol_table_insert (symbolS * symbolP);
62 valueT resolve_symbol_value (symbolS *);
63 void resolve_local_symbol_values (void);
64 int snapshot_symbol (symbolS *, valueT *, segT *, fragS **);
65
66 void print_symbol_value (symbolS *);
67 void print_expr (expressionS *);
68 void print_expr_1 (FILE *, expressionS *);
69 void print_symbol_value_1 (FILE *, symbolS *);
70
71 int dollar_label_defined (long l);
72 void dollar_label_clear (void);
73 void define_dollar_label (long l);
74 char *dollar_label_name (long l, int augend);
75
76 void fb_label_instance_inc (long label);
77 char *fb_label_name (long n, long augend);
78
79 extern void copy_symbol_attributes (symbolS *, symbolS *);
80
81 /* Get and set the values of symbols. These used to be macros. */
82 extern valueT S_GET_VALUE (symbolS *);
83 extern void S_SET_VALUE (symbolS *, valueT);
84
85 extern int S_IS_FUNCTION (symbolS *);
86 extern int S_IS_EXTERNAL (symbolS *);
87 extern int S_IS_WEAK (symbolS *);
88 extern int S_IS_WEAKREFR (symbolS *);
89 extern int S_IS_WEAKREFD (symbolS *);
90 extern int S_IS_COMMON (symbolS *);
91 extern int S_IS_DEFINED (symbolS *);
92 extern int S_FORCE_RELOC (symbolS *, int);
93 extern int S_IS_DEBUG (symbolS *);
94 extern int S_IS_LOCAL (symbolS *);
95 extern int S_IS_STABD (symbolS *);
96 extern int S_IS_VOLATILE (const symbolS *);
97 extern int S_IS_FORWARD_REF (const symbolS *);
98 extern const char *S_GET_NAME (symbolS *);
99 extern segT S_GET_SEGMENT (symbolS *);
100 extern void S_SET_SEGMENT (symbolS *, segT);
101 extern void S_SET_EXTERNAL (symbolS *);
102 extern void S_SET_NAME (symbolS *, const char *);
103 extern void S_CLEAR_EXTERNAL (symbolS *);
104 extern void S_SET_WEAK (symbolS *);
105 extern void S_SET_WEAKREFR (symbolS *);
106 extern void S_CLEAR_WEAKREFR (symbolS *);
107 extern void S_SET_WEAKREFD (symbolS *);
108 extern void S_CLEAR_WEAKREFD (symbolS *);
109 extern void S_SET_THREAD_LOCAL (symbolS *);
110 extern void S_SET_VOLATILE (symbolS *);
111 extern void S_SET_FORWARD_REF (symbolS *);
112
113 #ifndef WORKING_DOT_WORD
114 struct broken_word
115 {
116 /* Linked list -- one of these structures per ".word x-y+C"
117 expression. */
118 struct broken_word *next_broken_word;
119 /* Segment and subsegment for broken word. */
120 segT seg;
121 subsegT subseg;
122 /* Which frag is this broken word in? */
123 fragS *frag;
124 /* Where in the frag is it? */
125 char *word_goes_here;
126 /* Where to add the break. */
127 fragS *dispfrag; /* where to add the break */
128 /* Operands of expression. */
129 symbolS *add;
130 symbolS *sub;
131 offsetT addnum;
132
133 int added; /* nasty thing happened yet? */
134 /* 1: added and has a long-jump */
135 /* 2: added but uses someone elses long-jump */
136
137 /* Pointer to broken_word with a similar long-jump. */
138 struct broken_word *use_jump;
139 };
140 extern struct broken_word *broken_words;
141 #endif /* ndef WORKING_DOT_WORD */
142
143 /*
144 * Current means for getting from symbols to segments and vice verse.
145 * This will change for infinite-segments support (e.g. COFF).
146 */
147 extern const segT N_TYPE_seg[]; /* subseg.c */
148
149 #define SEGMENT_TO_SYMBOL_TYPE(seg) ( seg_N_TYPE [(int) (seg)] )
150 extern const short seg_N_TYPE[];/* subseg.c */
151
152 #define N_REGISTER 30 /* Fake N_TYPE value for SEG_REGISTER */
153
154 void symbol_clear_list_pointers (symbolS * symbolP);
155
156 void symbol_insert (symbolS * addme, symbolS * target,
157 symbolS ** rootP, symbolS ** lastP);
158 void symbol_remove (symbolS * symbolP, symbolS ** rootP,
159 symbolS ** lastP);
160
161 extern symbolS *symbol_previous (symbolS *);
162
163 void verify_symbol_chain (symbolS * rootP, symbolS * lastP);
164
165 void symbol_append (symbolS * addme, symbolS * target,
166 symbolS ** rootP, symbolS ** lastP);
167
168 extern symbolS *symbol_next (symbolS *);
169
170 extern expressionS *symbol_get_value_expression (symbolS *);
171 extern void symbol_set_value_expression (symbolS *, const expressionS *);
172 extern offsetT *symbol_X_add_number (symbolS *);
173 extern void symbol_set_value_now (symbolS *);
174 extern void symbol_set_frag (symbolS *, fragS *);
175 extern fragS *symbol_get_frag (symbolS *);
176 extern void symbol_mark_used (symbolS *);
177 extern void symbol_clear_used (symbolS *);
178 extern int symbol_used_p (symbolS *);
179 extern void symbol_mark_used_in_reloc (symbolS *);
180 extern void symbol_clear_used_in_reloc (symbolS *);
181 extern int symbol_used_in_reloc_p (symbolS *);
182 extern void symbol_mark_mri_common (symbolS *);
183 extern void symbol_clear_mri_common (symbolS *);
184 extern int symbol_mri_common_p (symbolS *);
185 extern void symbol_mark_written (symbolS *);
186 extern void symbol_clear_written (symbolS *);
187 extern int symbol_written_p (symbolS *);
188 extern void symbol_mark_resolved (symbolS *);
189 extern int symbol_resolved_p (symbolS *);
190 extern int symbol_section_p (symbolS *);
191 extern int symbol_equated_p (symbolS *);
192 extern int symbol_equated_reloc_p (symbolS *);
193 extern int symbol_constant_p (symbolS *);
194 extern asymbol *symbol_get_bfdsym (symbolS *);
195 extern void symbol_set_bfdsym (symbolS *, asymbol *);
196
197 #ifdef OBJ_SYMFIELD_TYPE
198 OBJ_SYMFIELD_TYPE *symbol_get_obj (symbolS *);
199 void symbol_set_obj (symbolS *, OBJ_SYMFIELD_TYPE *);
200 #endif
201
202 #ifdef TC_SYMFIELD_TYPE
203 TC_SYMFIELD_TYPE *symbol_get_tc (symbolS *);
204 void symbol_set_tc (symbolS *, TC_SYMFIELD_TYPE *);
205 #endif
This page took 0.050809 seconds and 5 git commands to generate.