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