White space and comment changes, and #ifdef __STDC__ becomes #if
[deliverable/binutils-gdb.git] / gas / write.h
CommitLineData
fecd2382
RP
1/* write.h -> write.c */
2
3/* MODIFIED BY CHRIS BENENATI, FOR INTEL CORPORATION, 4/89 */
4/* write.h -> write.c
5 Copyright (C) 1987 Free Software Foundation, Inc.
a39116f1
RP
6
7 This file is part of GAS, the GNU Assembler.
8
9 GAS is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 GAS is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GAS; see the file COPYING. If not, write to
21 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
fecd2382
RP
22
23#ifndef TC_I960
24#ifdef hpux
25#define EXEC_MACHINE_TYPE HP9000S200_ID
26#endif
27#endif /* TC_I960 */
28
29#ifndef LOCAL_LABEL
30#ifdef DOT_LABEL_PREFIX
31#define LOCAL_LABEL(name) (name[0] =='.' \
a39116f1 32 && ( name [1] == 'L' || name [1] == '.' ))
fecd2382
RP
33#else /* not defined DOT_LABEL_PREFIX */
34#define LOCAL_LABEL(name) (name [0] == 'L' )
35#endif /* not defined DOT_LABEL_PREFIX */
36#endif /* LOCAL_LABEL */
37
38#define S_LOCAL_NAME(s) (LOCAL_LABEL(S_GET_NAME(s)))
39
40/* The bit_fix was implemented to support machines that need variables
41 to be inserted in bitfields other than 1, 2 and 4 bytes.
42 Furthermore it gives us a possibillity to mask in bits in the symbol
43 when it's fixed in the objectcode and check the symbols limits.
a39116f1 44
fecd2382
RP
45 The or-mask is used to set the huffman bits in displacements for the
46 ns32k port.
47 The acbi, addqi, movqi, cmpqi instruction requires an assembler that
48 can handle bitfields. Ie handle an expression, evaluate it and insert
49 the result in an some bitfield. ( ex: 5 bits in a short field of a opcode)
a39116f1 50 */
fecd2382
RP
51
52struct bit_fix {
a39116f1
RP
53 int fx_bit_size; /* Length of bitfield */
54 int fx_bit_offset; /* Bit offset to bitfield */
55 long fx_bit_base; /* Where do we apply the bitfix.
56 If this is zero, default is assumed. */
57 long fx_bit_base_adj;/* Adjustment of base */
58 long fx_bit_max; /* Signextended max for bitfield */
59 long fx_bit_min; /* Signextended min for bitfield */
60 long fx_bit_add; /* Or mask, used for huffman prefix */
fecd2382
RP
61};
62typedef struct bit_fix bit_fixS;
63/*
64 * FixSs may be built up in any order.
65 */
66
a39116f1
RP
67struct fix {
68 fragS *fx_frag; /* Which frag? */
69 long fx_where; /* Where is the 1st byte to fix up? */
70 symbolS *fx_addsy; /* NULL or Symbol whose value we add in. */
71 symbolS *fx_subsy; /* NULL or Symbol whose value we subtract. */
72 long fx_offset; /* Absolute number we add in. */
73 struct fix *fx_next; /* NULL or -> next fixS. */
74 short int fx_size; /* How many bytes are involved? */
75 char fx_pcrel; /* TRUE: pc-relative. */
76 char fx_pcrel_adjust;/* pc-relative offset adjust */
77 char fx_im_disp; /* TRUE: value is a displacement */
78 bit_fixS *fx_bit_fixP; /* IF NULL no bitfix's to do */
79 char fx_bsr; /* sequent-hack */
80 enum reloc_type fx_r_type; /* Sparc hacks */
81 char fx_callj; /* TRUE if target is a 'callj'
82 (used by i960) */
83 long fx_addnumber;
fecd2382
RP
84};
85
a39116f1 86typedef struct fix fixS;
fecd2382
RP
87
88COMMON char *next_object_file_charP;
89
a39116f1 90#ifndef MANY_SEGMENTS
fecd2382
RP
91COMMON fixS *text_fix_root, *text_fix_tail; /* Chains fixSs. */
92COMMON fixS *data_fix_root, *data_fix_tail; /* Chains fixSs. */
a39116f1 93#endif
fecd2382
RP
94COMMON fixS **seg_fix_rootP, **seg_fix_tailP; /* -> one of above. */
95extern long string_byte_count;
96extern int section_alignment[];
97
98#ifdef __STDC__
99
100bit_fixS *bit_fix_new(char size, char offset, long base_type, long base_adj, long min, long max, long add);
101void append(char **charPP, char *fromP, unsigned long length);
102void record_alignment(segT seg, int align);
103void write_object_file(void);
104
105fixS *fix_new(fragS *frag,
106 int where,
107 int size,
108 symbolS *add_symbol,
109 symbolS *sub_symbol,
110 long offset,
111 int pcrel,
112 enum reloc_type r_type);
113
114#else
115
116bit_fixS *bit_fix_new();
117fixS *fix_new();
118void append();
119void record_alignment();
120void write_object_file();
121
122#endif /* __STDC__ */
123
124/*
125 * Local Variables:
126 * comment-column: 0
127 * fill-column: 131
128 * End:
129 */
130
131/* end of write.h */
This page took 0.047909 seconds and 4 git commands to generate.