1 /* subsegs.h -> subsegs.c
3 Copyright (C) 1987, 1992 Free Software Foundation, Inc.
5 This file is part of GAS, the GNU Assembler.
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)
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.
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. */
21 * $FreeBSD: src/gnu/usr.bin/as/subsegs.h,v 1.6 1999/08/27 23:34:22 peter Exp $
26 * For every sub-segment the user mentions in the ASsembler program,
27 * we make one struct frchain. Each sub-segment has exactly one struct frchain
30 * Struct frchain's are forward chained (in ascending order of sub-segment
31 * code number). The chain runs through frch_next of each subsegment.
32 * This makes it hard to find a subsegment's frags
33 * if programmer uses a lot of them. Most programs only use text0 and
34 * data0, so they don't suffer. At least this way:
35 * (1) There are no "arbitrary" restrictions on how many subsegments
37 * (2) Subsegments' frchain-s are (later) chained together in the order in
38 * which they are emitted for object file viz text then data.
40 * From each struct frchain dangles a chain of struct frags. The frags
41 * represent code fragments, for that sub-segment, forward chained.
44 struct frchain /* control building of a frag chain */
45 { /* FRCH = FRagment CHain control */
46 struct frag * frch_root; /* 1st struct frag in chain, or NULL */
47 struct frag * frch_last; /* last struct frag in chain, or NULL */
48 struct frchain * frch_next; /* next in chain of struct frchain-s */
49 segT frch_seg; /* SEG_TEXT or SEG_DATA. */
50 subsegT frch_subseg; /* subsegment number of this chain */
53 typedef struct frchain frchainS;
55 extern frchainS * frchain_root; /* NULL means no frchains yet. */
56 /* all subsegments' chains hang off here */
58 extern frchainS * frchain_now;
59 /* Frchain we are assembling into now */
60 /* That is, the current segment's frag */
61 /* chain, even if it contains no (complete) */
71 /* struct frag *frag_root;*/
72 /* struct frag *last_frag;*/
75 struct internal_scnhdr scnhdr;
78 struct lineno_list *lineno_list_head;
79 struct lineno_list *lineno_list_tail;
82 segment_info_type segment_info[];
84 extern frchainS * data0_frchainP;
85 extern frchainS * bss0_frchainP;
86 /* Sentinel for frchain crawling. */
87 /* Points to the 1st data-segment frchain. */
88 /* (Which is pointed to by the last text- */
89 /* segment frchain.) */
93 /* end of subsegs.h */