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