Added PIC capability.
[unix-history] / gnu / usr.bin / cc / lib / tm.h
CommitLineData
b2254bec
PR
1/* Configuration for an i386 running 386BSD as the target machine. */
2
3/* This is tested by i386gas.h. */
4#define YES_UNDERSCORES
5
6#include "i386/gstabs.h"
7
8/* Get perform_* macros to build libgcc.a. */
9#include "i386/perform.h"
10
11#undef CPP_PREDEFINES
12#define CPP_PREDEFINES "-Dunix -Di386 -D____386BSD____ -D__386BSD__ -DBSD_NET2"
13
14/* Like the default, except no -lg. */
15#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
16
17#undef SIZE_TYPE
18#define SIZE_TYPE "unsigned int"
19
20#undef PTRDIFF_TYPE
21#define PTRDIFF_TYPE "int"
22
23#undef WCHAR_TYPE
24#define WCHAR_TYPE "short unsigned int"
25
26#define WCHAR_UNSIGNED 1
27
28#undef WCHAR_TYPE_SIZE
29#define WCHAR_TYPE_SIZE 16
30
31/* 386BSD does have atexit. */
32
33#define HAVE_ATEXIT
34
35/* Redefine this to use %eax instead of %edx. */
36#undef FUNCTION_PROFILER
37#define FUNCTION_PROFILER(FILE, LABELNO) \
38{ \
39 if (flag_pic) \
40 { \
41 fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \
42 LPREFIX, (LABELNO)); \
43 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
44 } \
45 else \
46 { \
47 fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \
48 fprintf (FILE, "\tcall mcount\n"); \
49 } \
50}
51
52/* There are conflicting reports about whether this system uses
53 a different assembler syntax. wilson@cygnus.com says # is right. */
54#undef COMMENT_BEGIN
55#define COMMENT_BEGIN "#"
56
57#undef ASM_APP_ON
58#define ASM_APP_ON "#APP\n"
59
60#undef ASM_APP_OFF
61#define ASM_APP_OFF "#NO_APP\n"
62\f
63/* The following macros are stolen from i386v4.h */
64/* These have to be defined to get PIC code correct */
65
66/* This is how to output an element of a case-vector that is relative.
67 This is only used for PIC code. See comments by the `casesi' insn in
68 i386.md for an explanation of the expression this outputs. */
69
70#undef ASM_OUTPUT_ADDR_DIFF_ELT
71#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
72 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
73
74/* Indicate that jump tables go in the text section. This is
75 necessary when compiling PIC code. */
76
77#define JUMP_TABLES_IN_TEXT_SECTION
78
79/* Don't default to pcc-struct-return, because gcc is the only compiler, and
80 we want to retain compatibility with older gcc versions. */
81#define DEFAULT_PCC_STRUCT_RETURN 0
d899626a
PR
82
83/*
84 * Some imports from svr4.h in support of shared libraries.
85 * Currently, we need the DECLARE_OBJECT_SIZE stuff.
86 */
87
88/* Define the strings used for the special svr4 .type and .size directives.
89 These strings generally do not vary from one system running svr4 to
90 another, but if a given system (e.g. m88k running svr) needs to use
91 different pseudo-op names for these, they may be overridden in the
92 file which includes this one. */
93
94#define TYPE_ASM_OP ".type"
95#define SIZE_ASM_OP ".size"
96#define WEAK_ASM_OP ".weak"
97
98/* The following macro defines the format used to output the second
99 operand of the .type assembler directive. Different svr4 assemblers
100 expect various different forms for this operand. The one given here
101 is just a default. You may need to override it in your machine-
102 specific tm.h file (depending upon the particulars of your assembler). */
103
104#define TYPE_OPERAND_FMT "@%s"
105
106/* Write the extra assembler code needed to declare a function's result.
107 Most svr4 assemblers don't require any special declaration of the
108 result value, but there are exceptions. */
109
110#ifndef ASM_DECLARE_RESULT
111#define ASM_DECLARE_RESULT(FILE, RESULT)
112#endif
113
114/* These macros generate the special .type and .size directives which
115 are used to set the corresponding fields of the linker symbol table
116 entries in an ELF object file under SVR4. These macros also output
117 the starting labels for the relevant functions/objects. */
118
119/* Write the extra assembler code needed to declare a function properly.
120 Some svr4 assemblers need to also have something extra said about the
121 function's return value. We allow for that here. */
122
123#ifdef notyet
124#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
125 do { \
126 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
127 assemble_name (FILE, NAME); \
128 putc (',', FILE); \
129 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
130 putc ('\n', FILE); \
131 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
132 ASM_OUTPUT_LABEL(FILE, NAME); \
133 } while (0)
134
135/* Write the extra assembler code needed to declare an object properly. */
136
137#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
138 do { \
139 fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
140 assemble_name (FILE, NAME); \
141 putc (',', FILE); \
142 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
143 putc ('\n', FILE); \
144 if (!flag_inhibit_size_directive) \
145 { \
146 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
147 assemble_name (FILE, NAME); \
148 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (decl))); \
149 } \
150 ASM_OUTPUT_LABEL(FILE, NAME); \
151 } while (0)
152
153/* This is how to declare the size of a function. */
154
155#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
156 do { \
157 if (!flag_inhibit_size_directive) \
158 { \
159 char label[256]; \
160 static int labelno; \
161 labelno++; \
162 ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
163 ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
164 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
165 assemble_name (FILE, (FNAME)); \
166 fprintf (FILE, ","); \
167 assemble_name (FILE, label); \
168 fprintf (FILE, "-"); \
169 assemble_name (FILE, (FNAME)); \
170 putc ('\n', FILE); \
171 } \
172 } while (0)
173#endif
174
175#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
176 do { \
177 if (!flag_inhibit_size_directive) \
178 { \
179 fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
180 assemble_name (FILE, NAME); \
181 fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (decl))); \
182 } \
183 ASM_OUTPUT_LABEL(FILE, NAME); \
184 } while (0)