* final.c (HAVE_READONLY_DATA_SECTION): New.
[official-gcc.git] / gcc / config / i386 / osfrose.h
blob03aa95a145055528bc5905065500e496987363ab
1 /* Definitions of target machine for GNU compiler.
2 Intel 386 (OSF/1 with OSF/rose) version.
3 Copyright (C) 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2002
4 Free Software Foundation, Inc.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #define OSF_OS
25 #undef WORD_SWITCH_TAKES_ARG
26 #define WORD_SWITCH_TAKES_ARG(STR) \
27 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) || !strcmp (STR, "pic-names"))
29 /* This defines which switch letters take arguments. On svr4, most of
30 the normal cases (defined in gcc.c) apply, and we also have -h* and
31 -z* options (for the linker). */
33 #define SWITCH_TAKES_ARG(CHAR) \
34 (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
35 || (CHAR) == 'h' \
36 || (CHAR) == 'z')
38 #define MASK_HALF_PIC 010000000000 /* Mask for half-pic code */
39 #define MASK_HALF_PIC_DEBUG 004000000000 /* Debug flag */
40 #define MASK_ELF 002000000000 /* ELF not rose */
41 #define MASK_NO_UNDERSCORES 000400000000 /* suppress leading _ */
42 #define MASK_LARGE_ALIGN 000200000000 /* align to >word boundaries */
43 #define MASK_NO_MCOUNT 000100000000 /* profiling uses mcount_ptr */
45 #define TARGET_HALF_PIC (target_flags & MASK_HALF_PIC)
46 #define TARGET_DEBUG (target_flags & MASK_HALF_PIC_DEBUG)
47 #define HALF_PIC_DEBUG TARGET_DEBUG
48 #define TARGET_ELF (target_flags & MASK_ELF)
49 #define TARGET_ROSE ((target_flags & MASK_ELF) == 0)
50 #define TARGET_UNDERSCORES ((target_flags & MASK_NO_UNDERSCORES) == 0)
51 #define TARGET_LARGE_ALIGN (target_flags & MASK_LARGE_ALIGN)
52 #define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0)
54 #undef SUBTARGET_SWITCHES
55 #define SUBTARGET_SWITCHES \
56 { "half-pic", MASK_HALF_PIC, \
57 N_("Emit half-PIC code") }, \
58 { "no-half-pic", -MASK_HALF_PIC, "" }, \
59 { "debug-half-pic", MASK_HALF_PIC_DEBUG, \
60 0 /* intentionally undoc */ }, \
61 { "debugb", MASK_HALF_PIC_DEBUG, \
62 0 /* intentionally undoc */ }, \
63 { "elf", MASK_ELF, \
64 N_("Emit ELF object code") }, \
65 { "rose", -MASK_ELF, \
66 N_("Emit ROSE object code") }, \
67 { "underscores", -MASK_NO_UNDERSCORES, \
68 N_("Symbols have a leading underscore") }, \
69 { "no-underscores", MASK_NO_UNDERSCORES, "" }, \
70 { "large-align", MASK_LARGE_ALIGN, \
71 N_("Align to >word boundaries") }, \
72 { "no-large-align", -MASK_LARGE_ALIGN, "" }, \
73 { "mcount", -MASK_NO_MCOUNT, \
74 N_("Use mcount for profiling") }, \
75 { "mcount-ptr", MASK_NO_MCOUNT, \
76 N_("Use mcount_ptr for profiling") }, \
77 { "no-mcount", MASK_NO_MCOUNT, "" },
79 /* OSF/rose uses stabs, not dwarf. */
80 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
82 #ifndef DWARF_DEBUGGING_INFO
83 #define DWARF_DEBUGGING_INFO /* enable dwarf debugging for testing */
84 #endif
86 /* Handle #pragma weak and #pragma pack. */
88 #define HANDLE_SYSV_PRAGMA
89 #define SUPPORTS_WEAK TARGET_ELF
91 /* Change default predefines. */
92 #undef CPP_PREDEFINES
93 #define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem=xpg4"
95 #undef CPP_SPEC
96 #define CPP_SPEC "%(cpp_cpu) \
97 %{!melf: -D__ROSE__ %{!pic-none: -D__SHARED__}} \
98 %{melf: -D__ELF__ %{fpic: -D__SHARED__}} \
99 %{mno-underscores: -D__NO_UNDERSCORES__} \
100 %{melf: %{!munderscores: -D__NO_UNDERSCORES__}} \
101 %{.S: %{!ansi:%{!traditional-cpp: -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}}"
109 /* Turn on -pic-extern by default for OSF/rose, -fpic for ELF. */
110 #undef CC1_SPEC
111 #define CC1_SPEC "%(cc1_cpu) \
112 %{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \
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 }}} \
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*: }}"
122 #undef ASM_SPEC
123 #define ASM_SPEC "%{v*: -v}"
125 #undef LINK_SPEC
126 #define LINK_SPEC "%{v*: -v} \
127 %{!melf: %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \
128 %{nostdlib} %{noshrlib} %{glue}} \
129 %{melf: %{dy} %{dn} %{glue: } \
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: \
136 %{noshrlib: -dn } %{pic-none: -dn } \
137 %{!noshrlib: %{!pic-none: -dy}}}}}}}}"
139 #undef LIB_SPEC
140 #define LIB_SPEC "-lc"
142 #undef LIBG_SPEC
143 #define LIBG_SPEC ""
145 #undef STARTFILE_SPEC
146 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
148 #undef TARGET_VERSION_INTERNAL
150 #define I386_VERSION " 80386, OSF/rose objects"
152 #define TARGET_VERSION_INTERNAL(STREAM) fputs (I386_VERSION, STREAM)
153 #define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)
155 #undef MD_EXEC_PREFIX
156 #define MD_EXEC_PREFIX "/usr/ccs/gcc/"
158 #undef MD_STARTFILE_PREFIX
159 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
161 /* Specify size_t, ptrdiff_t, and wchar_t types. */
162 #undef SIZE_TYPE
163 #undef PTRDIFF_TYPE
164 #undef WCHAR_TYPE
165 #undef WCHAR_TYPE_SIZE
167 #define SIZE_TYPE "long unsigned int"
168 #define PTRDIFF_TYPE "int"
169 #define WCHAR_TYPE "unsigned int"
170 #define WCHAR_TYPE_SIZE BITS_PER_WORD
172 /* Define this macro if the system header files support C++ as well
173 as C. This macro inhibits the usual method of using system header
174 files in C++, which is to pretend that the file's contents are
175 enclosed in `extern "C" {...}'. */
176 #define NO_IMPLICIT_EXTERN_C
178 /* Turn off long double being 96 bits. */
179 #undef LONG_DOUBLE_TYPE_SIZE
180 #define LONG_DOUBLE_TYPE_SIZE 64
182 #define OSF_PROFILE_BEFORE_PROLOGUE \
183 (!TARGET_MCOUNT \
184 && !current_function_needs_context \
185 && (!flag_pic \
186 || !frame_pointer_needed \
187 || (!current_function_uses_pic_offset_table \
188 && !current_function_uses_const_pool)))
190 /* A C statement or compound statement to output to FILE some assembler code to
191 call the profiling subroutine `mcount'. Before calling, the assembler code
192 must load the address of a counter variable into a register where `mcount'
193 expects to find the address. The name of this variable is `LP' followed by
194 the number LABELNO, so you would generate the name using `LP%d' in a
195 `fprintf'.
197 The details of how the address should be passed to `mcount' are determined
198 by your operating system environment, not by GNU CC. To figure them out,
199 compile a small program for profiling using the system's installed C
200 compiler and look at the assembler code that results. */
202 #undef FUNCTION_PROFILER
203 #define FUNCTION_PROFILER(FILE, LABELNO) \
204 do \
206 if (!OSF_PROFILE_BEFORE_PROLOGUE) \
208 const char *const prefix = (TARGET_UNDERSCORES) ? "_" : ""; \
209 const char *const lprefix = LPREFIX; \
210 int labelno = LABELNO; \
212 /* Note that OSF/rose blew it in terms of calling mcount, \
213 since OSF/rose prepends a leading underscore, but mcount's \
214 doesn't. At present, we keep this kludge for ELF as well \
215 to allow old kernels to build profiling. */ \
217 if (flag_pic \
218 && !current_function_uses_pic_offset_table \
219 && !current_function_uses_const_pool) \
220 abort (); \
222 if (TARGET_MCOUNT && flag_pic) \
224 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
225 lprefix, labelno); \
226 fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \
229 else if (TARGET_MCOUNT && HALF_PIC_P ()) \
231 rtx symdef; \
233 HALF_PIC_EXTERNAL ("mcount"); \
234 symdef = HALF_PIC_PTR (gen_rtx_SYMBOL_REF (Pmode, "mcount")); \
235 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
236 fprintf (FILE, "\tcall *%s%s\n", prefix, XSTR (symdef, 0)); \
239 else if (TARGET_MCOUNT) \
241 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
242 fprintf (FILE, "\tcall %smcount\n", prefix); \
245 else if (flag_pic && frame_pointer_needed) \
247 fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
248 fprintf (FILE, "\tpushl %%ecx\n"); \
249 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
250 lprefix, labelno); \
251 fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \
252 fprintf (FILE, "\tcall *(%%eax)\n"); \
253 fprintf (FILE, "\tpopl %%eax\n"); \
256 else if (frame_pointer_needed) \
258 fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
259 fprintf (FILE, "\tpushl %%ecx\n"); \
260 fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
261 fprintf (FILE, "\tcall *_mcount_ptr\n"); \
262 fprintf (FILE, "\tpopl %%eax\n"); \
265 else \
266 abort (); \
269 while (0)
271 /* A C function or functions which are needed in the library to
272 support block profiling. When support goes into libc, undo
273 the #if 0. */
275 #if 0
276 #undef BLOCK_PROFILING_CODE
277 #define BLOCK_PROFILING_CODE
278 #endif
280 /* Prefix for internally generated assembler labels. If we aren't using
281 underscores, we are using prefix `.'s to identify labels that should
282 be ignored, as in `i386/gas.h' --karl@cs.umb.edu */
283 #undef LPREFIX
284 #define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L")
286 /* This is how to store into the string BUF
287 the symbol_ref name of an internal numbered label where
288 PREFIX is the class of label and NUM is the number within the class.
289 This is suitable for output with `assemble_name'. */
291 #undef ASM_GENERATE_INTERNAL_LABEL
292 #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
293 sprintf ((BUF), "*%s%s%ld", (TARGET_UNDERSCORES) ? "" : ".", \
294 (PREFIX), (long)(NUMBER))
296 /* This is how to output an internal numbered label where
297 PREFIX is the class of label and NUM is the number within the class. */
299 #undef ASM_OUTPUT_INTERNAL_LABEL
300 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
301 fprintf (FILE, "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \
302 PREFIX, NUM)
304 /* The prefix to add to user-visible assembler symbols. */
306 /* target_flags is not accessible by the preprocessor */
307 #undef USER_LABEL_PREFIX
308 #define USER_LABEL_PREFIX "_"
310 /* This is how to output a reference to a user-level label named NAME. */
312 #undef ASM_OUTPUT_LABELREF
313 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
314 fprintf (FILE, "%s%s", (TARGET_UNDERSCORES) ? "_" : "", NAME)
316 /* This is how to output an element of a case-vector that is relative.
317 This is only used for PIC code. See comments by the `casesi' insn in
318 i386.md for an explanation of the expression this outputs. */
320 #undef ASM_OUTPUT_ADDR_DIFF_ELT
321 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
322 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
324 /* Output a definition */
325 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
326 do \
328 fprintf ((FILE), "%s", SET_ASM_OP); \
329 assemble_name (FILE, LABEL1); \
330 fprintf (FILE, ","); \
331 assemble_name (FILE, LABEL2); \
332 fprintf (FILE, "\n"); \
334 while (0)
336 /* A C expression to output text to align the location counter in the
337 way that is desirable at a point in the code that is reached only
338 by jumping.
340 This macro need not be defined if you don't want any special
341 alignment to be done at such a time. Most machine descriptions do
342 not currently define the macro. */
344 #undef LABEL_ALIGN_AFTER_BARRIER
345 #define LABEL_ALIGN_AFTER_BARRIER(LABEL) \
346 ((!TARGET_LARGE_ALIGN && i386_align_jumps > 2) ? 2 : i386_align_jumps)
348 /* A C expression to output text to align the location counter in the
349 way that is desirable at the beginning of a loop.
351 This macro need not be defined if you don't want any special
352 alignment to be done at such a time. Most machine descriptions do
353 not currently define the macro. */
355 #undef LOOP_ALIGN
356 #define LOOP_ALIGN(LABEL) (i386_align_loops)
358 /* A C statement to output to the stdio stream STREAM an assembler
359 command to advance the location counter to a multiple of 2 to the
360 POWER bytes. POWER will be a C expression of type `int'. */
362 #undef ASM_OUTPUT_ALIGN
363 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
364 fprintf (STREAM, "\t.align\t%d\n", \
365 (!TARGET_LARGE_ALIGN && (POWER) > 2) ? 2 : (POWER))
367 /* A C expression that is 1 if the RTX X is a constant which is a
368 valid address. On most machines, this can be defined as
369 `CONSTANT_P (X)', but a few machines are more restrictive in
370 which constant addresses are supported.
372 `CONSTANT_P' accepts integer-values expressions whose values are
373 not explicitly known, such as `symbol_ref', `label_ref', and
374 `high' expressions and `const' arithmetic expressions, in
375 addition to `const_int' and `const_double' expressions. */
377 #define CONSTANT_ADDRESS_P_ORIG(X) \
378 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
379 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \
380 || GET_CODE (X) == HIGH)
382 #undef CONSTANT_ADDRESS_P
383 #define CONSTANT_ADDRESS_P(X) \
384 ((CONSTANT_ADDRESS_P_ORIG (X)) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X)))
386 /* Nonzero if the constant value X is a legitimate general operand.
387 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
389 #undef LEGITIMATE_CONSTANT_P
390 #define LEGITIMATE_CONSTANT_P(X) \
391 (!HALF_PIC_P () \
392 || GET_CODE (X) == CONST_DOUBLE \
393 || GET_CODE (X) == CONST_INT \
394 || !HALF_PIC_ADDRESS_P (X))
396 /* Sometimes certain combinations of command options do not make sense
397 on a particular target machine. You can define a macro
398 `OVERRIDE_OPTIONS' to take account of this. This macro, if
399 defined, is executed once just after all the command options have
400 been parsed. */
402 #undef SUBTARGET_OVERRIDE_OPTIONS
403 #define SUBTARGET_OVERRIDE_OPTIONS \
405 /* \
406 if (TARGET_ELF && TARGET_HALF_PIC) \
408 target_flags &= ~MASK_HALF_PIC; \
409 flag_pic = 1; \
411 */ \
413 if (TARGET_ROSE && flag_pic) \
415 target_flags |= MASK_HALF_PIC; \
416 flag_pic = 0; \
419 if (TARGET_HALF_PIC) \
420 half_pic_init (); \
423 /* Define this macro if references to a symbol must be treated
424 differently depending on something about the variable or
425 function named by the symbol (such as what section it is in).
427 The macro definition, if any, is executed immediately after the
428 rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
429 The value of the rtl will be a `mem' whose address is a
430 `symbol_ref'.
432 The usual thing for this macro to do is to a flag in the
433 `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
434 name string in the `symbol_ref' (if one bit is not enough
435 information).
437 The best way to modify the name string is by adding text to the
438 beginning, with suitable punctuation to prevent any ambiguity.
439 Allocate the new name in `saveable_obstack'. You will have to
440 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
441 and output the name accordingly.
443 You can also check the information stored in the `symbol_ref' in
444 the definition of `GO_IF_LEGITIMATE_ADDRESS' or
445 `PRINT_OPERAND_ADDRESS'. */
447 #undef ENCODE_SECTION_INFO
448 #define ENCODE_SECTION_INFO(DECL, FIRST) \
449 do \
451 if (HALF_PIC_P ()) \
453 if (FIRST) \
454 HALF_PIC_ENCODE (DECL); \
456 else if (flag_pic) \
458 rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
459 ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
460 SYMBOL_REF_FLAG (XEXP (rtl, 0)) \
461 = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
462 || ! TREE_PUBLIC (DECL)); \
465 while (0)
467 /* Given a decl node or constant node, choose the section to output it in
468 and select that section. */
470 #undef SELECT_RTX_SECTION
471 #define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \
472 do \
474 if (MODE == Pmode && HALF_PIC_P () && HALF_PIC_ADDRESS_P (RTX)) \
475 data_section (); \
476 else \
477 readonly_data_section (); \
479 while (0)
481 #undef SELECT_SECTION
482 #define SELECT_SECTION(DECL, RELOC, ALIGN) \
484 if (RELOC && HALF_PIC_P ()) \
485 data_section (); \
487 else if (TREE_CODE (DECL) == STRING_CST) \
489 if (flag_writable_strings) \
490 data_section (); \
491 else \
492 readonly_data_section (); \
495 else if (TREE_CODE (DECL) != VAR_DECL) \
496 readonly_data_section (); \
498 else if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
499 || !DECL_INITIAL (DECL) \
500 || (DECL_INITIAL (DECL) != error_mark_node \
501 && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
502 data_section (); \
504 else \
505 readonly_data_section (); \
509 /* Define the strings used for the special svr4 .type and .size directives.
510 These strings generally do not vary from one system running svr4 to
511 another, but if a given system (e.g. m88k running svr) needs to use
512 different pseudo-op names for these, they may be overridden in the
513 file which includes this one. */
515 #define TYPE_ASM_OP "\t.type\t"
516 #define SIZE_ASM_OP "\t.size\t"
517 #define SET_ASM_OP "\t.set\t"
519 /* This is how we tell the assembler that a symbol is weak. */
521 #define ASM_WEAKEN_LABEL(FILE,NAME) \
522 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
523 fputc ('\n', FILE); } while (0)
525 /* The following macro defines the format used to output the second
526 operand of the .type assembler directive. Different svr4 assemblers
527 expect various different forms for this operand. The one given here
528 is just a default. You may need to override it in your machine-
529 specific tm.h file (depending upon the particulars of your assembler). */
531 #define TYPE_OPERAND_FMT "@%s"
533 /* A C statement (sans semicolon) to output to the stdio stream
534 STREAM any text necessary for declaring the name NAME of an
535 initialized variable which is being defined. This macro must
536 output the label definition (perhaps using `ASM_OUTPUT_LABEL').
537 The argument DECL is the `VAR_DECL' tree node representing the
538 variable.
540 If this macro is not defined, then the variable name is defined
541 in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
543 #undef ASM_DECLARE_OBJECT_NAME
544 #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
545 do \
547 ASM_OUTPUT_LABEL(STREAM,NAME); \
548 HALF_PIC_DECLARE (NAME); \
549 if (TARGET_ELF) \
551 fprintf (STREAM, "%s", TYPE_ASM_OP); \
552 assemble_name (STREAM, NAME); \
553 putc (',', STREAM); \
554 fprintf (STREAM, TYPE_OPERAND_FMT, "object"); \
555 putc ('\n', STREAM); \
556 size_directive_output = 0; \
557 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
559 size_directive_output = 1; \
560 fprintf (STREAM, "%s", SIZE_ASM_OP); \
561 assemble_name (STREAM, NAME); \
562 fprintf (STREAM, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
566 while (0)
568 /* Output the size directive for a decl in rest_of_decl_compilation
569 in the case where we did not do so before the initializer.
570 Once we find the error_mark_node, we know that the value of
571 size_directive_output was set
572 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
574 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
575 do { \
576 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
577 if (TARGET_ELF \
578 && !flag_inhibit_size_directive && DECL_SIZE (DECL) \
579 && ! AT_END && TOP_LEVEL \
580 && DECL_INITIAL (DECL) == error_mark_node \
581 && !size_directive_output) \
583 fprintf (FILE, "%s", SIZE_ASM_OP); \
584 assemble_name (FILE, name); \
585 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
587 } while (0)
589 /* This is how to declare a function name. */
591 #undef ASM_DECLARE_FUNCTION_NAME
592 #define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
593 do \
595 ASM_OUTPUT_LABEL(STREAM,NAME); \
596 HALF_PIC_DECLARE (NAME); \
597 if (TARGET_ELF) \
599 fprintf (STREAM, "%s", TYPE_ASM_OP); \
600 assemble_name (STREAM, NAME); \
601 putc (',', STREAM); \
602 fprintf (STREAM, TYPE_OPERAND_FMT, "function"); \
603 putc ('\n', STREAM); \
604 ASM_DECLARE_RESULT (STREAM, DECL_RESULT (DECL)); \
607 while (0)
609 /* Write the extra assembler code needed to declare a function's result.
610 Most svr4 assemblers don't require any special declaration of the
611 result value, but there are exceptions. */
613 #ifndef ASM_DECLARE_RESULT
614 #define ASM_DECLARE_RESULT(FILE, RESULT)
615 #endif
617 /* This is how to declare the size of a function. */
619 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
620 do \
622 if (TARGET_ELF && !flag_inhibit_size_directive) \
624 char label[256]; \
625 static int labelno; \
626 labelno++; \
627 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
628 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
629 fprintf (FILE, "%s", SIZE_ASM_OP); \
630 assemble_name (FILE, (FNAME)); \
631 fprintf (FILE, ","); \
632 assemble_name (FILE, label); \
633 fprintf (FILE, "-"); \
634 assemble_name (FILE, (FNAME)); \
635 putc ('\n', FILE); \
638 while (0)
640 #define IDENT_ASM_OP "\t.ident\t"
642 /* Allow #sccs in preprocessor. */
644 #define SCCS_DIRECTIVE
646 /* This says what to print at the end of the assembly file */
647 #undef ASM_FILE_END
648 #define ASM_FILE_END(STREAM) \
649 do \
651 if (HALF_PIC_P ()) \
652 HALF_PIC_FINISH (STREAM); \
653 ix86_asm_file_end (STREAM); \
655 while (0)
657 /* Tell collect that the object format is OSF/rose. */
658 #define OBJECT_FORMAT_ROSE
660 /* Tell collect where the appropriate binaries are. */
661 #define REAL_NM_FILE_NAME "/usr/ccs/gcc/bfd-nm"
662 #define REAL_STRIP_FILE_NAME "/usr/ccs/bin/strip"
664 /* Define this macro meaning that gcc should find the library 'libgcc.a'
665 by hand, rather than passing the argument '-lgcc' to tell the linker
666 to do the search */
667 #define LINK_LIBGCC_SPECIAL
669 /* Generate calls to memcpy, etc., not bcopy, etc. */
670 #define TARGET_MEM_FUNCTIONS
672 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
673 we want to retain compatibility with older gcc versions. */
674 #define DEFAULT_PCC_STRUCT_RETURN 0
676 /* Map i386 registers to the numbers dwarf expects. Of course this is
677 different from what stabs expects. */
679 #undef DBX_REGISTER_NUMBER
680 #define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \
681 ? svr4_dbx_register_map[n] \
682 : dbx_register_map[n])