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