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, 2010
4 Free Software Foundation, Inc.
5 Contributed by Ron Guilmette (rfg@monkeys.com).
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
23 /* Define a symbol indicating that we are using svr3.h. */
26 /* Define a symbol so that libgcc* can know what sort of operating
27 environment and assembler syntax we are targeting for. */
30 /* Assembler, linker, library, and startfile spec's. */
32 /* The .file command should always begin the output. */
33 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
35 /* This says how to output an assembler line
36 to define a global common symbol. */
37 /* We don't use ROUNDED because the standard compiler doesn't,
38 and the linker gives error messages if a common symbol
39 has more than one length value. */
41 #undef ASM_OUTPUT_COMMON
42 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
43 ( fputs (".comm ", (FILE)), \
44 assemble_name ((FILE), (NAME)), \
45 fprintf ((FILE), ",%lu\n", (unsigned long)(SIZE)))
47 /* This says how to output an assembler line
48 to define a local common symbol. */
50 /* Note that using bss_section here caused errors
51 in building shared libraries on system V.3. */
52 #undef ASM_OUTPUT_LOCAL
53 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
55 int align = exact_log2 (ROUNDED); \
56 if (align > 2) align = 2; \
57 switch_to_section (data_section); \
58 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
59 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
60 fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED)); \
63 /* Output #ident as a .ident. */
65 #undef ASM_OUTPUT_IDENT
66 #define ASM_OUTPUT_IDENT(FILE, NAME) \
67 fprintf (FILE, "\t.ident \"%s\"\n", NAME);
69 /* Use periods rather than dollar signs in special g++ assembler names. */
71 #define NO_DOLLAR_IN_LABEL
73 /* System V Release 3 uses COFF debugging info. */
75 #define SDB_DEBUGGING_INFO 1
77 /* We don't want to output DBX debugging information. */
79 #undef DBX_DEBUGGING_INFO
81 /* The prefix to add to user-visible assembler symbols.
83 For System V Release 3 the convention is to prepend a leading
84 underscore onto user-level symbol names. */
86 #undef USER_LABEL_PREFIX
87 #define USER_LABEL_PREFIX "_"
89 /* This is how to store into the string LABEL
90 the symbol_ref name of an internal numbered label where
91 PREFIX is the class of label and NUM is the number within the class.
92 This is suitable for output with `assemble_name'.
94 For most svr3 systems, the convention is that any symbol which begins
95 with a period is not put into the linker symbol table by the assembler. */
97 #undef ASM_GENERATE_INTERNAL_LABEL
98 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
99 sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM))
101 /* We want local labels to start with period if made with asm_fprintf. */
102 #undef LOCAL_LABEL_PREFIX
103 #define LOCAL_LABEL_PREFIX "."
105 /* Support const sections and the ctors and dtors sections for g++. */
107 /* Define a few machine-specific details of the implementation of
110 The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN
111 and CTOR_LIST_END to contribute to the .init section an instruction to
112 push a word containing 0 (or some equivalent of that).
114 Define TARGET_ASM_CONSTRUCTOR to push the address of the constructor. */
116 #define INIT_SECTION_ASM_OP "\t.section\t.init"
117 #define FINI_SECTION_ASM_OP "\t.section .fini,\"x\""
118 #define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP
120 /* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
121 because they push on the stack. */
123 #ifndef STACK_GROWS_DOWNWARD
125 /* Constructor list on stack is in reverse order. Go to the end of the
126 list and go backwards to call constructors in the right order. */
127 #define DO_GLOBAL_CTORS_BODY \
129 func_ptr *p, *beg = alloca (0); \
130 for (p = beg; *p; p++) \
138 /* Constructor list on stack is in correct order. Just call them. */
139 #define DO_GLOBAL_CTORS_BODY \
141 func_ptr *p, *beg = alloca (0); \
142 for (p = beg; *p; ) \
146 #endif /* STACK_GROWS_DOWNWARD */