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 $
21 * $DragonFly: src/gnu/usr.bin/as/Attic/struc-symbol.h,v 1.2 2003/06/17 04:25:44 dillon Exp $
25 #ifndef __struc_symbol_h__
26 #define __struc_symbol_h__
28 struct symbol /* our version of an nlist node */
30 obj_symbol_type sy_symbol; /* what we write in .o file (if permitted) */
31 unsigned long sy_name_offset; /* 4-origin position of sy_name in symbols */
32 /* part of object file. */
33 /* 0 for (nameless) .stabd symbols. */
34 /* Not used until write_object_file() time. */
35 long sy_number; /* 24 bit symbol number. */
36 /* Symbol numbers start at 0 and are */
38 struct symbol *sy_next; /* forward chain, or NULL */
39 #ifdef SYMBOLS_NEED_BACKPOINTERS
40 struct symbol *sy_previous; /* backward chain, or NULL */
41 #endif /* SYMBOLS_NEED_BACKPOINTERS */
42 struct frag *sy_frag; /* NULL or -> frag this symbol attaches to. */
43 struct symbol *sy_forward; /* value is really that of this other symbol */
44 /* We will probably want to add a sy_segment here soon. */
47 /* Force symbol into symbol table, even if local */
50 /* Size of symbol as given by the .size directive */
51 void *sy_sizexp; /* (expressionS *) */
53 /* Auxiliary type information as given by the .type directive */
57 unsigned char sy_bind;
58 #define BIND_LOCAL 0 /* currently not used */
59 #define BIND_GLOBAL 1 /* currently not used */
63 typedef struct symbol symbolS;
66 symbolS *GOT_symbol; /* Pre-defined "__GLOBAL_OFFSET_TABLE" */
70 typedef unsigned valueT; /* The type of n_value. Helps casting. */
72 #ifndef WORKING_DOT_WORD
74 struct broken_word *next_broken_word;/* One of these strucs per .word x-y */
75 fragS *frag; /* Which frag its in */
76 char *word_goes_here;/* Where in the frag it is */
77 fragS *dispfrag; /* where to add the break */
78 symbolS *add; /* symbol_x */
79 symbolS *sub; /* - symbol_y */
80 long addnum; /* + addnum */
81 int added; /* nasty thing happend yet? */
82 /* 1: added and has a long-jump */
83 /* 2: added but uses someone elses long-jump */
84 struct broken_word *use_jump; /* points to broken_word with a similar
87 extern struct broken_word *broken_words;
88 #endif /* ndef WORKING_DOT_WORD */
90 #define SEGMENT_TO_SYMBOL_TYPE(seg) (seg_N_TYPE[(int) (seg)])
91 extern const short seg_N_TYPE[]; /* subseg.c */
93 #ifdef SYMBOLS_NEED_BACKPOINTERS
96 void symbol_clear_list_pointers(symbolS *symbolP);
97 void symbol_insert(symbolS *addme, symbolS *target, symbolS **rootP, symbolS **lastP);
98 void symbol_remove(symbolS *symbolP, symbolS **rootP, symbolS **lastP);
99 void verify_symbol_chain(symbolS *rootP, symbolS *lastP);
101 #else /* not __STDC__ */
103 void symbol_clear_list_pointers();
104 void symbol_insert();
105 void symbol_remove();
106 void verify_symbol_chain();
108 #endif /* not __STDC__ */
110 #define symbol_previous(s) ((s)->sy_previous)
112 #else /* SYMBOLS_NEED_BACKPOINTERS */
114 #define symbol_clear_list_pointers(clearme) {clearme->sy_next = NULL;}
116 #endif /* SYMBOLS_NEED_BACKPOINTERS */
119 void symbol_append(symbolS *addme, symbolS *target, symbolS **rootP, symbolS **lastP);
120 #else /* not __STDC__ */
121 void symbol_append();
122 #endif /* not __STDC__ */
124 #define symbol_next(s) ((s)->sy_next)
126 #endif /* __struc_symbol_h__ */
135 /* end of struc-symbol.h */