]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/i386elf.h
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)
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, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* Use stabs instead of DWARF debug format. */
24 #undef PREFERRED_DEBUGGING_TYPE
25 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
28 #define TARGET_VERSION fprintf (stderr, " (i386 bare ELF target)");
30 /* By default, target has a 80387, uses IEEE compatible arithmetic,
31 and returns float values in the 387. */
33 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
35 /* The ELF ABI for the i386 says that records and unions are returned
38 #undef RETURN_IN_MEMORY
39 #define RETURN_IN_MEMORY(TYPE) \
40 (TYPE_MODE (TYPE) == BLKmode \
41 || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
43 /* This used to define X86, but james@bigtex.cactus.org says that
44 is supposed to be defined optionally by user programs--not by default. */
45 #define CPP_PREDEFINES ""
48 #define CPP_SPEC "%(cpp_cpu)"
50 /* This is how to output assembly code to define a `float' constant.
51 We always have to use a .long pseudo-op to do this because the native
52 SVR4 ELF assembler is buggy and it generates incorrect values when we
53 try to use the .float pseudo-op instead. */
55 #undef ASM_OUTPUT_FLOAT
56 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
58 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
59 if (sizeof (int) == sizeof (long)) \
60 fprintf((FILE), "%s0x%x\n", ASM_LONG, value); \
62 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value); \
65 /* This is how to output assembly code to define a `double' constant.
66 We always have to use a pair of .long pseudo-ops to do this because
67 the native SVR4 ELF assembler is buggy and it generates incorrect
68 values when we try to use the the .double pseudo-op instead. */
70 #undef ASM_OUTPUT_DOUBLE
71 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
73 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
74 if (sizeof (int) == sizeof (long)) \
76 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
77 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
81 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
82 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
87 #undef ASM_OUTPUT_LONG_DOUBLE
88 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
90 REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
91 if (sizeof (int) == sizeof (long)) \
93 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
94 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
95 fprintf((FILE), "%s0x%x\n", ASM_LONG, value[2]); \
99 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
100 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
101 fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[2]); \
105 #undef DBX_REGISTER_NUMBER
106 #define DBX_REGISTER_NUMBER(n) \
107 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
109 /* The routine used to output sequences of byte values. We use a special
110 version of this for most svr4 targets because doing so makes the
111 generated assembly code more compact (and thus faster to assemble)
112 as well as more readable. Note that if we find subparts of the
113 character sequence which end with NUL (and which are shorter than
114 STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
116 #undef ASM_OUTPUT_ASCII
117 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
120 register const unsigned char *_ascii_bytes = \
121 (const unsigned char *) (STR); \
122 register const unsigned char *limit = _ascii_bytes + (LENGTH); \
123 register unsigned bytes_in_chunk = 0; \
124 for (; _ascii_bytes < limit; _ascii_bytes++) \
126 register const unsigned char *p; \
127 if (bytes_in_chunk >= 64) \
129 fputc ('\n', (FILE)); \
130 bytes_in_chunk = 0; \
132 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
134 if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
136 if (bytes_in_chunk > 0) \
138 fputc ('\n', (FILE)); \
139 bytes_in_chunk = 0; \
141 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
146 if (bytes_in_chunk == 0) \
147 fprintf ((FILE), "\t.byte\t"); \
149 fputc (',', (FILE)); \
150 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
151 bytes_in_chunk += 5; \
154 if (bytes_in_chunk > 0) \
155 fprintf ((FILE), "\n"); \
159 #define LOCAL_LABEL_PREFIX "."
161 /* Switch into a generic section. */
162 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
164 /* If defined, a C expression whose value is a string containing the
165 assembler operation to identify the following data as
166 uninitialized global data. If not defined, and neither
167 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
168 uninitialized global data will be output in the data section if
169 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
171 #undef BSS_SECTION_ASM_OP
172 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
174 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
175 separate, explicit argument. If you define this macro, it is used
176 in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
177 handling the required alignment of the variable. The alignment is
178 specified as the number of bits.
180 Try to use function `asm_output_aligned_bss' defined in file
181 `varasm.c' when defining this macro. */
182 #undef ASM_OUTPUT_ALIGNED_BSS
183 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
184 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)