* tm.texi: Fix markup.
[official-gcc.git] / gcc / config / i386 / i386elf.h
blob1d7d4b7e6500fa0fb321ae276c13a93b10e30509
1 /* Target definitions for GNU compiler for Intel 80386 using ELF
2 Copyright (C) 1988, 1991, 1995, 2000, 2001 Free Software Foundation, Inc.
4 Derived from sysv4.h written by Ron Guilmette (rfg@netcom.com).
6 This file is part of GNU CC.
8 GNU CC 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 2, or (at your option)
11 any later version.
13 GNU CC 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 GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* Use stabs instead of DWARF debug format. */
23 #undef PREFERRED_DEBUGGING_TYPE
24 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
26 #undef TARGET_VERSION
27 #define TARGET_VERSION fprintf (stderr, " (i386 bare ELF target)");
29 /* By default, target has a 80387, uses IEEE compatible arithmetic,
30 and returns float values in the 387. */
32 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
34 /* The ELF ABI for the i386 says that records and unions are returned
35 in memory. */
37 #undef RETURN_IN_MEMORY
38 #define RETURN_IN_MEMORY(TYPE) \
39 (TYPE_MODE (TYPE) == BLKmode \
40 || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
42 /* This used to define X86, but james@bigtex.cactus.org says that
43 is supposed to be defined optionally by user programs--not by default. */
44 #define CPP_PREDEFINES ""
46 #undef CPP_SPEC
47 #define CPP_SPEC "%(cpp_cpu)"
49 /* This is how to output assembly code to define a `float' constant.
50 We always have to use a .long pseudo-op to do this because the native
51 SVR4 ELF assembler is buggy and it generates incorrect values when we
52 try to use the .float pseudo-op instead. */
54 #undef ASM_OUTPUT_FLOAT
55 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
56 do { long value; \
57 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
58 if (sizeof (int) == sizeof (long)) \
59 fprintf((FILE), "%s0x%x\n", ASM_LONG, value); \
60 else \
61 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value); \
62 } while (0)
64 /* This is how to output assembly code to define a `double' constant.
65 We always have to use a pair of .long pseudo-ops to do this because
66 the native SVR4 ELF assembler is buggy and it generates incorrect
67 values when we try to use the the .double pseudo-op instead. */
69 #undef ASM_OUTPUT_DOUBLE
70 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
71 do { long value[2]; \
72 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
73 if (sizeof (int) == sizeof (long)) \
74 { \
75 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
76 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
77 } \
78 else \
79 { \
80 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
81 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
82 } \
83 } while (0)
86 #undef ASM_OUTPUT_LONG_DOUBLE
87 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
88 do { long value[3]; \
89 REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
90 if (sizeof (int) == sizeof (long)) \
91 { \
92 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
93 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
94 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[2]); \
95 } \
96 else \
97 { \
98 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
99 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
100 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[2]); \
102 } while (0)
104 #undef DBX_REGISTER_NUMBER
105 #define DBX_REGISTER_NUMBER(n) \
106 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
108 /* The routine used to output sequences of byte values. We use a special
109 version of this for most svr4 targets because doing so makes the
110 generated assembly code more compact (and thus faster to assemble)
111 as well as more readable. Note that if we find subparts of the
112 character sequence which end with NUL (and which are shorter than
113 STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
115 #undef ASM_OUTPUT_ASCII
116 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
117 do \
119 register const unsigned char *_ascii_bytes = \
120 (const unsigned char *) (STR); \
121 register const unsigned char *limit = _ascii_bytes + (LENGTH); \
122 register unsigned bytes_in_chunk = 0; \
123 for (; _ascii_bytes < limit; _ascii_bytes++) \
125 register const unsigned char *p; \
126 if (bytes_in_chunk >= 64) \
128 fputc ('\n', (FILE)); \
129 bytes_in_chunk = 0; \
131 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
132 continue; \
133 if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
135 if (bytes_in_chunk > 0) \
137 fputc ('\n', (FILE)); \
138 bytes_in_chunk = 0; \
140 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
141 _ascii_bytes = p; \
143 else \
145 if (bytes_in_chunk == 0) \
146 fprintf ((FILE), "\t.byte\t"); \
147 else \
148 fputc (',', (FILE)); \
149 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
150 bytes_in_chunk += 5; \
153 if (bytes_in_chunk > 0) \
154 fprintf ((FILE), "\n"); \
156 while (0)
158 /* This is how to output an element of a case-vector that is relative.
159 This is only used for PIC code. See comments by the `casesi' insn in
160 i386.md for an explanation of the expression this outputs. */
162 #undef ASM_OUTPUT_ADDR_DIFF_ELT
163 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
164 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
166 /* Indicate that jump tables go in the text section. This is
167 necessary when compiling PIC code. */
169 #define JUMP_TABLES_IN_TEXT_SECTION 1
171 #define LOCAL_LABEL_PREFIX "."
173 /* A C statement to output something to the assembler file to switch to section
174 NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
175 NULL_TREE. Some target formats do not support arbitrary sections. Do not
176 define this macro in such cases. */
178 #undef ASM_OUTPUT_SECTION_NAME
179 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
180 do { \
181 if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \
182 fprintf (FILE, ".section\t%s,\"ax\"\n", (NAME)); \
183 else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \
184 fprintf (FILE, ".section\t%s,\"a\"\n", (NAME)); \
185 else \
186 fprintf (FILE, ".section\t%s,\"aw\"\n", (NAME)); \
187 } while (0)
189 /* If defined, a C expression whose value is a string containing the
190 assembler operation to identify the following data as
191 uninitialized global data. If not defined, and neither
192 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
193 uninitialized global data will be output in the data section if
194 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
195 used. */
196 #undef BSS_SECTION_ASM_OP
197 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
199 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
200 separate, explicit argument. If you define this macro, it is used
201 in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
202 handling the required alignment of the variable. The alignment is
203 specified as the number of bits.
205 Try to use function `asm_output_aligned_bss' defined in file
206 `varasm.c' when defining this macro. */
207 #undef ASM_OUTPUT_ALIGNED_BSS
208 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
209 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)