OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / i386elf.h
1 /* Target definitions for GCC for Intel 80386 using ELF
2    Copyright (C) 1988, 1991, 1995, 2000, 2001, 2002, 2007
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 3, 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 COPYING3.  If not see
21 <http://www.gnu.org/licenses/>.  */
22
23 /* Use stabs instead of DWARF debug format.  */
24 #undef  PREFERRED_DEBUGGING_TYPE
25 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
26
27 #define TARGET_VERSION fprintf (stderr, " (i386 bare ELF target)");
28
29 /* The ELF ABI for the i386 says that records and unions are returned
30    in memory.  */
31
32 #undef RETURN_IN_MEMORY
33 #define RETURN_IN_MEMORY(TYPE) \
34   (TYPE_MODE (TYPE) == BLKmode \
35    || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
36
37 #undef CPP_SPEC
38 #define CPP_SPEC ""
39
40 #define ENDFILE_SPEC "crtend.o%s"
41
42 #define STARTFILE_SPEC "%{!shared: \
43                          %{!symbolic: \
44                           %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
45                         crtbegin.o%s"
46
47 #undef DBX_REGISTER_NUMBER
48 #define DBX_REGISTER_NUMBER(n) \
49   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
50
51 /* The routine used to output sequences of byte values.  We use a special
52    version of this for most svr4 targets because doing so makes the
53    generated assembly code more compact (and thus faster to assemble)
54    as well as more readable.  Note that if we find subparts of the
55    character sequence which end with NUL (and which are shorter than
56    STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING.  */
57
58 #undef ASM_OUTPUT_ASCII
59 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)                             \
60   do                                                                    \
61     {                                                                   \
62       const unsigned char *_ascii_bytes =                               \
63         (const unsigned char *) (STR);                                  \
64       const unsigned char *limit = _ascii_bytes + (LENGTH);             \
65       unsigned bytes_in_chunk = 0;                                      \
66       for (; _ascii_bytes < limit; _ascii_bytes++)                      \
67         {                                                               \
68           const unsigned char *p;                                       \
69           if (bytes_in_chunk >= 64)                                     \
70             {                                                           \
71               fputc ('\n', (FILE));                                     \
72               bytes_in_chunk = 0;                                       \
73             }                                                           \
74           for (p = _ascii_bytes; p < limit && *p != '\0'; p++)          \
75             continue;                                                   \
76           if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT)   \
77             {                                                           \
78               if (bytes_in_chunk > 0)                                   \
79                 {                                                       \
80                   fputc ('\n', (FILE));                                 \
81                   bytes_in_chunk = 0;                                   \
82                 }                                                       \
83               ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);         \
84               _ascii_bytes = p;                                         \
85             }                                                           \
86           else                                                          \
87             {                                                           \
88               if (bytes_in_chunk == 0)                                  \
89                 fprintf ((FILE), "\t.byte\t");                          \
90               else                                                      \
91                 fputc (',', (FILE));                                    \
92               fprintf ((FILE), "0x%02x", *_ascii_bytes);                \
93               bytes_in_chunk += 5;                                      \
94             }                                                           \
95         }                                                               \
96       if (bytes_in_chunk > 0)                                           \
97         fprintf ((FILE), "\n");                                         \
98     }                                                                   \
99   while (0)
100
101 #define LOCAL_LABEL_PREFIX      "."
102
103 /* Switch into a generic section.  */
104 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
105
106 /* If defined, a C expression whose value is a string containing the
107    assembler operation to identify the following data as
108    uninitialized global data.  If not defined, and neither
109    `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
110    uninitialized global data will be output in the data section if
111    `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
112    used.  */
113 #undef BSS_SECTION_ASM_OP
114 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
115
116 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
117    separate, explicit argument.  If you define this macro, it is used
118    in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
119    handling the required alignment of the variable.  The alignment is
120    specified as the number of bits.
121
122    Try to use function `asm_output_aligned_bss' defined in file
123    `varasm.c' when defining this macro.  */
124 #undef ASM_OUTPUT_ALIGNED_BSS
125 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
126   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)