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 $
22 * $DragonFly: src/gnu/usr.bin/as/Attic/subsegs.h,v 1.2 2003/06/17 04:25:44 dillon Exp $
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
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
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.
41 * From each struct frchain dangles a chain of struct frags. The frags
42 * represent code fragments, for that sub-segment, forward chained.
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 */
54 typedef struct frchain frchainS;
56 extern frchainS * frchain_root; /* NULL means no frchains yet. */
57 /* all subsegments' chains hang off here */
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) */
72 /* struct frag *frag_root;*/
73 /* struct frag *last_frag;*/
76 struct internal_scnhdr scnhdr;
79 struct lineno_list *lineno_list_head;
80 struct lineno_list *lineno_list_tail;
83 segment_info_type segment_info[];
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.) */
94 /* end of subsegs.h */