]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/svr3gas.h
hooks.c (hook_tree_bool_false): New.
[thirdparty/gcc.git] / gcc / config / i386 / svr3gas.h
1 /* Definitions for Intel 386 running system V, using gas.
2 Copyright (C) 1992, 1996, 2000, 2002 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC 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)
9 any later version.
10
11 GNU CC 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.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #define TARGET_VERSION fprintf (stderr, " (80386, ATT syntax)");
22
23 /* Add stuff that normally comes from i386/sysv3.h */
24
25 /* longjmp may fail to restore the registers if called from the same
26 function that called setjmp. To compensate, the compiler avoids
27 putting variables in registers in functions that use both setjmp
28 and longjmp. */
29
30 #define NON_SAVING_SETJMP \
31 (current_function_calls_setjmp && current_function_calls_longjmp)
32
33 /* longjmp may fail to restore the stack pointer if the saved frame
34 pointer is the same as the caller's frame pointer. Requiring a frame
35 pointer in any function that calls setjmp or longjmp avoids this
36 problem, unless setjmp and longjmp are called from the same function.
37 Since a frame pointer will be required in such a function, it is OK
38 that the stack pointer is not restored. */
39
40 #undef SUBTARGET_FRAME_POINTER_REQUIRED
41 #define SUBTARGET_FRAME_POINTER_REQUIRED \
42 (current_function_calls_setjmp || current_function_calls_longjmp)
43
44 /* Modify ASM_OUTPUT_LOCAL slightly to test -msvr3-shlib, adapted to gas */
45 #undef ASM_OUTPUT_LOCAL
46 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
47 do { \
48 int align = exact_log2 (ROUNDED); \
49 if (align > 2) align = 2; \
50 if (TARGET_SVR3_SHLIB) \
51 { \
52 data_section (); \
53 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
54 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
55 fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED)); \
56 } \
57 else \
58 { \
59 fputs (".lcomm ", (FILE)); \
60 assemble_name ((FILE), (NAME)); \
61 fprintf ((FILE), ",%u\n", (ROUNDED)); \
62 } \
63 } while (0)
64
65 /* Add stuff that normally comes from i386/sysv3.h via svr3.h */
66
67 /* Define the actual types of some ANSI-mandated types. These
68 definitions should work for most SVR3 systems. */
69
70 #undef SIZE_TYPE
71 #define SIZE_TYPE "unsigned int"
72
73 #undef PTRDIFF_TYPE
74 #define PTRDIFF_TYPE "int"
75
76 #undef WCHAR_TYPE
77 #define WCHAR_TYPE "long int"
78
79 #undef WCHAR_TYPE_SIZE
80 #define WCHAR_TYPE_SIZE BITS_PER_WORD
81 \f
82 /* ??? This stuff is copied from config/svr3.h. In the future,
83 this file should be rewritten to include config/svr3.h
84 and override what isn't right. */
85
86 /* Support const sections and the ctors and dtors sections for g++. */
87
88 #define USE_CONST_SECTION 0
89
90 #define INIT_SECTION_ASM_OP "\t.section\t.init"
91 #define FINI_SECTION_ASM_OP "\t.section .fini,\"x\""
92 #define CONST_SECTION_ASM_OP "\t.section\t.rodata, \"x\""
93 #define CTORS_SECTION_ASM_OP INIT_SECTION_ASM_OP
94 #define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP
95
96 /* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
97 because they push on the stack. */
98 /* This is copied from i386/sysv3.h. */
99
100 #define CTOR_LIST_BEGIN \
101 asm (INIT_SECTION_ASM_OP); \
102 asm ("pushl $0")
103 #define CTOR_LIST_END CTOR_LIST_BEGIN
104
105 /* Constructor list on stack is in reverse order. Go to the end of the
106 list and go backwards to call constructors in the right order. */
107 #define DO_GLOBAL_CTORS_BODY \
108 do { \
109 func_ptr *p, *beg = alloca (0); \
110 for (p = beg; *p; p++) \
111 ; \
112 while (p != beg) \
113 (*--p) (); \
114 } while (0)
115
116 /* Add extra sections .rodata, .init and .fini. */
117
118 #undef EXTRA_SECTIONS
119 #define EXTRA_SECTIONS in_const, in_init, in_fini
120
121 #undef EXTRA_SECTION_FUNCTIONS
122 #define EXTRA_SECTION_FUNCTIONS \
123 CONST_SECTION_FUNCTION \
124 INIT_SECTION_FUNCTION \
125 FINI_SECTION_FUNCTION
126
127 #define INIT_SECTION_FUNCTION \
128 void \
129 init_section () \
130 { \
131 if (in_section != in_init) \
132 { \
133 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
134 in_section = in_init; \
135 } \
136 }
137
138 #define FINI_SECTION_FUNCTION \
139 void \
140 fini_section () \
141 { \
142 if (in_section != in_fini) \
143 { \
144 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
145 in_section = in_fini; \
146 } \
147 }
148
149 #define READONLY_DATA_SECTION() const_section ()
150
151 #define CONST_SECTION_FUNCTION \
152 void \
153 const_section () \
154 { \
155 if (!USE_CONST_SECTION) \
156 text_section(); \
157 else if (in_section != in_const) \
158 { \
159 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
160 in_section = in_const; \
161 } \
162 }
163
164 #define TARGET_ASM_CONSTRUCTOR ix86_svr3_asm_out_constructor
165
166 /* A C statement or statements to switch to the appropriate
167 section for output of RTX in mode MODE. RTX is some kind
168 of constant in RTL. The argument MODE is redundant except
169 in the case of a `const_int' rtx. Currently, these always
170 go into the const section. */
171
172 #define SELECT_RTX_SECTION(MODE,RTX,ALIGN) const_section()