]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gas/write.h
White space and comment changes. #ifdef __STDC__ becomes #if __STDC__
[thirdparty/binutils-gdb.git] / gas / write.h
1 /* write.h
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 #ifndef TC_I960
22 #ifdef hpux
23 #define EXEC_MACHINE_TYPE HP9000S200_ID
24 #endif
25 #endif /* TC_I960 */
26
27 #ifndef LOCAL_LABEL
28 #ifdef DOT_LABEL_PREFIX
29 #define LOCAL_LABEL(name) (name[0] =='.' \
30 && ( name [1] == 'L' || name [1] == '.' ))
31 #else /* not defined DOT_LABEL_PREFIX */
32 #define LOCAL_LABEL(name) (name [0] == 'L' )
33 #endif /* not defined DOT_LABEL_PREFIX */
34 #endif /* LOCAL_LABEL */
35
36 #define S_LOCAL_NAME(s) (LOCAL_LABEL(S_GET_NAME(s)))
37
38 /* The bit_fix was implemented to support machines that need variables
39 to be inserted in bitfields other than 1, 2 and 4 bytes.
40 Furthermore it gives us a possibillity to mask in bits in the symbol
41 when it's fixed in the objectcode and check the symbols limits.
42
43 The or-mask is used to set the huffman bits in displacements for the
44 ns32k port.
45 The acbi, addqi, movqi, cmpqi instruction requires an assembler that
46 can handle bitfields. Ie handle an expression, evaluate it and insert
47 the result in an some bitfield. ( ex: 5 bits in a short field of a opcode)
48 */
49
50 struct bit_fix {
51 int fx_bit_size; /* Length of bitfield */
52 int fx_bit_offset; /* Bit offset to bitfield */
53 long fx_bit_base; /* Where do we apply the bitfix.
54 If this is zero, default is assumed. */
55 long fx_bit_base_adj;/* Adjustment of base */
56 long fx_bit_max; /* Signextended max for bitfield */
57 long fx_bit_min; /* Signextended min for bitfield */
58 long fx_bit_add; /* Or mask, used for huffman prefix */
59 };
60 typedef struct bit_fix bit_fixS;
61 /*
62 * FixSs may be built up in any order.
63 */
64
65 struct fix {
66 fragS *fx_frag; /* Which frag? */
67 long fx_where; /* Where is the 1st byte to fix up? */
68 symbolS *fx_addsy; /* NULL or Symbol whose value we add in. */
69 symbolS *fx_subsy; /* NULL or Symbol whose value we subtract. */
70 long fx_offset; /* Absolute number we add in. */
71 struct fix *fx_next; /* NULL or -> next fixS. */
72 short int fx_size; /* How many bytes are involved? */
73 char fx_pcrel; /* TRUE: pc-relative. */
74 char fx_pcrel_adjust;/* pc-relative offset adjust */
75 char fx_im_disp; /* TRUE: value is a displacement */
76 bit_fixS *fx_bit_fixP; /* IF NULL no bitfix's to do */
77 char fx_bsr; /* sequent-hack */
78 enum reloc_type fx_r_type; /* Sparc hacks */
79 char fx_callj; /* TRUE if target is a 'callj'
80 (used by i960) */
81 long fx_addnumber;
82 };
83
84 typedef struct fix fixS;
85
86 COMMON char *next_object_file_charP;
87
88 #ifndef MANY_SEGMENTS
89 COMMON fixS *text_fix_root, *text_fix_tail; /* Chains fixSs. */
90 COMMON fixS *data_fix_root, *data_fix_tail; /* Chains fixSs. */
91 #endif
92 COMMON fixS **seg_fix_rootP, **seg_fix_tailP; /* -> one of above. */
93 extern long string_byte_count;
94 extern int section_alignment[];
95
96 #if __STDC__ == 1
97
98 bit_fixS *bit_fix_new(char size, char offset, long base_type, long base_adj, long min, long max, long add);
99 void append(char **charPP, char *fromP, unsigned long length);
100 void record_alignment(segT seg, int align);
101 void write_object_file(void);
102
103 fixS *fix_new(fragS *frag,
104 int where,
105 int size,
106 symbolS *add_symbol,
107 symbolS *sub_symbol,
108 long offset,
109 int pcrel,
110 enum reloc_type r_type);
111
112 #else /* not __STDC__ */
113
114 bit_fixS *bit_fix_new();
115 fixS *fix_new();
116 void append();
117 void record_alignment();
118 void write_object_file();
119
120 #endif /* not __STDC__ */
121
122 /*
123 * Local Variables:
124 * comment-column: 0
125 * fill-column: 131
126 * End:
127 */
128
129 /* end of write.h */