Bring in a trimmed down gcc-3.4-20040618.
[dragonfly.git] / contrib / gcc-3.4 / gcc / config / i386 / i386elf.h
1 /* Target definitions for GCC for Intel 80386 using ELF
2    Copyright (C) 1988, 1991, 1995, 2000, 2001, 2002
3    Free Software Foundation, Inc.
4
5    Derived from sysv4.h written by Ron Guilmette (rfg@netcom.com).
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 GCC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING.  If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.  */
23
24 /* Use stabs instead of DWARF debug format.  */
25 #undef  PREFERRED_DEBUGGING_TYPE
26 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
27
28 #define TARGET_VERSION fprintf (stderr, " (i386 bare ELF target)");
29
30 /* By default, target has a 80387, uses IEEE compatible arithmetic,
31    and returns float values in the 387.  */
32
33 #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
34
35 /* The ELF ABI for the i386 says that records and unions are returned
36    in memory.  */
37
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))
42
43 #undef CPP_SPEC
44 #define CPP_SPEC ""
45
46 #define ENDFILE_SPEC "crtend.o%s"
47
48 #define STARTFILE_SPEC "%{!shared: \
49                          %{!symbolic: \
50                           %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
51                         crtbegin.o%s"
52
53 #undef DBX_REGISTER_NUMBER
54 #define DBX_REGISTER_NUMBER(n) \
55   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
56
57 /* The routine used to output sequences of byte values.  We use a special
58    version of this for most svr4 targets because doing so makes the
59    generated assembly code more compact (and thus faster to assemble)
60    as well as more readable.  Note that if we find subparts of the
61    character sequence which end with NUL (and which are shorter than
62    STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING.  */
63
64 #undef ASM_OUTPUT_ASCII
65 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)                             \
66   do                                                                    \
67     {                                                                   \
68       const unsigned char *_ascii_bytes =                               \
69         (const unsigned char *) (STR);                                  \
70       const unsigned char *limit = _ascii_bytes + (LENGTH);             \
71       unsigned bytes_in_chunk = 0;                                      \
72       for (; _ascii_bytes < limit; _ascii_bytes++)                      \
73         {                                                               \
74           const unsigned char *p;                                       \
75           if (bytes_in_chunk >= 64)                                     \
76             {                                                           \
77               fputc ('\n', (FILE));                                     \
78               bytes_in_chunk = 0;                                       \
79             }                                                           \
80           for (p = _ascii_bytes; p < limit && *p != '\0'; p++)          \
81             continue;                                                   \
82           if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT)   \
83             {                                                           \
84               if (bytes_in_chunk > 0)                                   \
85                 {                                                       \
86                   fputc ('\n', (FILE));                                 \
87                   bytes_in_chunk = 0;                                   \
88                 }                                                       \
89               ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);         \
90               _ascii_bytes = p;                                         \
91             }                                                           \
92           else                                                          \
93             {                                                           \
94               if (bytes_in_chunk == 0)                                  \
95                 fprintf ((FILE), "\t.byte\t");                          \
96               else                                                      \
97                 fputc (',', (FILE));                                    \
98               fprintf ((FILE), "0x%02x", *_ascii_bytes);                \
99               bytes_in_chunk += 5;                                      \
100             }                                                           \
101         }                                                               \
102       if (bytes_in_chunk > 0)                                           \
103         fprintf ((FILE), "\n");                                         \
104     }                                                                   \
105   while (0)
106
107 #define LOCAL_LABEL_PREFIX      "."
108
109 /* Switch into a generic section.  */
110 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
111
112 /* If defined, a C expression whose value is a string containing the
113    assembler operation to identify the following data as
114    uninitialized global data.  If not defined, and neither
115    `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
116    uninitialized global data will be output in the data section if
117    `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
118    used.  */
119 #undef BSS_SECTION_ASM_OP
120 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
121
122 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
123    separate, explicit argument.  If you define this macro, it is used
124    in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
125    handling the required alignment of the variable.  The alignment is
126    specified as the number of bits.
127
128    Try to use function `asm_output_aligned_bss' defined in file
129    `varasm.c' when defining this macro.  */
130 #undef ASM_OUTPUT_ALIGNED_BSS
131 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
132   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)