OSDN Git Service

2014-02-18 Kai Tietz <ktietz@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / sysv4.h
1 /* Target definitions for GCC for Intel 80386 running System V.4
2    Copyright (C) 1991, 2001, 2002, 2007, 2008, 2011
3    Free Software Foundation, Inc.
4
5    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 /* Output at beginning of assembler file.  */
24 /* The .file command should always begin the output.  */
25
26 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
27 #undef X86_FILE_START_VERSION_DIRECTIVE
28 #define X86_FILE_START_VERSION_DIRECTIVE true
29
30 #undef DBX_REGISTER_NUMBER
31 #define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
32
33 /* A C statement (sans semicolon) to output to the stdio stream
34    FILE the assembler definition of uninitialized global DECL named
35    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
36    Try to use asm_output_aligned_bss to implement this macro.  */
37
38 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
39   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
40
41 /* Handle special EH pointer encodings.  Absolute, pc-relative, and
42    indirect are handled automatically.  */
43 #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
44   do {                                                                  \
45     if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel)         \
46       {                                                                 \
47         fputs (ASM_LONG, (FILE));                                       \
48         assemble_name (FILE, XSTR (ADDR, 0));                           \
49         fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), (FILE)); \
50         goto DONE;                                                      \
51       }                                                                 \
52   } while (0)
53
54 /* Used by crtstuff.c to initialize the base of data-relative relocations.
55    These are GOT relative on x86, so return the pic register.  */
56 #ifdef __PIC__
57 #define CRT_GET_RFIB_DATA(BASE)                 \
58   {                                             \
59     register void *ebx_ __asm__("ebx");         \
60     BASE = ebx_;                                \
61   }
62 #else
63 #define CRT_GET_RFIB_DATA(BASE)                                         \
64   __asm__ ("call\t.LPR%=\n"                                             \
65            ".LPR%=:\n\t"                                                \
66            "pop{l}\t%0\n\t"                                             \
67            /* Due to a GAS bug, this cannot use EAX.  That encodes      \
68               smaller than the traditional EBX, which results in the    \
69               offset being off by one.  */                              \
70            "add{l}\t{$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0"              \
71                    "|%0,_GLOBAL_OFFSET_TABLE_+(.-.LPR%=)}"              \
72            : "=d"(BASE))
73 #endif