]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/svr3.h
host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public...
[thirdparty/gcc.git] / gcc / config / svr3.h
CommitLineData
66dae892
RK
1/* Operating system specific defines to be used when targeting GCC for
2 generic System V Release 3 system.
2f83c7d6 3 Copyright (C) 1991, 1996, 2000, 2002, 2004, 2007 Free Software Foundation, Inc.
66dae892 4 Contributed by Ron Guilmette (rfg@monkeys.com).
09da0d1c 5
612aeba5 6This file is part of GCC.
09da0d1c 7
612aeba5 8GCC is free software; you can redistribute it and/or modify
09da0d1c 9it under the terms of the GNU General Public License as published by
2f83c7d6 10the Free Software Foundation; either version 3, or (at your option)
09da0d1c
RS
11any later version.
12
612aeba5 13GCC is distributed in the hope that it will be useful,
09da0d1c
RS
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
2f83c7d6
NC
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
09da0d1c 21
58535a23
TW
22/* Define a symbol indicating that we are using svr3.h. */
23#define USING_SVR3_H
24
09da0d1c
RS
25/* Define a symbol so that libgcc* can know what sort of operating
26 environment and assembler syntax we are targeting for. */
27#define SVR3_target
28
c08f71aa 29/* Assembler, linker, library, and startfile spec's. */
09da0d1c 30
09da0d1c 31/* The .file command should always begin the output. */
1bc7c5b6 32#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
09da0d1c 33
09da0d1c
RS
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. */
39
40#undef ASM_OUTPUT_COMMON
41#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
42( fputs (".comm ", (FILE)), \
43 assemble_name ((FILE), (NAME)), \
74eda121 44 fprintf ((FILE), ",%lu\n", (unsigned long)(SIZE)))
09da0d1c
RS
45
46/* This says how to output an assembler line
47 to define a local common symbol. */
48
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) \
53 do { \
54 int align = exact_log2 (ROUNDED); \
55 if (align > 2) align = 2; \
d6b5193b 56 switch_to_section (data_section); \
09da0d1c
RS
57 ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
58 ASM_OUTPUT_LABEL ((FILE), (NAME)); \
58e15542 59 fprintf ((FILE), "\t.set .,.+%u\n", (int)(ROUNDED)); \
09da0d1c
RS
60 } while (0)
61
09da0d1c
RS
62/* Output #ident as a .ident. */
63
0f658c83 64#undef ASM_OUTPUT_IDENT
09da0d1c
RS
65#define ASM_OUTPUT_IDENT(FILE, NAME) \
66 fprintf (FILE, "\t.ident \"%s\"\n", NAME);
67
68/* Use periods rather than dollar signs in special g++ assembler names. */
69
70#define NO_DOLLAR_IN_LABEL
71
09da0d1c
RS
72/* System V Release 3 uses COFF debugging info. */
73
23532de9 74#define SDB_DEBUGGING_INFO 1
09da0d1c
RS
75
76/* We don't want to output DBX debugging information. */
77
78#undef DBX_DEBUGGING_INFO
79
80/* Define the actual types of some ANSI-mandated types. These
81 definitions should work for most SVR3 systems. */
82
83#undef SIZE_TYPE
84#define SIZE_TYPE "unsigned int"
85
86#undef PTRDIFF_TYPE
87#define PTRDIFF_TYPE "int"
88
89#undef WCHAR_TYPE
90#define WCHAR_TYPE "long int"
91
92#undef WCHAR_TYPE_SIZE
93#define WCHAR_TYPE_SIZE BITS_PER_WORD
94
be97d475 95/* The prefix to add to user-visible assembler symbols.
09da0d1c
RS
96
97 For System V Release 3 the convention is to prepend a leading
98 underscore onto user-level symbol names. */
99
66dae892
RK
100#undef USER_LABEL_PREFIX
101#define USER_LABEL_PREFIX "_"
09da0d1c 102
a196f01f
RS
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'.
107
108 For most svr3 systems, the convention is that any symbol which begins
7160dd0c 109 with a period is not put into the linker symbol table by the assembler. */
a196f01f
RS
110
111#undef ASM_GENERATE_INTERNAL_LABEL
112#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
e59f7d3d 113 sprintf (LABEL, "*%s%s%ld", LOCAL_LABEL_PREFIX, PREFIX, (long)(NUM))
7160dd0c
CH
114
115/* We want local labels to start with period if made with asm_fprintf. */
116#undef LOCAL_LABEL_PREFIX
117#define LOCAL_LABEL_PREFIX "."
a196f01f 118
ae46c4e0 119/* Support const sections and the ctors and dtors sections for g++. */
09da0d1c 120
b335c2cc
TW
121/* Define a few machine-specific details of the implementation of
122 constructors.
09da0d1c 123
b335c2cc
TW
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).
09da0d1c 127
2cc07db4 128 Define TARGET_ASM_CONSTRUCTOR to push the address of the constructor. */
09da0d1c 129
e662a129
HPN
130#define INIT_SECTION_ASM_OP "\t.section\t.init"
131#define FINI_SECTION_ASM_OP "\t.section .fini,\"x\""
09da0d1c 132#define DTORS_SECTION_ASM_OP FINI_SECTION_ASM_OP
b335c2cc
TW
133
134/* CTOR_LIST_BEGIN and CTOR_LIST_END are machine-dependent
135 because they push on the stack. */
09da0d1c 136
e5952538 137#ifndef STACK_GROWS_DOWNWARD
91141d4f
RS
138
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 \
142do { \
143 func_ptr *p, *beg = alloca (0); \
144 for (p = beg; *p; p++) \
145 ; \
146 while (p != beg) \
147 (*--p) (); \
09da0d1c
RS
148} while (0)
149
91141d4f
RS
150#else
151
152/* Constructor list on stack is in correct order. Just call them. */
153#define DO_GLOBAL_CTORS_BODY \
154do { \
155 func_ptr *p, *beg = alloca (0); \
156 for (p = beg; *p; ) \
157 (*p++) (); \
91141d4f
RS
158} while (0)
159
160#endif /* STACK_GROWS_DOWNWARD */