* nm-hp300bsd.h (PTRACE_ARG3_TYPE): FSF's hp300's have int* not caddr_t.
[deliverable/binutils-gdb.git] / gas / struc-symbol.h
CommitLineData
fecd2382 1/* struct_symbol.h - Internal symbol structure
3340f7e5 2 Copyright (C) 1987, 1992 Free Software Foundation, Inc.
6efd877d 3
a39116f1 4 This file is part of GAS, the GNU Assembler.
6efd877d 5
a39116f1
RP
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.
6efd877d 10
a39116f1
RP
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.
6efd877d 15
a39116f1
RP
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. */
fecd2382 19
6efd877d
KR
20#ifndef __struc_symbol_h__
21#define __struc_symbol_h__
22
fecd2382
RP
23struct symbol /* our version of an nlist node */
24{
6efd877d
KR
25 obj_symbol_type sy_symbol; /* what we write in .o file (if permitted) */
26 unsigned long sy_name_offset; /* 4-origin position of sy_name in symbols */
27 /* part of object file. */
28 /* 0 for (nameless) .stabd symbols. */
29 /* Not used until write_object_file() time. */
30 long sy_number; /* 24 bit symbol number. */
31 /* Symbol numbers start at 0 and are */
32 /* unsigned. */
33 struct symbol *sy_next; /* forward chain, or NULL */
fecd2382 34#ifdef SYMBOLS_NEED_BACKPOINTERS
6efd877d 35 struct symbol *sy_previous; /* backward chain, or NULL */
fecd2382 36#endif /* SYMBOLS_NEED_BACKPOINTERS */
6efd877d
KR
37 struct frag *sy_frag; /* NULL or -> frag this symbol attaches to. */
38 struct symbol *sy_forward; /* value is really that of this other symbol */
39 /* We will probably want to add a sy_segment here soon. */
fecd2382
RP
40};
41
42typedef struct symbol symbolS;
43
44typedef unsigned valueT; /* The type of n_value. Helps casting. */
45
46#ifndef WORKING_DOT_WORD
6efd877d
KR
47struct broken_word
48 {
49 struct broken_word *next_broken_word; /* One of these strucs per .word x-y */
50 fragS *frag; /* Which frag its in */
51 char *word_goes_here; /* Where in the frag it is */
52 fragS *dispfrag; /* where to add the break */
53 symbolS *add; /* symbol_x */
54 symbolS *sub; /* - symbol_y */
55 long addnum; /* + addnum */
56 int added; /* nasty thing happend yet? */
57 /* 1: added and has a long-jump */
58 /* 2: added but uses someone elses long-jump */
59 struct broken_word *use_jump; /* points to broken_word with a similar
fecd2382 60 long-jump */
6efd877d 61 };
fecd2382
RP
62extern struct broken_word *broken_words;
63#endif /* ndef WORKING_DOT_WORD */
64
65/*
66 * Current means for getting from symbols to segments and vice verse.
67 * This will change for infinite-segments support (e.g. COFF).
68 */
69/* #define SYMBOL_TYPE_TO_SEGMENT(symP) ( N_TYPE_seg [(int) (symP)->sy_type & N_TYPE] ) */
6efd877d 70extern segT N_TYPE_seg[]; /* subseg.c */
fecd2382
RP
71
72#define SEGMENT_TO_SYMBOL_TYPE(seg) ( seg_N_TYPE [(int) (seg)] )
6efd877d 73extern const short seg_N_TYPE[];/* subseg.c */
fecd2382
RP
74
75#define N_REGISTER 30 /* Fake N_TYPE value for SEG_REGISTER */
76
77#ifdef SYMBOLS_NEED_BACKPOINTERS
3340f7e5 78#if __STDC__ == 1
fecd2382 79
6efd877d
KR
80void symbol_clear_list_pointers (symbolS * symbolP);
81void symbol_insert (symbolS * addme, symbolS * target, symbolS ** rootP, symbolS ** lastP);
82void symbol_remove (symbolS * symbolP, symbolS ** rootP, symbolS ** lastP);
83void verify_symbol_chain (symbolS * rootP, symbolS * lastP);
fecd2382 84
3340f7e5 85#else /* not __STDC__ */
fecd2382 86
6efd877d
KR
87void symbol_clear_list_pointers ();
88void symbol_insert ();
89void symbol_remove ();
90void verify_symbol_chain ();
fecd2382 91
3340f7e5 92#endif /* not __STDC__ */
fecd2382
RP
93
94#define symbol_previous(s) ((s)->sy_previous)
95
96#else /* SYMBOLS_NEED_BACKPOINTERS */
97
98#define symbol_clear_list_pointers(clearme) {clearme->sy_next = NULL;}
99
100#endif /* SYMBOLS_NEED_BACKPOINTERS */
101
3340f7e5 102#if __STDC__ == 1
6efd877d 103void symbol_append (symbolS * addme, symbolS * target, symbolS ** rootP, symbolS ** lastP);
3340f7e5 104#else /* not __STDC__ */
6efd877d 105void symbol_append ();
3340f7e5 106#endif /* not __STDC__ */
fecd2382
RP
107
108#define symbol_next(s) ((s)->sy_next)
109
6efd877d
KR
110#endif /* __struc_symbol_h__ */
111
fecd2382
RP
112/*
113 * Local Variables:
114 * comment-column: 0
115 * fill-column: 131
116 * End:
117 */
118
119/* end of struc-symbol.h */
This page took 0.069173 seconds and 4 git commands to generate.