Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / gnu / usr.bin / as / subsegs.h
1 /* subsegs.h -> subsegs.c
2
3    Copyright (C) 1987, 1992 Free Software Foundation, Inc.
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
19    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20 /*
21  * $FreeBSD: src/gnu/usr.bin/as/subsegs.h,v 1.6 1999/08/27 23:34:22 peter Exp $
22  * $DragonFly: src/gnu/usr.bin/as/Attic/subsegs.h,v 1.2 2003/06/17 04:25:44 dillon Exp $
23  */
24
25
26 /*
27  * For every sub-segment the user mentions in the ASsembler program,
28  * we make one struct frchain. Each sub-segment has exactly one struct frchain
29  * and vice versa.
30  *
31  * Struct frchain's are forward chained (in ascending order of sub-segment
32  * code number). The chain runs through frch_next of each subsegment.
33  * This makes it hard to find a subsegment's frags
34  * if programmer uses a lot of them. Most programs only use text0 and
35  * data0, so they don't suffer. At least this way:
36  * (1)  There are no "arbitrary" restrictions on how many subsegments
37  *      can be programmed;
38  * (2)  Subsegments' frchain-s are (later) chained together in the order in
39  *      which they are emitted for object file viz text then data.
40  *
41  * From each struct frchain dangles a chain of struct frags. The frags
42  * represent code fragments, for that sub-segment, forward chained.
43  */
44
45 struct frchain                  /* control building of a frag chain */
46 {                               /* FRCH = FRagment CHain control */
47         struct frag *   frch_root;      /* 1st struct frag in chain, or NULL */
48         struct frag *   frch_last;      /* last struct frag in chain, or NULL */
49         struct frchain * frch_next;     /* next in chain of struct frchain-s */
50         segT            frch_seg;       /* SEG_TEXT or SEG_DATA. */
51         subsegT frch_subseg;    /* subsegment number of this chain */
52 };
53
54 typedef struct frchain frchainS;
55
56 extern frchainS * frchain_root; /* NULL means no frchains yet. */
57 /* all subsegments' chains hang off here */
58
59 extern frchainS * frchain_now;
60 /* Frchain we are assembling into now */
61 /* That is, the current segment's frag */
62 /* chain, even if it contains no (complete) */
63 /* frags. */
64
65
66 #ifdef MANY_SEGMENTS
67 typedef struct
68 {
69         frchainS *frchainP;
70         int hadone;
71         int user_stuff;
72         /*  struct frag *frag_root;*/
73         /*  struct frag *last_frag;*/
74         fixS *fix_root;
75         fixS *fix_tail;
76         struct internal_scnhdr scnhdr;
77         symbolS *dot;
78
79         struct lineno_list *lineno_list_head;
80         struct lineno_list *lineno_list_tail;
81
82 } segment_info_type;
83 segment_info_type segment_info[];
84 #else
85 extern frchainS * data0_frchainP;
86 extern frchainS * bss0_frchainP;
87 /* Sentinel for frchain crawling. */
88 /* Points to the 1st data-segment frchain. */
89 /* (Which is pointed to by the last text- */
90 /* segment frchain.) */
91
92 #endif
93
94 /* end of subsegs.h */