]> gcc.gnu.org Git - gcc.git/blame - gcc/config/i386/osfrose.h
i386.h (CPP_486_SPEC, [...]): New specs.
[gcc.git] / gcc / config / i386 / osfrose.h
CommitLineData
82bb2b59 1/* Definitions of target machine for GNU compiler.
cafb44ca 2 Intel 386 (OSF/1 with OSF/rose) version.
7d4ea832 3 Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
1d21dbd3
MM
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
97aadbb9
RK
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
1d21dbd3 21
c623ad33 22#include "halfpic.h"
ae9a9530 23#include "i386/gstabs.h"
1d21dbd3 24
60c9835e
JVA
25/* Get perform_* macros to build libgcc.a. */
26#include "i386/perform.h"
27
1d21dbd3
MM
28#define OSF_OS
29
bec06bb2
MM
30#undef WORD_SWITCH_TAKES_ARG
31#define WORD_SWITCH_TAKES_ARG(STR) \
3b39b94f 32 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) || !strcmp (STR, "pic-names"))
1d21dbd3 33
cc8187fc
MM
34/* This defines which switch letters take arguments. On svr4, most of
35 the normal cases (defined in gcc.c) apply, and we also have -h* and
36 -z* options (for the linker). */
37
38#define SWITCH_TAKES_ARG(CHAR) \
7d4ea832 39 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
cc8187fc
MM
40 || (CHAR) == 'h' \
41 || (CHAR) == 'z')
42
3b3c6a3f
MM
43#define MASK_HALF_PIC 010000000000 /* Mask for half-pic code */
44#define MASK_HALF_PIC_DEBUG 004000000000 /* Debug flag */
45#define MASK_ELF 002000000000 /* ELF not rose */
46#define MASK_NO_IDENT 001000000000 /* suppress .ident */
47#define MASK_NO_UNDERSCORES 000400000000 /* suppress leading _ */
48#define MASK_LARGE_ALIGN 000200000000 /* align to >word boundaries */
49#define MASK_NO_MCOUNT 000100000000 /* profiling uses mcount_ptr */
a48bb578 50
967d1506
MM
51#define TARGET_HALF_PIC (target_flags & MASK_HALF_PIC)
52#define TARGET_DEBUG (target_flags & MASK_HALF_PIC_DEBUG)
53#define HALF_PIC_DEBUG TARGET_DEBUG
54#define TARGET_ELF (target_flags & MASK_ELF)
55#define TARGET_ROSE ((target_flags & MASK_ELF) == 0)
56#define TARGET_IDENT ((target_flags & MASK_NO_IDENT) == 0)
57#define TARGET_UNDERSCORES ((target_flags & MASK_NO_UNDERSCORES) == 0)
1c7e67ca 58#define TARGET_LARGE_ALIGN (target_flags & MASK_LARGE_ALIGN)
f36a6110 59#define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0)
c623ad33 60
c2177307 61#undef SUBTARGET_SWITCHES
3b3c6a3f
MM
62#define SUBTARGET_SWITCHES \
63 { "half-pic", MASK_HALF_PIC}, \
64 { "no-half-pic", -MASK_HALF_PIC}, \
65 { "debug-half-pic", MASK_HALF_PIC_DEBUG}, \
66 { "debugb", MASK_HALF_PIC_DEBUG}, \
67 { "elf", MASK_ELF}, \
68 { "rose", -MASK_ELF}, \
69 { "ident", -MASK_NO_IDENT}, \
70 { "no-ident", MASK_NO_IDENT}, \
71 { "underscores", -MASK_NO_UNDERSCORES}, \
72 { "no-underscores", MASK_NO_UNDERSCORES}, \
73 { "large-align", MASK_LARGE_ALIGN}, \
74 { "no-large-align", -MASK_LARGE_ALIGN}, \
75 { "mcount", -MASK_NO_MCOUNT}, \
76 { "mcount-ptr", MASK_NO_MCOUNT}, \
77 { "no-mcount", MASK_NO_MCOUNT},
a48bb578 78
b82b0773
MM
79/* OSF/rose uses stabs, not dwarf. */
80#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
81
82#ifndef DWARF_DEBUGGING_INFO
83#define DWARF_DEBUGGING_INFO /* enable dwarf debugging for testing */
84#endif
85
e0440838 86/* Handle #pragma weak and #pragma pack. */
1d21dbd3 87
e0440838 88#define HANDLE_SYSV_PRAGMA
daefd78b 89#define SUPPORTS_WEAK TARGET_ELF
1d21dbd3
MM
90
91/* Change default predefines. */
c2177307 92#undef CPP_PREDEFINES
8524774e 93#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem(xpg4)"
1d21dbd3 94
1d21dbd3 95#undef CPP_SPEC
1228a9bd 96#define CPP_SPEC "%(cpp_cpu) \
1bf3a36e
MM
97%{!melf: -D__ROSE__ %{!pic-none: -D__SHARED__}} \
98%{melf: -D__ELF__ %{fpic: -D__SHARED__}} \
6bf1675f
MM
99%{mno-underscores: -D__NO_UNDERSCORES__} \
100%{melf: %{!munderscores: -D__NO_UNDERSCORES__}} \
101%{.S: %{!ansi:%{!traditional:%{!traditional-cpp:%{!ftraditional: -traditional}}}}} \
102%{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
103%{.cc: -D__LANGUAGE_C_PLUS_PLUS} \
104%{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \
105%{.C: -D__LANGUAGE_C_PLUS_PLUS} \
106%{.m: -D__LANGUAGE_OBJECTIVE_C} \
107%{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}"
1d21dbd3 108
ee59bdfc 109/* Turn on -pic-extern by default for OSF/rose, -fpic for ELF. */
c2177307 110#undef CC1_SPEC
6bf1675f 111#define CC1_SPEC "\
6bf1675f 112%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \
c18cf4e5
MM
113%{!melf: %{!mrose: -mrose }} \
114%{melf: %{!munderscores: %{!mno-underscores: -mno-underscores }} \
115 %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount-ptr }}}} \
116%{!melf: %{!munderscores: %{!mno-underscores: -munderscores }} \
117 %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount }}} \
ee59bdfc
MM
118 %{pic-extern: -mhalf-pic } %{pic-lib: -mhalf-pic } \
119 %{!pic-extern: %{!pic-lib: %{pic-none: -mno-half-pic} %{!pic-none: -mhalf-pic}}} \
120 %{pic-calls: } %{pic-names*: }}"
1d21dbd3 121
c2177307 122#undef ASM_SPEC
d304972d 123#define ASM_SPEC "%{v*: -v}"
1d21dbd3 124
1d21dbd3 125#undef LINK_SPEC
3c58aa35 126#define LINK_SPEC "%{v*: -v} \
ae1ac702 127%{!melf: %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \
3c58aa35
MM
128 %{nostdlib} %{noshrlib} %{glue}} \
129%{melf: %{dy} %{dn} %{glue: } \
cc8187fc
MM
130 %{h*} %{z*} \
131 %{static:-dn -Bstatic} \
132 %{shared:-G -dy} \
133 %{symbolic:-Bsymbolic -G -dy} \
134 %{G:-G} \
135 %{!dy: %{!dn: %{!static: %{!shared: %{!symbolic: \
3c58aa35 136 %{noshrlib: -dn } %{pic-none: -dn } \
cc8187fc 137 %{!noshrlib: %{!pic-none: -dy}}}}}}}}"
1d21dbd3 138
1d21dbd3 139#undef LIB_SPEC
c623ad33 140#define LIB_SPEC "-lc"
1d21dbd3 141
1d21dbd3 142#undef LIBG_SPEC
c2177307 143#define LIBG_SPEC ""
1d21dbd3 144
1d21dbd3 145#undef STARTFILE_SPEC
1d21dbd3
MM
146#define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
147
a6b65dff
MM
148#undef TARGET_VERSION_INTERNAL
149#undef TARGET_VERSION
150
151#define I386_VERSION " 80386, OSF/rose objects"
152
153#define TARGET_VERSION_INTERNAL(STREAM) fputs (I386_VERSION, STREAM)
154#define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)
155
1d21dbd3 156#undef MD_EXEC_PREFIX
1d21dbd3
MM
157#define MD_EXEC_PREFIX "/usr/ccs/gcc/"
158
1d21dbd3 159#undef MD_STARTFILE_PREFIX
1d21dbd3 160#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
1d21dbd3 161
29a326c2
MM
162/* Specify size_t, ptrdiff_t, and wchar_t types. */
163#undef SIZE_TYPE
164#undef PTRDIFF_TYPE
165#undef WCHAR_TYPE
166#undef WCHAR_TYPE_SIZE
167
168#define SIZE_TYPE "long unsigned int"
169#define PTRDIFF_TYPE "int"
170#define WCHAR_TYPE "unsigned int"
171#define WCHAR_TYPE_SIZE BITS_PER_WORD
172
3b3c6a3f
MM
173/* Define this macro if the system header files support C++ as well
174 as C. This macro inhibits the usual method of using system header
175 files in C++, which is to pretend that the file's contents are
176 enclosed in `extern "C" {...}'. */
177#define NO_IMPLICIT_EXTERN_C
178
179/* Turn off long double being 96 bits. */
2f9e2a13 180#undef LONG_DOUBLE_TYPE_SIZE
3b3c6a3f 181#define LONG_DOUBLE_TYPE_SIZE 64
2f9e2a13 182
f36a6110
MM
183/* This macro generates the assembly code for function entry.
184 FILE is a stdio stream to output the code to.
185 SIZE is an int: how many units of temporary storage to allocate.
186 Refer to the array `regs_ever_live' to determine which registers
187 to save; `regs_ever_live[I]' is nonzero if register number I
188 is ever used in the function. This macro is responsible for
189 knowing which registers should not be saved even if used.
190
191 We override it here to allow for the new profiling code to go before
192 the prologue and the old mcount code to go after the prologue (and
193 after %ebx has been set up for ELF shared library support). */
194
195#define OSF_PROFILE_BEFORE_PROLOGUE \
196 (!TARGET_MCOUNT \
197 && !current_function_needs_context \
198 && (!flag_pic \
199 || !frame_pointer_needed \
200 || (!current_function_uses_pic_offset_table \
201 && !current_function_uses_const_pool)))
202
203#undef FUNCTION_PROLOGUE
204#define FUNCTION_PROLOGUE(FILE, SIZE) \
ed882fd5
MM
205do \
206 { \
f36a6110
MM
207 char *prefix = (TARGET_UNDERSCORES) ? "_" : ""; \
208 char *lprefix = LPREFIX; \
209 int labelno = profile_label_no; \
ed882fd5 210 \
f36a6110 211 if (profile_flag && OSF_PROFILE_BEFORE_PROLOGUE) \
ed882fd5 212 { \
40fbfbea 213 if (!flag_pic && !HALF_PIC_P ()) \
ed882fd5 214 { \
40fbfbea 215 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
f36a6110 216 fprintf (FILE, "\tcall *%s_mcount_ptr\n", prefix); \
ed882fd5 217 } \
40fbfbea
MM
218 \
219 else if (HALF_PIC_P ()) \
220 { \
221 rtx symref; \
222 \
223 HALF_PIC_EXTERNAL ("_mcount_ptr"); \
224 symref = HALF_PIC_PTR (gen_rtx (SYMBOL_REF, Pmode, \
225 "_mcount_ptr")); \
226 \
227 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
228 fprintf (FILE, "\tmovl %s%s,%%eax\n", prefix, \
229 XSTR (symref, 0)); \
cd93179b 230 fprintf (FILE, "\tcall *(%%eax)\n"); \
40fbfbea
MM
231 } \
232 \
ed882fd5 233 else \
f36a6110
MM
234 { \
235 static int call_no = 0; \
236 \
237 fprintf (FILE, "\tcall %sPc%d\n", lprefix, call_no); \
238 fprintf (FILE, "%sPc%d:\tpopl %%eax\n", lprefix, call_no); \
239 fprintf (FILE, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-%sPc%d],%%eax\n", \
240 lprefix, call_no++); \
4563275a 241 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%eax),%%edx\n", \
f36a6110
MM
242 lprefix, labelno); \
243 fprintf (FILE, "\tmovl %s_mcount_ptr@GOT(%%eax),%%eax\n", \
244 prefix); \
cd93179b 245 fprintf (FILE, "\tcall *(%%eax)\n"); \
f36a6110
MM
246 } \
247 } \
248 \
249 function_prologue (FILE, SIZE); \
250 } \
251while (0)
252
253/* A C statement or compound statement to output to FILE some assembler code to
254 call the profiling subroutine `mcount'. Before calling, the assembler code
255 must load the address of a counter variable into a register where `mcount'
256 expects to find the address. The name of this variable is `LP' followed by
257 the number LABELNO, so you would generate the name using `LP%d' in a
258 `fprintf'.
3b3c6a3f 259
f36a6110
MM
260 The details of how the address should be passed to `mcount' are determined
261 by your operating system environment, not by GNU CC. To figure them out,
262 compile a small program for profiling using the system's installed C
263 compiler and look at the assembler code that results. */
264
265#undef FUNCTION_PROFILER
266#define FUNCTION_PROFILER(FILE, LABELNO) \
267do \
268 { \
269 if (!OSF_PROFILE_BEFORE_PROLOGUE) \
270 { \
271 char *prefix = (TARGET_UNDERSCORES) ? "_" : ""; \
272 char *lprefix = LPREFIX; \
273 int labelno = LABELNO; \
ed882fd5 274 \
f36a6110
MM
275 /* Note that OSF/rose blew it in terms of calling mcount, \
276 since OSF/rose prepends a leading underscore, but mcount's \
277 doesn't. At present, we keep this kludge for ELF as well \
278 to allow old kernels to build profiling. */ \
9e20879e 279 \
f36a6110
MM
280 if (flag_pic \
281 && !current_function_uses_pic_offset_table \
282 && !current_function_uses_const_pool) \
ed882fd5 283 abort (); \
ed882fd5 284 \
f36a6110 285 if (TARGET_MCOUNT && flag_pic) \
ed882fd5
MM
286 { \
287 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
f36a6110
MM
288 lprefix, labelno); \
289 fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \
290 } \
291 \
40fbfbea
MM
292 else if (TARGET_MCOUNT && HALF_PIC_P ()) \
293 { \
294 rtx symdef; \
295 \
296 HALF_PIC_EXTERNAL ("mcount"); \
297 symdef = HALF_PIC_PTR (gen_rtx (SYMBOL_REF, Pmode, "mcount")); \
298 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
cd93179b 299 fprintf (FILE, "\tcall *%s%s\n", prefix, XSTR (symdef, 0)); \
40fbfbea
MM
300 } \
301 \
f36a6110
MM
302 else if (TARGET_MCOUNT) \
303 { \
304 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
305 fprintf (FILE, "\tcall %smcount\n", prefix); \
306 } \
307 \
308 else if (flag_pic && frame_pointer_needed) \
309 { \
310 fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
ed882fd5 311 fprintf (FILE, "\tpushl %%ecx\n"); \
4563275a 312 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
f36a6110 313 lprefix, labelno); \
4563275a 314 fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \
cd93179b 315 fprintf (FILE, "\tcall *(%%eax)\n"); \
f36a6110 316 fprintf (FILE, "\tpopl %%eax\n"); \
ed882fd5 317 } \
f36a6110
MM
318 \
319 else if (frame_pointer_needed) \
ed882fd5 320 { \
f36a6110 321 fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
ed882fd5 322 fprintf (FILE, "\tpushl %%ecx\n"); \
40fbfbea 323 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
f36a6110
MM
324 fprintf (FILE, "\tcall *_mcount_ptr\n"); \
325 fprintf (FILE, "\tpopl %%eax\n"); \
ed882fd5
MM
326 } \
327 \
f36a6110
MM
328 else \
329 abort (); \
ed882fd5
MM
330 } \
331 } \
332while (0)
1d21dbd3 333
1c7e67ca
MM
334/* A C function or functions which are needed in the library to
335 support block profiling. When support goes into libc, undo
336 the #if 0. */
337
338#if 0
339#undef BLOCK_PROFILING_CODE
340#define BLOCK_PROFILING_CODE
341#endif
342
967d1506
MM
343/* Prefix for internally generated assembler labels. If we aren't using
344 underscores, we are using prefix `.'s to identify labels that should
345 be ignored, as in `i386/gas.h' --karl@cs.umb.edu */
346#undef LPREFIX
347#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L")
348
349/* This is how to store into the string BUF
350 the symbol_ref name of an internal numbered label where
351 PREFIX is the class of label and NUM is the number within the class.
352 This is suitable for output with `assemble_name'. */
353
354#undef ASM_GENERATE_INTERNAL_LABEL
355#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
356 sprintf ((BUF), "*%s%s%d", (TARGET_UNDERSCORES) ? "" : ".", \
357 (PREFIX), (NUMBER))
358
359/* This is how to output an internal numbered label where
360 PREFIX is the class of label and NUM is the number within the class. */
361
362#undef ASM_OUTPUT_INTERNAL_LABEL
363#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
364 fprintf (FILE, "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \
365 PREFIX, NUM)
366
3cc7f838
RK
367/* The prefix to add to user-visible assembler symbols. */
368
369/* target_flags is not accessible by the preprocessor */
370#undef USER_LABEL_PREFIX
371#define USER_LABEL_PREFIX "_"
372
967d1506
MM
373/* This is how to output a reference to a user-level label named NAME. */
374
375#undef ASM_OUTPUT_LABELREF
376#define ASM_OUTPUT_LABELREF(FILE,NAME) \
377 fprintf (FILE, "%s%s", (TARGET_UNDERSCORES) ? "_" : "", NAME)
378
cd93179b
MM
379/* This is how to output an element of a case-vector that is relative.
380 This is only used for PIC code. See comments by the `casesi' insn in
381 i386.md for an explanation of the expression this outputs. */
382
383#undef ASM_OUTPUT_ADDR_DIFF_ELT
33f7f353 384#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
cd93179b
MM
385 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
386
65624c8e
MM
387/* Output a definition */
388#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
389do \
390{ \
391 fprintf ((FILE), "\t%s\t", SET_ASM_OP); \
392 assemble_name (FILE, LABEL1); \
393 fprintf (FILE, ","); \
394 assemble_name (FILE, LABEL2); \
395 fprintf (FILE, "\n"); \
396 } \
397while (0)
398
1c7e67ca
MM
399/* A C expression to output text to align the location counter in the
400 way that is desirable at a point in the code that is reached only
401 by jumping.
402
403 This macro need not be defined if you don't want any special
404 alignment to be done at such a time. Most machine descriptions do
405 not currently define the macro. */
406
fc470718
R
407#undef LABEL_ALIGN_AFTER_BARRIER
408#define LABEL_ALIGN_AFTER_BARRIER(LABEL) \
409 ((!TARGET_LARGE_ALIGN && i386_align_jumps > 2) ? 2 : i386_align_jumps)
1c7e67ca
MM
410
411/* A C expression to output text to align the location counter in the
412 way that is desirable at the beginning of a loop.
413
414 This macro need not be defined if you don't want any special
415 alignment to be done at such a time. Most machine descriptions do
416 not currently define the macro. */
417
fc470718
R
418#undef LOOP_ALIGN
419#define LOOP_ALIGN(LABEL) (i386_align_loops)
1c7e67ca
MM
420
421/* A C statement to output to the stdio stream STREAM an assembler
422 command to advance the location counter to a multiple of 2 to the
423 POWER bytes. POWER will be a C expression of type `int'. */
424
425#undef ASM_OUTPUT_ALIGN
426#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
427 fprintf (STREAM, "\t.align\t%d\n", \
428 (!TARGET_LARGE_ALIGN && (POWER) > 2) ? 2 : (POWER))
429
c623ad33
MM
430/* A C expression that is 1 if the RTX X is a constant which is a
431 valid address. On most machines, this can be defined as
432 `CONSTANT_P (X)', but a few machines are more restrictive in
433 which constant addresses are supported.
434
435 `CONSTANT_P' accepts integer-values expressions whose values are
436 not explicitly known, such as `symbol_ref', `label_ref', and
437 `high' expressions and `const' arithmetic expressions, in
438 addition to `const_int' and `const_double' expressions. */
439
84ab931b
MM
440#define CONSTANT_ADDRESS_P_ORIG(X) \
441 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
442 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
443 || GET_CODE (X) == HIGH)
444
c2177307 445#undef CONSTANT_ADDRESS_P
c623ad33 446#define CONSTANT_ADDRESS_P(X) \
84ab931b 447 ((CONSTANT_ADDRESS_P_ORIG (X)) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X)))
c623ad33 448
c2177307
MM
449/* Nonzero if the constant value X is a legitimate general operand.
450 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
451
452#undef LEGITIMATE_CONSTANT_P
453#define LEGITIMATE_CONSTANT_P(X) \
454 (!HALF_PIC_P () \
455 || GET_CODE (X) == CONST_DOUBLE \
456 || GET_CODE (X) == CONST_INT \
457 || !HALF_PIC_ADDRESS_P (X))
458
a48bb578
MM
459/* Sometimes certain combinations of command options do not make sense
460 on a particular target machine. You can define a macro
461 `OVERRIDE_OPTIONS' to take account of this. This macro, if
462 defined, is executed once just after all the command options have
463 been parsed. */
464
c49f1ce8
MM
465#undef SUBTARGET_OVERRIDE_OPTIONS
466#define SUBTARGET_OVERRIDE_OPTIONS \
a48bb578 467{ \
d304972d
MM
468 /* \
469 if (TARGET_ELF && TARGET_HALF_PIC) \
470 { \
471 target_flags &= ~MASK_HALF_PIC; \
472 flag_pic = 1; \
473 } \
474 */ \
475 \
476 if (TARGET_ROSE && flag_pic) \
477 { \
478 target_flags |= MASK_HALF_PIC; \
479 flag_pic = 0; \
480 } \
481 \
a48bb578
MM
482 if (TARGET_HALF_PIC) \
483 half_pic_init (); \
484}
485
c623ad33
MM
486/* Define this macro if references to a symbol must be treated
487 differently depending on something about the variable or
488 function named by the symbol (such as what section it is in).
489
490 The macro definition, if any, is executed immediately after the
3b3c6a3f 491 rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
c623ad33
MM
492 The value of the rtl will be a `mem' whose address is a
493 `symbol_ref'.
494
495 The usual thing for this macro to do is to a flag in the
496 `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
497 name string in the `symbol_ref' (if one bit is not enough
498 information).
499
500 The best way to modify the name string is by adding text to the
3b3c6a3f 501 beginning, with suitable punctuation to prevent any ambiguity.
c623ad33
MM
502 Allocate the new name in `saveable_obstack'. You will have to
503 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
504 and output the name accordingly.
505
506 You can also check the information stored in the `symbol_ref' in
507 the definition of `GO_IF_LEGITIMATE_ADDRESS' or
508 `PRINT_OPERAND_ADDRESS'. */
509
c2177307 510#undef ENCODE_SECTION_INFO
c623ad33
MM
511#define ENCODE_SECTION_INFO(DECL) \
512do \
513 { \
40fbfbea 514 if (HALF_PIC_P ()) \
c623ad33 515 HALF_PIC_ENCODE (DECL); \
40fbfbea
MM
516 \
517 else if (flag_pic) \
518 { \
519 rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
520 ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
521 SYMBOL_REF_FLAG (XEXP (rtl, 0)) \
522 = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
523 || ! TREE_PUBLIC (DECL)); \
524 } \
c623ad33
MM
525 } \
526while (0)
527
528
1c7e67ca
MM
529/* On most machines, read-only variables, constants, and jump tables
530 are placed in the text section. If this is not the case on your
531 machine, this macro should be defined to be the name of a function
532 (either `data_section' or a function defined in `EXTRA_SECTIONS')
533 that switches to the section to be used for read-only items.
534
535 If these items should be placed in the text section, this macro
536 should not be defined. */
537
538#if 0
539#undef READONLY_DATA_SECTION
540#define READONLY_DATA_SECTION() \
541do \
542 { \
543 if (TARGET_ELF) \
544 { \
545 if (in_section != in_rodata) \
546 { \
547 fprintf (asm_out_file, "\t.section \"rodata\"\n"); \
548 in_section = in_rodata; \
549 } \
550 } \
551 else \
552 text_section (); \
553 } \
554while (0)
555#endif
556
557/* A list of names for sections other than the standard two, which are
558 `in_text' and `in_data'. You need not define this macro on a
559 system with no other sections (that GCC needs to use). */
560
561#undef EXTRA_SECTIONS
562#define EXTRA_SECTIONS in_rodata, in_data1
563
c2177307
MM
564/* Given a decl node or constant node, choose the section to output it in
565 and select that section. */
566
567#undef SELECT_RTX_SECTION
568#define SELECT_RTX_SECTION(MODE, RTX) \
569do \
570 { \
571 if (MODE == Pmode && HALF_PIC_P () && HALF_PIC_ADDRESS_P (RTX)) \
572 data_section (); \
573 else \
574 readonly_data_section (); \
575 } \
576while (0)
577
578#undef SELECT_SECTION
b7191cb5 579#define SELECT_SECTION(DECL, RELOC) \
c2177307 580{ \
b7191cb5
MM
581 if (RELOC && HALF_PIC_P ()) \
582 data_section (); \
583 \
584 else if (TREE_CODE (DECL) == STRING_CST) \
c2177307
MM
585 { \
586 if (flag_writable_strings) \
587 data_section (); \
588 else \
589 readonly_data_section (); \
590 } \
b7191cb5 591 \
c2177307
MM
592 else if (TREE_CODE (DECL) != VAR_DECL) \
593 readonly_data_section (); \
b7191cb5 594 \
ed8969fa
JW
595 else if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
596 || !DECL_INITIAL (DECL) \
597 || (DECL_INITIAL (DECL) != error_mark_node \
598 && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
c2177307 599 data_section (); \
b7191cb5 600 \
c2177307
MM
601 else \
602 readonly_data_section (); \
603}
604
605
d304972d
MM
606/* Define the strings used for the special svr4 .type and .size directives.
607 These strings generally do not vary from one system running svr4 to
608 another, but if a given system (e.g. m88k running svr) needs to use
609 different pseudo-op names for these, they may be overridden in the
610 file which includes this one. */
611
612#define TYPE_ASM_OP ".type"
613#define SIZE_ASM_OP ".size"
7323e99b 614#define SET_ASM_OP ".set"
d304972d 615
daefd78b
JM
616/* This is how we tell the assembler that a symbol is weak. */
617
618#define ASM_WEAKEN_LABEL(FILE,NAME) \
619 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
620 fputc ('\n', FILE); } while (0)
621
d304972d
MM
622/* The following macro defines the format used to output the second
623 operand of the .type assembler directive. Different svr4 assemblers
624 expect various different forms for this operand. The one given here
625 is just a default. You may need to override it in your machine-
626 specific tm.h file (depending upon the particulars of your assembler). */
627
628#define TYPE_OPERAND_FMT "@%s"
629
c623ad33
MM
630/* A C statement (sans semicolon) to output to the stdio stream
631 STREAM any text necessary for declaring the name NAME of an
632 initialized variable which is being defined. This macro must
3b3c6a3f 633 output the label definition (perhaps using `ASM_OUTPUT_LABEL').
c623ad33
MM
634 The argument DECL is the `VAR_DECL' tree node representing the
635 variable.
636
637 If this macro is not defined, then the variable name is defined
638 in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
639
c2177307 640#undef ASM_DECLARE_OBJECT_NAME
92dee628
RS
641#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
642do \
643 { \
644 ASM_OUTPUT_LABEL(STREAM,NAME); \
645 HALF_PIC_DECLARE (NAME); \
646 if (TARGET_ELF) \
647 { \
648 fprintf (STREAM, "\t%s\t ", TYPE_ASM_OP); \
649 assemble_name (STREAM, NAME); \
650 putc (',', STREAM); \
651 fprintf (STREAM, TYPE_OPERAND_FMT, "object"); \
652 putc ('\n', STREAM); \
653 size_directive_output = 0; \
654 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
655 { \
656 size_directive_output = 1; \
657 fprintf (STREAM, "\t%s\t ", SIZE_ASM_OP); \
658 assemble_name (STREAM, NAME); \
86615a62 659 fprintf (STREAM, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
92dee628
RS
660 } \
661 } \
662 } \
c623ad33
MM
663while (0)
664
92dee628
RS
665/* Output the size directive for a decl in rest_of_decl_compilation
666 in the case where we did not do so before the initializer.
667 Once we find the error_mark_node, we know that the value of
668 size_directive_output was set
669 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
670
671#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
672do { \
673 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
cc8187fc
MM
674 if (TARGET_ELF \
675 && !flag_inhibit_size_directive && DECL_SIZE (DECL) \
92dee628
RS
676 && ! AT_END && TOP_LEVEL \
677 && DECL_INITIAL (DECL) == error_mark_node \
678 && !size_directive_output) \
679 { \
680 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
681 assemble_name (FILE, name); \
682 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
683 } \
684 } while (0)
685
c623ad33
MM
686/* This is how to declare a function name. */
687
d304972d 688#undef ASM_DECLARE_FUNCTION_NAME
c623ad33
MM
689#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
690do \
691 { \
d304972d 692 ASM_OUTPUT_LABEL(STREAM,NAME); \
c623ad33 693 HALF_PIC_DECLARE (NAME); \
d304972d
MM
694 if (TARGET_ELF) \
695 { \
696 fprintf (STREAM, "\t%s\t ", TYPE_ASM_OP); \
697 assemble_name (STREAM, NAME); \
698 putc (',', STREAM); \
699 fprintf (STREAM, TYPE_OPERAND_FMT, "function"); \
700 putc ('\n', STREAM); \
701 ASM_DECLARE_RESULT (STREAM, DECL_RESULT (DECL)); \
702 } \
c623ad33
MM
703 } \
704while (0)
705
d304972d
MM
706/* Write the extra assembler code needed to declare a function's result.
707 Most svr4 assemblers don't require any special declaration of the
708 result value, but there are exceptions. */
709
710#ifndef ASM_DECLARE_RESULT
711#define ASM_DECLARE_RESULT(FILE, RESULT)
712#endif
713
714/* This is how to declare the size of a function. */
715
716#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
717do \
718 { \
719 if (TARGET_ELF && !flag_inhibit_size_directive) \
720 { \
721 char label[256]; \
722 static int labelno; \
723 labelno++; \
724 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
725 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
ebe6d7a7 726 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
d304972d
MM
727 assemble_name (FILE, (FNAME)); \
728 fprintf (FILE, ","); \
729 assemble_name (FILE, label); \
730 fprintf (FILE, "-"); \
731 assemble_name (FILE, (FNAME)); \
732 putc ('\n', FILE); \
733 } \
734 } \
735while (0)
736
737/* Attach a special .ident directive to the end of the file to identify
738 the version of GCC which compiled this code. The format of the
739 .ident string is patterned after the ones produced by native svr4
740 C compilers. */
741
742#define IDENT_ASM_OP ".ident"
743
744/* Allow #sccs in preprocessor. */
745
746#define SCCS_DIRECTIVE
747
a48bb578
MM
748/* This says what to print at the end of the assembly file */
749#define ASM_FILE_END(STREAM) \
750do \
751 { \
752 if (HALF_PIC_P ()) \
753 HALF_PIC_FINISH (STREAM); \
d304972d
MM
754 \
755 if (TARGET_IDENT) \
756 { \
e2bf4cfc
MM
757 char *fstart = main_input_filename; \
758 char *fname; \
759 \
760 if (!fstart) \
761 fstart = "<no file>"; \
762 \
763 fname = fstart + strlen (fstart) - 1; \
764 while (fname > fstart && *fname != '/') \
765 fname--; \
766 \
767 if (*fname == '/') \
768 fname++; \
769 \
770 fprintf ((STREAM), "\t%s\t\"GCC: (GNU) %s %s -O%d", \
771 IDENT_ASM_OP, version_string, fname, optimize); \
d304972d
MM
772 \
773 if (write_symbols == PREFERRED_DEBUGGING_TYPE) \
774 fprintf ((STREAM), " -g%d", (int)debug_info_level); \
775 \
776 else if (write_symbols == DBX_DEBUG) \
777 fprintf ((STREAM), " -gstabs%d", (int)debug_info_level); \
778 \
779 else if (write_symbols == DWARF_DEBUG) \
780 fprintf ((STREAM), " -gdwarf%d", (int)debug_info_level); \
781 \
782 else if (write_symbols != NO_DEBUG) \
783 fprintf ((STREAM), " -g??%d", (int)debug_info_level); \
784 \
785 if (flag_omit_frame_pointer) \
786 fprintf ((STREAM), " -fomit-frame-pointer"); \
787 \
788 if (flag_strength_reduce) \
789 fprintf ((STREAM), " -fstrength-reduce"); \
790 \
791 if (flag_unroll_loops) \
792 fprintf ((STREAM), " -funroll-loops"); \
793 \
3b3c6a3f
MM
794 if (flag_schedule_insns) \
795 fprintf ((STREAM), " -fschedule-insns"); \
796 \
797 if (flag_schedule_insns_after_reload) \
798 fprintf ((STREAM), " -fschedule-insns2"); \
799 \
d304972d
MM
800 if (flag_force_mem) \
801 fprintf ((STREAM), " -fforce-mem"); \
802 \
803 if (flag_force_addr) \
804 fprintf ((STREAM), " -fforce-addr"); \
805 \
806 if (flag_inline_functions) \
807 fprintf ((STREAM), " -finline-functions"); \
808 \
809 if (flag_caller_saves) \
810 fprintf ((STREAM), " -fcaller-saves"); \
811 \
812 if (flag_pic) \
813 fprintf ((STREAM), (flag_pic > 1) ? " -fPIC" : " -fpic"); \
814 \
815 if (flag_inhibit_size_directive) \
816 fprintf ((STREAM), " -finhibit-size-directive"); \
817 \
818 if (flag_gnu_linker) \
819 fprintf ((STREAM), " -fgnu-linker"); \
820 \
821 if (profile_flag) \
822 fprintf ((STREAM), " -p"); \
823 \
824 if (profile_block_flag) \
825 fprintf ((STREAM), " -a"); \
826 \
827 if (TARGET_IEEE_FP) \
828 fprintf ((STREAM), " -mieee-fp"); \
829 \
830 if (TARGET_HALF_PIC) \
831 fprintf ((STREAM), " -mhalf-pic"); \
832 \
3b3c6a3f
MM
833 if (!TARGET_MOVE) \
834 fprintf ((STREAM), " -mno-move"); \
835 \
836 if (TARGET_386) \
837 fprintf ((STREAM), " -m386"); \
838 \
839 else if (TARGET_486) \
840 fprintf ((STREAM), " -m486"); \
841 \
842 else \
843 fprintf ((STREAM), " -munknown-machine"); \
844 \
d304972d
MM
845 fprintf ((STREAM), (TARGET_ELF) ? " -melf\"\n" : " -mrose\"\n"); \
846 } \
a48bb578
MM
847 } \
848while (0)
849
1d21dbd3
MM
850/* Tell collect that the object format is OSF/rose. */
851#define OBJECT_FORMAT_ROSE
1d21dbd3 852
99022b47 853/* Tell collect where the appropriate binaries are. */
684e4e06 854#define REAL_NM_FILE_NAME "/usr/ccs/gcc/bfd-nm"
99022b47
MM
855#define REAL_STRIP_FILE_NAME "/usr/ccs/bin/strip"
856
82bb2b59
JVA
857/* Use atexit for static constructors/destructors, instead of defining
858 our own exit function. */
859#define HAVE_ATEXIT
860
82bb2b59 861/* Define this macro meaning that gcc should find the library 'libgcc.a'
c5b7917e 862 by hand, rather than passing the argument '-lgcc' to tell the linker
82bb2b59
JVA
863 to do the search */
864#define LINK_LIBGCC_SPECIAL
1f7da38e 865
c623ad33
MM
866/* A C statement to output assembler commands which will identify the object
867 file as having been compile with GNU CC. We don't need or want this for
868 OSF1. GDB doesn't need it and kdb doesn't like it */
869#define ASM_IDENTIFY_GCC(FILE)
870
ed1d96d5
MM
871/* Identify the front-end which produced this file. To keep symbol
872 space down, and not confuse kdb, only do this if the language is
873 not C. */
874
875#define ASM_IDENTIFY_LANGUAGE(STREAM) \
876{ \
877 if (strcmp (lang_identify (), "c") != 0) \
878 output_lang_identify (STREAM); \
879}
880
c623ad33 881/* Generate calls to memcpy, etc., not bcopy, etc. */
60892950 882#define TARGET_MEM_FUNCTIONS
40f32220
JW
883
884/* Don't default to pcc-struct-return, because gcc is the only compiler, and
885 we want to retain compatibility with older gcc versions. */
886#define DEFAULT_PCC_STRUCT_RETURN 0
e0440838
MM
887
888/* Map i386 registers to the numbers dwarf expects. Of course this is different
889 from what stabs expects. */
890
891#define DWARF_DBX_REGISTER_NUMBER(n) \
892((n) == 0 ? 0 \
893 : (n) == 1 ? 2 \
894 : (n) == 2 ? 1 \
895 : (n) == 3 ? 3 \
896 : (n) == 4 ? 6 \
897 : (n) == 5 ? 7 \
898 : (n) == 6 ? 5 \
899 : (n) == 7 ? 4 \
900 : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
901 : (-1))
902
903/* Now what stabs expects in the register. */
904#define STABS_DBX_REGISTER_NUMBER(n) \
905((n) == 0 ? 0 : \
906 (n) == 1 ? 2 : \
907 (n) == 2 ? 1 : \
908 (n) == 3 ? 3 : \
909 (n) == 4 ? 6 : \
910 (n) == 5 ? 7 : \
911 (n) == 6 ? 4 : \
912 (n) == 7 ? 5 : \
913 (n) + 4)
914
915#undef DBX_REGISTER_NUMBER
916#define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \
917 ? DWARF_DBX_REGISTER_NUMBER(n) \
918 : STABS_DBX_REGISTER_NUMBER(n))
This page took 0.551285 seconds and 5 git commands to generate.