1 /* Target definitions for GCC for Intel 80386 running System V.4
2 Copyright (C) 1991, 2001, 2002 Free Software Foundation, Inc.
4 Written by Ron Guilmette (rfg@netcom.com).
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
24 #define TARGET_VERSION fprintf (stderr, " (i386 System V Release 4)");
26 /* The svr4 ABI for the i386 says that records and unions are returned
29 #undef RETURN_IN_MEMORY
30 #define RETURN_IN_MEMORY(TYPE) \
31 (TYPE_MODE (TYPE) == BLKmode \
32 || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
34 /* Output at beginning of assembler file. */
35 /* The .file command should always begin the output. */
37 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
38 #undef X86_FILE_START_VERSION_DIRECTIVE
39 #define X86_FILE_START_VERSION_DIRECTIVE true
41 #undef DBX_REGISTER_NUMBER
42 #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
44 /* The routine used to output sequences of byte values. We use a special
45 version of this for most svr4 targets because doing so makes the
46 generated assembly code more compact (and thus faster to assemble)
47 as well as more readable. Note that if we find subparts of the
48 character sequence which end with NUL (and which are shorter than
49 STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
51 #undef ASM_OUTPUT_ASCII
52 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
55 const unsigned char *_ascii_bytes = \
56 (const unsigned char *) (STR); \
57 const unsigned char *limit = _ascii_bytes + (LENGTH); \
58 unsigned bytes_in_chunk = 0; \
59 for (; _ascii_bytes < limit; _ascii_bytes++) \
61 const unsigned char *p; \
62 if (bytes_in_chunk >= 64) \
64 fputc ('\n', (FILE)); \
67 for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
69 if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT) \
71 if (bytes_in_chunk > 0) \
73 fputc ('\n', (FILE)); \
76 ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
81 if (bytes_in_chunk == 0) \
82 fprintf ((FILE), "\t.byte\t"); \
84 fputc (',', (FILE)); \
85 fprintf ((FILE), "0x%02x", *_ascii_bytes); \
86 bytes_in_chunk += 5; \
89 if (bytes_in_chunk > 0) \
90 fprintf ((FILE), "\n"); \
94 /* A C statement (sans semicolon) to output to the stdio stream
95 FILE the assembler definition of uninitialized global DECL named
96 NAME whose size is SIZE bytes and alignment is ALIGN bytes.
97 Try to use asm_output_aligned_bss to implement this macro. */
99 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
100 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
102 /* Handle special EH pointer encodings. Absolute, pc-relative, and
103 indirect are handled automatically. */
104 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
106 if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
108 fputs (ASM_LONG, FILE); \
109 assemble_name (FILE, XSTR (ADDR, 0)); \
110 fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
115 /* Used by crtstuff.c to initialize the base of data-relative relocations.
116 These are GOT relative on x86, so return the pic register. */
118 #define CRT_GET_RFIB_DATA(BASE) \
120 register void *ebx_ __asm__("ebx"); \
124 #define CRT_GET_RFIB_DATA(BASE) \
125 __asm__ ("call\t.LPR%=\n" \
128 /* Due to a GAS bug, this cannot use EAX. That encodes \
129 smaller than the traditional EBX, which results in the \
130 offset being off by one. */ \
131 "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \