Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[games.git] / gnu / usr.bin / as / struc-symbol.h
1 /* struct_symbol.h - Internal symbol structure
2    Copyright (C) 1987, 1992 Free Software Foundation, Inc.
3
4    This file is part of GAS, the GNU Assembler.
5
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)
9    any later version.
10
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.
15
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.  */
19 /*
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 $
22  */
23
24
25 #ifndef __struc_symbol_h__
26 #define __struc_symbol_h__
27
28 struct symbol                   /* our version of an nlist node */
29 {
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 */
37         /* unsigned. */
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. */
45
46 #ifdef PIC
47         /* Force symbol into symbol table, even if local */
48         int     sy_forceout;
49 #endif
50         /* Size of symbol as given by the .size directive */
51         void    *sy_sizexp;     /* (expressionS *) */
52
53         /* Auxiliary type information as given by the .type directive */
54         unsigned char   sy_aux;
55 #define AUX_OBJECT      1
56 #define AUX_FUNC        2
57         unsigned char   sy_bind;
58 #define BIND_LOCAL      0       /* currently not used */
59 #define BIND_GLOBAL     1       /* currently not used */
60 #define BIND_WEAK       2
61 };
62
63 typedef struct symbol symbolS;
64
65 #ifdef PIC
66 symbolS *GOT_symbol;            /* Pre-defined "__GLOBAL_OFFSET_TABLE" */
67 int     got_referenced;
68 #endif
69
70 typedef unsigned valueT;        /* The type of n_value. Helps casting. */
71
72 #ifndef WORKING_DOT_WORD
73 struct broken_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
85                                          long-jump */
86 };
87 extern struct broken_word *broken_words;
88 #endif /* ndef WORKING_DOT_WORD */
89
90 #define SEGMENT_TO_SYMBOL_TYPE(seg)  (seg_N_TYPE[(int) (seg)])
91 extern const short seg_N_TYPE[]; /* subseg.c */
92
93 #ifdef SYMBOLS_NEED_BACKPOINTERS
94 #if __STDC__ == 1
95
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);
100
101 #else /* not __STDC__ */
102
103 void symbol_clear_list_pointers();
104 void symbol_insert();
105 void symbol_remove();
106 void verify_symbol_chain();
107
108 #endif /* not __STDC__ */
109
110 #define symbol_previous(s) ((s)->sy_previous)
111
112 #else /* SYMBOLS_NEED_BACKPOINTERS */
113
114 #define symbol_clear_list_pointers(clearme) {clearme->sy_next = NULL;}
115
116 #endif /* SYMBOLS_NEED_BACKPOINTERS */
117
118 #if __STDC__ == 1
119 void symbol_append(symbolS *addme, symbolS *target, symbolS **rootP, symbolS **lastP);
120 #else /* not __STDC__ */
121 void symbol_append();
122 #endif /* not __STDC__ */
123
124 #define symbol_next(s)  ((s)->sy_next)
125
126 #endif /* __struc_symbol_h__ */
127
128 /*
129  * Local Variables:
130  * comment-column: 0
131  * fill-column: 131
132  * End:
133  */
134
135 /* end of struc-symbol.h */