OSDN Git Service

ef30146c988d678ea87484fcd3cd750e35e87d0e
[pf3gnuchains/gcc-fork.git] / gcc / config / mips / linux64.h
1 /* Definitions for MIPS running Linux-based GNU systems with ELF format
2    using n32/64 abi.
3    Copyright 2002, 2003 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22 /* This sets the post-install default ABI to n32.  This must NOT be
23    kept in sync with the default ABI in gcc/config.gcc; it's actually
24    meant to override that.  However, for correct behavior at build
25    time, we also need t-linux64 to get the build-time specs in line
26    with the setting in config.gcc.  */
27 #define DRIVER_DEFAULT_ABI_SELF_SPEC "%{!mabi=*:-mabi=n32}"
28 #define SUBTARGET_EXTRA_SPECS \
29   { "driver_default_abi_self_spec", DRIVER_DEFAULT_ABI_SELF_SPEC },
30 #define DRIVER_SELF_SPECS \
31 "%{mabi-fake-default:%{!mabi=*:-mabi=32}}", \
32 "%(driver_default_abi_self_spec)", \
33 "%{!mips*:%{mabi=32:-mips1}%{mabi=n32:-mips3}%{mabi=64:-mips4}}"
34 #undef SUBTARGET_TARGET_SWITCHES
35 #define SUBTARGET_TARGET_SWITCHES \
36   { "abi-fake-default", 0, N_("Same as -mabi=32, just trickier") },
37
38 #undef SUBTARGET_ASM_SPEC
39 #define SUBTARGET_ASM_SPEC "\
40 %{!fno-PIC:%{!fno-pic:-KPIC}} \
41 %{fno-PIC:-non_shared} %{fno-pic:-non_shared} \
42 %{mabi=64:-64} %{mabi=n32:-n32} \
43 %{!mips*: %{mabi=n32|mabi=32:-mips3} %{mabi=64:-mips4}}"
44
45 #undef LIB_SPEC
46 #define LIB_SPEC "\
47 %{!static: \
48  %{mabi=n32:-rpath-link %R/lib32:%R/usr/lib32} \
49  %{mabi=64:-rpath-link %R/lib64:%R/usr/lib64} \
50  %{mabi=32:-rpath-link %R/lib:%R/usr/lib}} \
51 %{!shared: %{pthread:-lthread} %{profile:-lc_p} %{!profile: -lc}}"
52
53 #undef LINK_SPEC
54 #define LINK_SPEC "\
55 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
56 %{bestGnum} %{shared} %{non_shared} \
57 %{call_shared} %{no_archive} %{exact_version} \
58  %(endian_spec) \
59   %{!shared: \
60     %{!ibcs: \
61       %{!static: \
62         %{rdynamic:-export-dynamic} \
63         %{!dynamic-linker: \
64           %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
65           %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
66           %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
67       %{static:-static}}} \
68 %{mabi=n32: -melf32btsmipn32} \
69 %{mabi=64: -melf64btsmip} \
70 %{mabi=32: -melf32btsmip}"
71
72 #undef STARTFILE_PREFIX_SPEC
73 #define STARTFILE_PREFIX_SPEC "\
74 %{mabi=n32: /lib32/ /usr/lib32/} \
75 %{mabi=64: /lib64/ /usr/lib64/} \
76 %{mabi=32: /lib/ /usr/lib/}"
77
78 #undef LOCAL_LABEL_PREFIX
79 #define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
80                             ? "$" : ".")
81
82 /* The size in bytes of a DWARF field indicating an offset or length
83    relative to a debug info section, specified to be 4 bytes in the DWARF-2
84    specification.  The SGI/MIPS ABI defines it to be the same as PTR_SIZE.  */
85 #define DWARF_OFFSET_SIZE PTR_SIZE
86
87 #undef ASM_PREFERRED_EH_DATA_FORMAT
88 #if 0  /* We can't use relative addressing modes on NEWABI :-(  */
89 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL)                      \
90    (flag_pic                                                            \
91     ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_sdata4              \
92     : DW_EH_PE_absptr)
93 #endif
94
95 /* GNU/Linux doesn't use the same floating-point format that IRIX uses
96    for long double.  There's no need to override this here, since
97    ieee_quad_format is the default, but let's put this here to make
98    sure nobody thinks we just forgot to set it to something else.  */
99 #define MIPS_TFMODE_FORMAT ieee_quad_format