1 /* Operating system specific defines to be used when targeting GCC for
2 generic System V Release 3 system.
3 Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc.
4 Contributed by Ron Guilmette (rfg@monkeys.com).
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)
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 To use this file, make up a file with a name like:
27 where ????? is replaced by the name of the basic hardware that you
28 are targeting for. Then, in the file ?????svr3.h, put something
35 /* Define a symbol indicating that we are using svr3.h. */
38 /* Define a symbol so that libgcc* can know what sort of operating
39 environment and assembler syntax we are targeting for. */
42 /* Assembler, linker, library, and startfile spec's. */
44 /* Output at beginning of assembler file. */
45 /* The .file command should always begin the output. */
48 #define ASM_FILE_START(FILE) \
49 do { output_file_directive ((FILE), main_input_filename); \
52 /* This says how to output an assembler line
53 to define a global common symbol. */
54 /* We don't use ROUNDED because the standard compiler doesn't,
55 and the linker gives error messages if a common symbol
56 has more than one length value. */
58 #undef ASM_OUTPUT_COMMON
59 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
60 ( fputs (".comm ", (FILE)), \
61 assemble_name ((FILE), (NAME)), \
62 fprintf ((FILE), ",%lu\n", (unsigned long)(SIZE)))
64 /* This says how to output an assembler line
65 to define a local common symbol. */
67 /* Note that using bss_section here caused errors
68 in building shared libraries on system V.3. */
69 #undef ASM_OUTPUT_LOCAL
70 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
72 int align = exact_log2 (ROUNDED); \
73 if (align > 2) align = 2; \
75 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
76 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
77 fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED)); \
80 #if 0 /* For now, let's leave these machine-specific. */
81 /* Use crt1.o as a startup file and crtn.o as a closing file. */
83 #define STARTFILE_SPEC \
84 "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
87 #define LIB_SPEC "-lc crtn.o%s"
89 #define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc crtn.o%s"
92 /* Special flags for the linker. I don't know what they do. */
94 #define LINK_SPEC "%{T*} %{z:-lm}"
97 /* Output #ident as a .ident. */
99 #undef ASM_OUTPUT_IDENT
100 #define ASM_OUTPUT_IDENT(FILE, NAME) \
101 fprintf (FILE, "\t.ident \"%s\"\n", NAME);
103 /* Use periods rather than dollar signs in special g++ assembler names. */
105 #define NO_DOLLAR_IN_LABEL
107 /* Implicit library calls should use memcpy, not bcopy, etc. */
109 #define TARGET_MEM_FUNCTIONS
111 /* System V Release 3 uses COFF debugging info. */
113 #define SDB_DEBUGGING_INFO 1
115 /* We don't want to output DBX debugging information. */
117 #undef DBX_DEBUGGING_INFO
119 /* Define the actual types of some ANSI-mandated types. These
120 definitions should work for most SVR3 systems. */
123 #define SIZE_TYPE "unsigned int"
126 #define PTRDIFF_TYPE "int"
129 #define WCHAR_TYPE "long int"
131 #undef WCHAR_TYPE_SIZE
132 #define WCHAR_TYPE_SIZE BITS_PER_WORD
134 /* The prefix to add to user-visible assembler symbols.
136 For System V Release 3 the convention is to prepend a leading
137 underscore onto user-level symbol names. */
139 #undef USER_LABEL_PREFIX
140 #define USER_LABEL_PREFIX "_"
142 /* This is how to store into the string LABEL
143 the symbol_ref name of an internal numbered label where
144 PREFIX is the class of label and NUM is the number within the class.
145 This is suitable for output with `assemble_name'.
147 For most svr3 systems, the convention is that any symbol which begins
148 with a period is not put into the linker symbol table by the assembler. */
150 #undef ASM_GENERATE_INTERNAL_LABEL
151 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
152 sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM))
154 /* We want local labels to start with period if made with asm_fprintf. */
155 #undef LOCAL_LABEL_PREFIX
156 #define LOCAL_LABEL_PREFIX "."
158 /* Support const sections and the ctors and dtors sections for g++. */
160 /* Define a few machine-specific details of the implementation of
163 The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN
164 and CTOR_LIST_END to contribute to the .init section an instruction to
165 push a word containing 0 (or some equivalent of that).
167 Define TARGET_ASM_CONSTRUCTOR to push the address of the constructor. */
169 #define INIT_SECTION_ASM_OP "\t.section\t.init"
170 #define FINI_SECTION_ASM_OP "\t.section .fini,\"x\""
171 #define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP
173 /* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
174 because they push on the stack. */
176 #ifndef STACK_GROWS_DOWNWARD
178 /* Constructor list on stack is in reverse order. Go to the end of the
179 list and go backwards to call constructors in the right order. */
180 #define DO_GLOBAL_CTORS_BODY \
182 func_ptr *p, *beg = alloca (0); \
183 for (p = beg; *p; p++) \
191 /* Constructor list on stack is in correct order. Just call them. */
192 #define DO_GLOBAL_CTORS_BODY \
194 func_ptr *p, *beg = alloca (0); \
195 for (p = beg; *p; ) \
199 #endif /* STACK_GROWS_DOWNWARD */
201 #undef EXTRA_SECTIONS
202 #define EXTRA_SECTIONS in_init, in_fini
204 #undef EXTRA_SECTION_FUNCTIONS
205 #define EXTRA_SECTION_FUNCTIONS \
206 INIT_SECTION_FUNCTION \
207 FINI_SECTION_FUNCTION
209 #define INIT_SECTION_FUNCTION \
213 if (in_section != in_init) \
215 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \
216 in_section = in_init; \
220 #define FINI_SECTION_FUNCTION \
224 if (in_section != in_fini) \
226 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \
227 in_section = in_fini; \