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