OSDN Git Service

2008-05-07 Kai Tietz <kai,tietz@onevision.com>
[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 TARGET_RETURN_IN_MEMORY
33 #define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
34
35 #undef CPP_SPEC
36 #define CPP_SPEC ""
37
38 #define ENDFILE_SPEC "crtend.o%s"
39
40 #define STARTFILE_SPEC "%{!shared: \
41                          %{!symbolic: \
42                           %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
43                         crtbegin.o%s"
44
45 #undef DBX_REGISTER_NUMBER
46 #define DBX_REGISTER_NUMBER(n) \
47   (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
48
49 /* The routine used to output sequences of byte values.  We use a special
50    version of this for most svr4 targets because doing so makes the
51    generated assembly code more compact (and thus faster to assemble)
52    as well as more readable.  Note that if we find subparts of the
53    character sequence which end with NUL (and which are shorter than
54    STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING.  */
55
56 #undef ASM_OUTPUT_ASCII
57 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)                             \
58   do                                                                    \
59     {                                                                   \
60       const unsigned char *_ascii_bytes =                               \
61         (const unsigned char *) (STR);                                  \
62       const unsigned char *limit = _ascii_bytes + (LENGTH);             \
63       unsigned bytes_in_chunk = 0;                                      \
64       for (; _ascii_bytes < limit; _ascii_bytes++)                      \
65         {                                                               \
66           const unsigned char *p;                                       \
67           if (bytes_in_chunk >= 64)                                     \
68             {                                                           \
69               fputc ('\n', (FILE));                                     \
70               bytes_in_chunk = 0;                                       \
71             }                                                           \
72           for (p = _ascii_bytes; p < limit && *p != '\0'; p++)          \
73             continue;                                                   \
74           if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT)   \
75             {                                                           \
76               if (bytes_in_chunk > 0)                                   \
77                 {                                                       \
78                   fputc ('\n', (FILE));                                 \
79                   bytes_in_chunk = 0;                                   \
80                 }                                                       \
81               ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);         \
82               _ascii_bytes = p;                                         \
83             }                                                           \
84           else                                                          \
85             {                                                           \
86               if (bytes_in_chunk == 0)                                  \
87                 fprintf ((FILE), "\t.byte\t");                          \
88               else                                                      \
89                 fputc (',', (FILE));                                    \
90               fprintf ((FILE), "0x%02x", *_ascii_bytes);                \
91               bytes_in_chunk += 5;                                      \
92             }                                                           \
93         }                                                               \
94       if (bytes_in_chunk > 0)                                           \
95         fprintf ((FILE), "\n");                                         \
96     }                                                                   \
97   while (0)
98
99 #define LOCAL_LABEL_PREFIX      "."
100
101 /* Switch into a generic section.  */
102 #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
103
104 /* If defined, a C expression whose value is a string containing the
105    assembler operation to identify the following data as
106    uninitialized global data.  If not defined, and neither
107    `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
108    uninitialized global data will be output in the data section if
109    `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
110    used.  */
111 #undef BSS_SECTION_ASM_OP
112 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
113
114 /* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
115    separate, explicit argument.  If you define this macro, it is used
116    in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
117    handling the required alignment of the variable.  The alignment is
118    specified as the number of bits.
119
120    Try to use function `asm_output_aligned_bss' defined in file
121    `varasm.c' when defining this macro.  */
122 #undef ASM_OUTPUT_ALIGNED_BSS
123 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
124   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)