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, 2004, 2007 Free Software Foundation, Inc.
4 Contributed by Ron Guilmette (rfg@monkeys.com).
6 This file is part of GCC.
8 GCC 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 3, or (at your option)
13 GCC 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 GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 /* Define a symbol indicating that we are using svr3.h. */
25 /* Define a symbol so that libgcc* can know what sort of operating
26 environment and assembler syntax we are targeting for. */
29 /* Assembler, linker, library, and startfile spec's. */
31 /* The .file command should always begin the output. */
32 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
34 /* This says how to output an assembler line
35 to define a global common symbol. */
36 /* We don't use ROUNDED because the standard compiler doesn't,
37 and the linker gives error messages if a common symbol
38 has more than one length value. */
40 #undef ASM_OUTPUT_COMMON
41 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
42 ( fputs (".comm ", (FILE)), \
43 assemble_name ((FILE), (NAME)), \
44 fprintf ((FILE), ",%lu\n", (unsigned long)(SIZE)))
46 /* This says how to output an assembler line
47 to define a local common symbol. */
49 /* Note that using bss_section here caused errors
50 in building shared libraries on system V.3. */
51 #undef ASM_OUTPUT_LOCAL
52 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
54 int align = exact_log2 (ROUNDED); \
55 if (align > 2) align = 2; \
56 switch_to_section (data_section); \
57 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
58 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
59 fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED)); \
62 /* Output #ident as a .ident. */
64 #undef ASM_OUTPUT_IDENT
65 #define ASM_OUTPUT_IDENT(FILE, NAME) \
66 fprintf (FILE, "\t.ident \"%s\"\n", NAME);
68 /* Use periods rather than dollar signs in special g++ assembler names. */
70 #define NO_DOLLAR_IN_LABEL
72 /* System V Release 3 uses COFF debugging info. */
74 #define SDB_DEBUGGING_INFO 1
76 /* We don't want to output DBX debugging information. */
78 #undef DBX_DEBUGGING_INFO
80 /* Define the actual types of some ANSI-mandated types. These
81 definitions should work for most SVR3 systems. */
84 #define SIZE_TYPE "unsigned int"
87 #define PTRDIFF_TYPE "int"
90 #define WCHAR_TYPE "long int"
92 #undef WCHAR_TYPE_SIZE
93 #define WCHAR_TYPE_SIZE BITS_PER_WORD
95 /* The prefix to add to user-visible assembler symbols.
97 For System V Release 3 the convention is to prepend a leading
98 underscore onto user-level symbol names. */
100 #undef USER_LABEL_PREFIX
101 #define USER_LABEL_PREFIX "_"
103 /* This is how to store into the string LABEL
104 the symbol_ref name of an internal numbered label where
105 PREFIX is the class of label and NUM is the number within the class.
106 This is suitable for output with `assemble_name'.
108 For most svr3 systems, the convention is that any symbol which begins
109 with a period is not put into the linker symbol table by the assembler. */
111 #undef ASM_GENERATE_INTERNAL_LABEL
112 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
113 sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM))
115 /* We want local labels to start with period if made with asm_fprintf. */
116 #undef LOCAL_LABEL_PREFIX
117 #define LOCAL_LABEL_PREFIX "."
119 /* Support const sections and the ctors and dtors sections for g++. */
121 /* Define a few machine-specific details of the implementation of
124 The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN
125 and CTOR_LIST_END to contribute to the .init section an instruction to
126 push a word containing 0 (or some equivalent of that).
128 Define TARGET_ASM_CONSTRUCTOR to push the address of the constructor. */
130 #define INIT_SECTION_ASM_OP "\t.section\t.init"
131 #define FINI_SECTION_ASM_OP "\t.section .fini,\"x\""
132 #define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP
134 /* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
135 because they push on the stack. */
137 #ifndef STACK_GROWS_DOWNWARD
139 /* Constructor list on stack is in reverse order. Go to the end of the
140 list and go backwards to call constructors in the right order. */
141 #define DO_GLOBAL_CTORS_BODY \
143 func_ptr *p, *beg = alloca (0); \
144 for (p = beg; *p; p++) \
152 /* Constructor list on stack is in correct order. Just call them. */
153 #define DO_GLOBAL_CTORS_BODY \
155 func_ptr *p, *beg = alloca (0); \
156 for (p = beg; *p; ) \
160 #endif /* STACK_GROWS_DOWNWARD */