1 /* subsegs.h -> subsegs.c
2 Copyright (C) 1987 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 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. */
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
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
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.
35 * From each struct frchain dangles a chain of struct frags. The frags
36 * represent code fragments, for that sub-segment, forward chained.
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 */
48 typedef struct frchain frchainS;
50 extern frchainS * frchain_root; /* NULL means no frchains yet. */
51 /* all subsegments' chains hang off here */
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) */
66 /* struct frag *frag_root;*/
67 /* struct frag *last_frag;*/
70 struct internal_scnhdr scnhdr;
73 struct lineno_list *lineno_list_head;
74 struct lineno_list *lineno_list_tail;
77 segment_info_type segment_info[];
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.) */