OSDN Git Service

config:
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / sysv3.h
1 /* Definitions for Intel 386 running system V.
2    Copyright (C) 1988, 1996, 2000 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21
22 #include "i386/i386.h"
23
24 /* Use default settings for system V.3.  */
25
26 #include "svr3.h"
27
28 /* Use the ATT assembler syntax.
29    This overrides at least one macro (USER_LABEL_PREFIX) from svr3.h.  */
30
31 #include "i386/att.h"
32
33 /* Use crt1.o as a startup file and crtn.o as a closing file.  */
34
35 #define STARTFILE_SPEC  \
36   "%{pg:gcrt1.o%s}%{!pg:%{posix:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}%{!posix:%{p:mcrt1.o%s}%{!p:crt1.o%s}}} crtbegin.o%s\
37    %{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp}"
38
39 /* ??? There is a suggestion that -lg is needed here.
40    Does anyone know whether this is right?  */
41 #define LIB_SPEC "%{posix:-lcposix} %{shlib:-lc_s} -lc crtend.o%s crtn.o%s"
42
43 /* Specify predefined symbols in preprocessor.  */
44
45 #define CPP_PREDEFINES "-Dunix -Asystem=svr3"
46
47 #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
48
49 /* Writing `int' for a bitfield forces int alignment for the structure.  */
50
51 #define PCC_BITFIELD_TYPE_MATTERS 1
52
53 /* Don't write a `.optim' pseudo; this assembler doesn't handle them.  */
54
55 #undef ASM_FILE_START_1
56 #define ASM_FILE_START_1(FILE)
57
58 /* We want to be able to get DBX debugging information via -gstabs.  */
59
60 #undef DBX_DEBUGGING_INFO
61 #define DBX_DEBUGGING_INFO
62
63 #undef PREFERRED_DEBUGGING_TYPE
64 #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
65 \f
66 /* longjmp may fail to restore the registers if called from the same
67    function that called setjmp.  To compensate, the compiler avoids
68    putting variables in registers in functions that use both setjmp
69    and longjmp.  */
70
71 #define NON_SAVING_SETJMP \
72   (current_function_calls_setjmp && current_function_calls_longjmp)
73
74 /* longjmp may fail to restore the stack pointer if the saved frame
75    pointer is the same as the caller's frame pointer.  Requiring a frame
76    pointer in any function that calls setjmp or longjmp avoids this
77    problem, unless setjmp and longjmp are called from the same function.
78    Since a frame pointer will be required in such a function, it is OK
79    that the stack pointer is not restored.  */
80
81 #undef FRAME_POINTER_REQUIRED
82 #define FRAME_POINTER_REQUIRED \
83   (current_function_calls_setjmp || current_function_calls_longjmp)
84
85 /* Modify ASM_OUTPUT_LOCAL slightly to test -msvr3-shlib.  */
86 #undef ASM_OUTPUT_LOCAL
87 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)     \
88   do {                                                  \
89     int align = exact_log2 (ROUNDED);                   \
90     if (align > 2) align = 2;                           \
91     if (TARGET_SVR3_SHLIB)                              \
92       data_section ();                                  \
93     else                                                \
94       bss_section ();                                   \
95     ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \
96     ASM_OUTPUT_LABEL ((FILE), (NAME));                  \
97     fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED));     \
98   } while (0)
99 \f
100 /* Define a few machine-specific details of the implementation of
101    constructors.
102
103    The __CTORS_LIST__ goes in the .init section.  Define CTOR_LIST_BEGIN
104    and CTOR_LIST_END to contribute to the .init section an instruction to
105    push a word containing 0 (or some equivalent of that).
106
107    ASM_OUTPUT_CONSTRUCTOR should be defined to push the address of the
108    constructor.  */
109
110 #undef INIT_SECTION_ASM_OP
111 #define INIT_SECTION_ASM_OP     "\t.section .init,\"x\""
112
113 #define CTOR_LIST_BEGIN                         \
114   asm (INIT_SECTION_ASM_OP);                    \
115   asm ("pushl $0")
116 #define CTOR_LIST_END CTOR_LIST_BEGIN
117
118 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)       \
119   do {                                          \
120     init_section ();                            \
121     fprintf (FILE, "\tpushl $");                \
122     assemble_name (FILE, NAME);                 \
123     fprintf (FILE, "\n");                       \
124   } while (0)