OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [config/] [mips/] [linux.h] - Blame information for rev 820

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* 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.
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 3, 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 COPYING3.  If not see
19
<http://www.gnu.org/licenses/>.  */
20
 
21
#undef WCHAR_TYPE
22
#define WCHAR_TYPE "int"
23
 
24
#undef WCHAR_TYPE_SIZE
25
#define WCHAR_TYPE_SIZE 32
26
 
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"
35
 
36
#define ASM_OUTPUT_ALIGNED_BSS mips_output_aligned_bss
37
 
38
#undef ASM_DECLARE_OBJECT_NAME
39
#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
40
 
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
47
 
48
#undef MD_EXEC_PREFIX
49
#undef MD_STARTFILE_PREFIX
50
 
51
/* If we don't set MASK_ABICALLS, we can't default to PIC.  */
52
#undef TARGET_DEFAULT
53
#define TARGET_DEFAULT MASK_ABICALLS
54
 
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
                                                                \
62
    if (mips_abi == ABI_N32)                                    \
63
      {                                                         \
64
        builtin_define ("_ABIN32=2");                           \
65
        builtin_define ("_MIPS_SIM=_ABIN32");                   \
66
        builtin_define ("_MIPS_SZLONG=32");                     \
67
        builtin_define ("_MIPS_SZPTR=32");                      \
68
      }                                                         \
69
    else if (mips_abi == ABI_64)                                \
70
      {                                                         \
71
        builtin_define ("_ABI64=3");                            \
72
        builtin_define ("_MIPS_SIM=_ABI64");                    \
73
        builtin_define ("_MIPS_SZLONG=64");                     \
74
        builtin_define ("_MIPS_SZPTR=64");                      \
75
      }                                                         \
76
    else                                                        \
77
      {                                                         \
78
        builtin_define ("_ABIO32=1");                           \
79
        builtin_define ("_MIPS_SIM=_ABIO32");                   \
80
        builtin_define ("_MIPS_SZLONG=32");                     \
81
        builtin_define ("_MIPS_SZPTR=32");                      \
82
      }                                                         \
83
    if (TARGET_FLOAT64)                                         \
84
      builtin_define ("_MIPS_FPSET=32");                        \
85
    else                                                        \
86
      builtin_define ("_MIPS_FPSET=16");                        \
87
                                                                \
88
    builtin_define ("_MIPS_SZINT=32");                          \
89
  } while (0)
90
 
91
#undef SUBTARGET_CPP_SPEC
92
#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
93
 
94
/* A standard GNU/Linux mapping.  On most targets, it is included in
95
   CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
96
   and provides this hook instead.  */
97
#undef SUBTARGET_CC1_SPEC
98
#define SUBTARGET_CC1_SPEC "%{profile:-p}"
99
 
100
/* From iris5.h */
101
/* -G is incompatible with -KPIC which is the default, so only allow objects
102
   in the small data section if the user explicitly asks for it.  */
103
#undef MIPS_DEFAULT_GVALUE
104
#define MIPS_DEFAULT_GVALUE 0
105
 
106
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
107
 
108
/* Borrowed from sparc/linux.h */
109
#undef LINK_SPEC
110
#define LINK_SPEC \
111
 "%(endian_spec) \
112
  %{shared:-shared} \
113
  %{!shared: \
114
    %{!ibcs: \
115
      %{!static: \
116
        %{rdynamic:-export-dynamic} \
117
        %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
118
        %{static:-static}}}"
119
 
120
#undef SUBTARGET_ASM_SPEC
121
#define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
122
 
123
/* The MIPS assembler has different syntax for .set. We set it to
124
   .dummy to trap any errors.  */
125
#undef SET_ASM_OP
126
#define SET_ASM_OP "\t.dummy\t"
127
 
128
#undef ASM_OUTPUT_DEF
129
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                              \
130
 do {                                                                   \
131
        fputc ( '\t', FILE);                                            \
132
        assemble_name (FILE, LABEL1);                                   \
133
        fputs ( " = ", FILE);                                           \
134
        assemble_name (FILE, LABEL2);                                   \
135
        fputc ( '\n', FILE);                                            \
136
 } while (0)
137
 
138
#undef ASM_DECLARE_FUNCTION_NAME
139
#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL)                   \
140
  do {                                                                  \
141
    if (!flag_inhibit_size_directive)                                   \
142
      {                                                                 \
143
        fputs ("\t.ent\t", STREAM);                                     \
144
        assemble_name (STREAM, NAME);                                   \
145
        putc ('\n', STREAM);                                            \
146
      }                                                                 \
147
    ASM_OUTPUT_TYPE_DIRECTIVE (STREAM, NAME, "function");               \
148
    assemble_name (STREAM, NAME);                                       \
149
    fputs (":\n", STREAM);                                              \
150
  } while (0)
151
 
152
#undef ASM_DECLARE_FUNCTION_SIZE
153
#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL)                   \
154
  do {                                                                  \
155
    if (!flag_inhibit_size_directive)                                   \
156
      {                                                                 \
157
        fputs ("\t.end\t", STREAM);                                     \
158
        assemble_name (STREAM, NAME);                                   \
159
        putc ('\n', STREAM);                                            \
160
      }                                                                 \
161
  } while (0)
162
 
163
/* Tell function_prologue in mips.c that we have already output the .ent/.end
164
   pseudo-ops.  */
165
#undef FUNCTION_NAME_ALREADY_DECLARED
166
#define FUNCTION_NAME_ALREADY_DECLARED 1
167
 
168
/* The glibc _mcount stub will save $v0 for us.  Don't mess with saving
169
   it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
170
   presence of $gp-relative calls.  */
171
#undef ASM_OUTPUT_REG_PUSH
172
#undef ASM_OUTPUT_REG_POP
173
 
174
#undef LIB_SPEC
175
#define LIB_SPEC "\
176
%{shared: -lc} \
177
%{!shared: %{pthread:-lpthread} \
178
  %{profile:-lc_p} %{!profile: -lc}}"
179
 
180
#define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.