1 /* struct_symbol.h - Internal symbol structure
2 Copyright (C) 1987, 1992 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler.
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 oYou should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 * $FreeBSD: src/gnu/usr.bin/as/struc-symbol.h,v 1.9 1999/08/27 23:34:21 peter Exp $
24 #ifndef __struc_symbol_h__
25 #define __struc_symbol_h__
27 struct symbol /* our version of an nlist node */
29 obj_symbol_type sy_symbol; /* what we write in .o file (if permitted) */
30 unsigned long sy_name_offset; /* 4-origin position of sy_name in symbols */
31 /* part of object file. */
32 /* 0 for (nameless) .stabd symbols. */
33 /* Not used until write_object_file() time. */
34 long sy_number; /* 24 bit symbol number. */
35 /* Symbol numbers start at 0 and are */
37 struct symbol *sy_next; /* forward chain, or NULL */
38 #ifdef SYMBOLS_NEED_BACKPOINTERS
39 struct symbol *sy_previous; /* backward chain, or NULL */
40 #endif /* SYMBOLS_NEED_BACKPOINTERS */
41 struct frag *sy_frag; /* NULL or -> frag this symbol attaches to. */
42 struct symbol *sy_forward; /* value is really that of this other symbol */
43 /* We will probably want to add a sy_segment here soon. */
46 /* Force symbol into symbol table, even if local */
49 /* Size of symbol as given by the .size directive */
50 void *sy_sizexp; /* (expressionS *) */
52 /* Auxiliary type information as given by the .type directive */
56 unsigned char sy_bind;
57 #define BIND_LOCAL 0 /* currently not used */
58 #define BIND_GLOBAL 1 /* currently not used */
62 typedef struct symbol symbolS;
65 symbolS *GOT_symbol; /* Pre-defined "__GLOBAL_OFFSET_TABLE" */
69 typedef unsigned valueT; /* The type of n_value. Helps casting. */
71 #ifndef WORKING_DOT_WORD
73 struct broken_word *next_broken_word;/* One of these strucs per .word x-y */
74 fragS *frag; /* Which frag its in */
75 char *word_goes_here;/* Where in the frag it is */
76 fragS *dispfrag; /* where to add the break */
77 symbolS *add; /* symbol_x */
78 symbolS *sub; /* - symbol_y */
79 long addnum; /* + addnum */
80 int added; /* nasty thing happend yet? */
81 /* 1: added and has a long-jump */
82 /* 2: added but uses someone elses long-jump */
83 struct broken_word *use_jump; /* points to broken_word with a similar
86 extern struct broken_word *broken_words;
87 #endif /* ndef WORKING_DOT_WORD */
89 #define SEGMENT_TO_SYMBOL_TYPE(seg) (seg_N_TYPE[(int) (seg)])
90 extern const short seg_N_TYPE[]; /* subseg.c */
92 #ifdef SYMBOLS_NEED_BACKPOINTERS
95 void symbol_clear_list_pointers(symbolS *symbolP);
96 void symbol_insert(symbolS *addme, symbolS *target, symbolS **rootP, symbolS **lastP);
97 void symbol_remove(symbolS *symbolP, symbolS **rootP, symbolS **lastP);
98 void verify_symbol_chain(symbolS *rootP, symbolS *lastP);
100 #else /* not __STDC__ */
102 void symbol_clear_list_pointers();
103 void symbol_insert();
104 void symbol_remove();
105 void verify_symbol_chain();
107 #endif /* not __STDC__ */
109 #define symbol_previous(s) ((s)->sy_previous)
111 #else /* SYMBOLS_NEED_BACKPOINTERS */
113 #define symbol_clear_list_pointers(clearme) {clearme->sy_next = NULL;}
115 #endif /* SYMBOLS_NEED_BACKPOINTERS */
118 void symbol_append(symbolS *addme, symbolS *target, symbolS **rootP, symbolS **lastP);
119 #else /* not __STDC__ */
120 void symbol_append();
121 #endif /* not __STDC__ */
123 #define symbol_next(s) ((s)->sy_next)
125 #endif /* __struc_symbol_h__ */
134 /* end of struc-symbol.h */