mips.c (mips_file_start): Add ".previous" directives to both ".section"s.
[official-gcc.git] / gcc / config / mips / linux.h
blob7a8dc7210b8e242122b02b77dce5d5db1e2ed925
1 /* Definitions for MIPS running Linux-based GNU systems with ELF format.
2 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
3 2007 Free Software Foundation, Inc.
5 This file is part of GCC.
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 3, or (at your option)
10 any later version.
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.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #undef WCHAR_TYPE
22 #define WCHAR_TYPE "int"
24 #undef WCHAR_TYPE_SIZE
25 #define WCHAR_TYPE_SIZE 32
27 /* If defined, a C expression whose value is a string containing the
28 assembler operation to identify the following data as
29 uninitialized global data. If not defined, and neither
30 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
31 uninitialized global data will be output in the data section if
32 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
33 used. */
34 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
36 #define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss
38 #undef ASM_DECLARE_OBJECT_NAME
39 #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
41 #undef TARGET_VERSION
42 #if TARGET_ENDIAN_DEFAULT == 0
43 #define TARGET_VERSION fprintf (stderr, " (MIPSel GNU/Linux with ELF)");
44 #else
45 #define TARGET_VERSION fprintf (stderr, " (MIPS GNU/Linux with ELF)");
46 #endif
48 #undef MD_EXEC_PREFIX
49 #undef MD_STARTFILE_PREFIX
51 /* If we don't set MASK_ABICALLS, we can't default to PIC. */
52 #undef TARGET_DEFAULT
53 #define TARGET_DEFAULT MASK_ABICALLS
55 #define TARGET_OS_CPP_BUILTINS() \
56 do { \
57 LINUX_TARGET_OS_CPP_BUILTINS(); \
58 /* The GNU C++ standard library requires this. */ \
59 if (c_dialect_cxx ()) \
60 builtin_define ("_GNU_SOURCE"); \
61 } while (0)
63 #undef SUBTARGET_CPP_SPEC
64 #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
66 /* A standard GNU/Linux mapping. On most targets, it is included in
67 CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
68 and provides this hook instead. */
69 #undef SUBTARGET_CC1_SPEC
70 #define SUBTARGET_CC1_SPEC "%{profile:-p}"
72 /* From iris5.h */
73 /* -G is incompatible with -KPIC which is the default, so only allow objects
74 in the small data section if the user explicitly asks for it. */
75 #undef MIPS_DEFAULT_GVALUE
76 #define MIPS_DEFAULT_GVALUE 0
78 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
80 /* Borrowed from sparc/linux.h */
81 #undef LINK_SPEC
82 #define LINK_SPEC \
83 "%(endian_spec) \
84 %{shared:-shared} \
85 %{!shared: \
86 %{!ibcs: \
87 %{!static: \
88 %{rdynamic:-export-dynamic} \
89 %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
90 %{static:-static}}}"
92 #undef SUBTARGET_ASM_SPEC
93 #define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
95 /* The MIPS assembler has different syntax for .set. We set it to
96 .dummy to trap any errors. */
97 #undef SET_ASM_OP
98 #define SET_ASM_OP "\t.dummy\t"
100 #undef ASM_OUTPUT_DEF
101 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
102 do { \
103 fputc ( '\t', FILE); \
104 assemble_name (FILE, LABEL1); \
105 fputs ( " = ", FILE); \
106 assemble_name (FILE, LABEL2); \
107 fputc ( '\n', FILE); \
108 } while (0)
110 #undef ASM_DECLARE_FUNCTION_NAME
111 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
112 do { \
113 if (!flag_inhibit_size_directive) \
115 fputs ("\t.ent\t", STREAM); \
116 assemble_name (STREAM, NAME); \
117 putc ('\n', STREAM); \
119 ASM_OUTPUT_TYPE_DIRECTIVE (STREAM, NAME, "function"); \
120 assemble_name (STREAM, NAME); \
121 fputs (":\n", STREAM); \
122 } while (0)
124 #undef ASM_DECLARE_FUNCTION_SIZE
125 #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \
126 do { \
127 if (!flag_inhibit_size_directive) \
129 fputs ("\t.end\t", STREAM); \
130 assemble_name (STREAM, NAME); \
131 putc ('\n', STREAM); \
133 } while (0)
135 /* Tell function_prologue in mips.c that we have already output the .ent/.end
136 pseudo-ops. */
137 #undef FUNCTION_NAME_ALREADY_DECLARED
138 #define FUNCTION_NAME_ALREADY_DECLARED 1
140 /* The glibc _mcount stub will save $v0 for us. Don't mess with saving
141 it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
142 presence of $gp-relative calls. */
143 #undef ASM_OUTPUT_REG_PUSH
144 #undef ASM_OUTPUT_REG_POP
146 #undef LIB_SPEC
147 #define LIB_SPEC "\
148 %{pthread:-lpthread} \
149 %{shared:-lc} \
150 %{!shared: \
151 %{profile:-lc_p} %{!profile:-lc}}"
153 #define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h"
155 #ifdef HAVE_AS_NO_SHARED
156 /* Default to -mno-shared for non-PIC. */
157 #define NO_SHARED_SPECS \
158 "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"
159 #define DRIVER_SELF_SPECS NO_SHARED_SPECS
160 #else
161 #define NO_SHARED_SPECS
162 #endif