* doc/as.texinfo: Document -mdsp and -mno-dsp options.
[deliverable/binutils-gdb.git] / gas / symbols.h
CommitLineData
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 22extern struct obstack notes; /* eg FixS live here. */
252b5132
RH
23
24extern struct obstack cond_obstack; /* this is where we track .ifdef/.endif
25 (if we do that at all). */
26
27extern symbolS *symbol_rootP; /* all the symbol nodes */
28extern symbolS *symbol_lastP; /* last struct symbol we made, or NULL */
29
30extern symbolS abs_symbol;
31
32extern int symbol_table_frozen;
33
34/* This is non-zero if symbols are case sensitive, which is the
35 default. */
36extern int symbols_case_sensitive;
37
74937d39
KH
38char *decode_local_label_name (char *s);
39symbolS *symbol_find (const char *name);
40symbolS *symbol_find_exact (const char *name);
74937d39
KH
41symbolS *symbol_find_or_make (const char *name);
42symbolS *symbol_make (const char *name);
43symbolS *symbol_new (const char *name, segT segment, valueT value,
44 fragS * frag);
45symbolS *symbol_create (const char *name, segT segment, valueT value,
46 fragS * frag);
74937d39
KH
47symbolS *symbol_temp_new (segT, valueT, fragS *);
48symbolS *symbol_temp_new_now (void);
49symbolS *symbol_temp_make (void);
50
51symbolS *colon (const char *sym_name);
52void local_colon (int n);
53void symbol_begin (void);
54void symbol_print_statistics (FILE *);
55void symbol_table_insert (symbolS * symbolP);
56valueT resolve_symbol_value (symbolS *);
57void resolve_local_symbol_values (void);
58
59void print_symbol_value (symbolS *);
60void print_expr (expressionS *);
61void print_expr_1 (FILE *, expressionS *);
62void print_symbol_value_1 (FILE *, symbolS *);
63
64int dollar_label_defined (long l);
65void dollar_label_clear (void);
66void define_dollar_label (long l);
67char *dollar_label_name (long l, int augend);
68
69void fb_label_instance_inc (long label);
70char *fb_label_name (long n, long augend);
71
72extern void copy_symbol_attributes (symbolS *, symbolS *);
252b5132
RH
73
74/* Get and set the values of symbols. These used to be macros. */
74937d39
KH
75extern valueT S_GET_VALUE (symbolS *);
76extern void S_SET_VALUE (symbolS *, valueT);
252b5132 77
74937d39
KH
78extern int S_IS_FUNCTION (symbolS *);
79extern int S_IS_EXTERNAL (symbolS *);
80extern int S_IS_WEAK (symbolS *);
81extern int S_IS_COMMON (symbolS *);
82extern int S_IS_DEFINED (symbolS *);
83extern int S_FORCE_RELOC (symbolS *, int);
84extern int S_IS_DEBUG (symbolS *);
85extern int S_IS_LOCAL (symbolS *);
74937d39
KH
86extern int S_IS_STABD (symbolS *);
87extern const char *S_GET_NAME (symbolS *);
88extern segT S_GET_SEGMENT (symbolS *);
89extern void S_SET_SEGMENT (symbolS *, segT);
90extern void S_SET_EXTERNAL (symbolS *);
977cdf5a 91extern void S_SET_NAME (symbolS *, const char *);
74937d39
KH
92extern void S_CLEAR_EXTERNAL (symbolS *);
93extern void S_SET_WEAK (symbolS *);
94extern void S_SET_THREAD_LOCAL (symbolS *);
252b5132 95
49309057
ILT
96#ifndef WORKING_DOT_WORD
97struct broken_word
98 {
99 /* Linked list -- one of these structures per ".word x-y+C"
100 expression. */
101 struct broken_word *next_broken_word;
102 /* Segment and subsegment for broken word. */
103 segT seg;
104 subsegT subseg;
105 /* Which frag is this broken word in? */
106 fragS *frag;
107 /* Where in the frag is it? */
108 char *word_goes_here;
109 /* Where to add the break. */
110 fragS *dispfrag; /* where to add the break */
111 /* Operands of expression. */
112 symbolS *add;
113 symbolS *sub;
114 offsetT addnum;
115
47eebc20 116 int added; /* nasty thing happened yet? */
49309057
ILT
117 /* 1: added and has a long-jump */
118 /* 2: added but uses someone elses long-jump */
119
120 /* Pointer to broken_word with a similar long-jump. */
121 struct broken_word *use_jump;
122 };
123extern struct broken_word *broken_words;
124#endif /* ndef WORKING_DOT_WORD */
125
126/*
127 * Current means for getting from symbols to segments and vice verse.
128 * This will change for infinite-segments support (e.g. COFF).
129 */
130extern const segT N_TYPE_seg[]; /* subseg.c */
131
132#define SEGMENT_TO_SYMBOL_TYPE(seg) ( seg_N_TYPE [(int) (seg)] )
133extern const short seg_N_TYPE[];/* subseg.c */
134
135#define N_REGISTER 30 /* Fake N_TYPE value for SEG_REGISTER */
136
74937d39 137void symbol_clear_list_pointers (symbolS * symbolP);
49309057 138
74937d39
KH
139void symbol_insert (symbolS * addme, symbolS * target,
140 symbolS ** rootP, symbolS ** lastP);
141void symbol_remove (symbolS * symbolP, symbolS ** rootP,
142 symbolS ** lastP);
49309057 143
74937d39 144extern symbolS *symbol_previous (symbolS *);
49309057 145
74937d39 146void verify_symbol_chain (symbolS * rootP, symbolS * lastP);
74937d39
KH
147
148void symbol_append (symbolS * addme, symbolS * target,
149 symbolS ** rootP, symbolS ** lastP);
150
151extern symbolS *symbol_next (symbolS *);
152
153extern expressionS *symbol_get_value_expression (symbolS *);
154extern void symbol_set_value_expression (symbolS *, const expressionS *);
514d955d 155extern offsetT *symbol_X_add_number (symbolS *);
74937d39
KH
156extern void symbol_set_value_now (symbolS *);
157extern void symbol_set_frag (symbolS *, fragS *);
158extern fragS *symbol_get_frag (symbolS *);
159extern void symbol_mark_used (symbolS *);
160extern void symbol_clear_used (symbolS *);
161extern int symbol_used_p (symbolS *);
162extern void symbol_mark_used_in_reloc (symbolS *);
163extern void symbol_clear_used_in_reloc (symbolS *);
164extern int symbol_used_in_reloc_p (symbolS *);
165extern void symbol_mark_mri_common (symbolS *);
166extern void symbol_clear_mri_common (symbolS *);
167extern int symbol_mri_common_p (symbolS *);
168extern void symbol_mark_written (symbolS *);
169extern void symbol_clear_written (symbolS *);
170extern int symbol_written_p (symbolS *);
171extern void symbol_mark_resolved (symbolS *);
172extern int symbol_resolved_p (symbolS *);
173extern int symbol_section_p (symbolS *);
174extern int symbol_equated_p (symbolS *);
175extern int symbol_equated_reloc_p (symbolS *);
176extern int symbol_constant_p (symbolS *);
74937d39
KH
177extern asymbol *symbol_get_bfdsym (symbolS *);
178extern void symbol_set_bfdsym (symbolS *, asymbol *);
49309057
ILT
179
180#ifdef OBJ_SYMFIELD_TYPE
74937d39
KH
181OBJ_SYMFIELD_TYPE *symbol_get_obj (symbolS *);
182void symbol_set_obj (symbolS *, OBJ_SYMFIELD_TYPE *);
49309057
ILT
183#endif
184
185#ifdef TC_SYMFIELD_TYPE
74937d39
KH
186TC_SYMFIELD_TYPE *symbol_get_tc (symbolS *);
187void symbol_set_tc (symbolS *, TC_SYMFIELD_TYPE *);
49309057 188#endif
This page took 0.284091 seconds and 4 git commands to generate.