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.
5 Derived from sysv4.h written by Ron Guilmette (rfg@netcom.com).
7 This file is part of GCC.
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)
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.
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/>. */
23 /* Use stabs instead of DWARF debug format. */
24 #undef PREFERRED_DEBUGGING_TYPE
25 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
27 #define TARGET_VERSION fprintf (stderr, " (i386 bare ELF target)");
29 /* The ELF ABI for the i386 says that records and unions are returned
32 #undef TARGET_RETURN_IN_MEMORY
33 #define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
38 #define ENDFILE_SPEC "crtend.o%s"
40 #define STARTFILE_SPEC "%{!shared: \
42 %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
45 #undef DBX_REGISTER_NUMBER
46 #define DBX_REGISTER_NUMBER(n) \
47 (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
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. */
56 #undef ASM_OUTPUT_ASCII
57 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
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++) \
66 const unsigned char *p; \
67 if (bytes_in_chunk >= 64) \
69 fputc ('\n', (FILE)); \
72 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
74 if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT) \
76 if (bytes_in_chunk > 0) \
78 fputc ('\n', (FILE)); \
81 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
86 if (bytes_in_chunk == 0) \
87 fprintf ((FILE), "\t.byte\t"); \
89 fputc (',', (FILE)); \
90 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
91 bytes_in_chunk += 5; \
94 if (bytes_in_chunk > 0) \
95 fprintf ((FILE), "\n"); \
99 #define LOCAL_LABEL_PREFIX "."
101 /* Switch into a generic section. */
102 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
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
111 #undef BSS_SECTION_ASM_OP
112 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
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.
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)