OSDN Git Service

fixincludes:
[pf3gnuchains/gcc-fork.git] / gcc / config / pa / pa-linux.h
1 /* Definitions for PA_RISC with ELF format
2    Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
3    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
22 #undef TARGET_OS_CPP_BUILTINS
23 #define TARGET_OS_CPP_BUILTINS()                \
24   do                                            \
25     {                                           \
26         LINUX_TARGET_OS_CPP_BUILTINS();         \
27         builtin_assert ("machine=bigendian");   \
28     }                                           \
29   while (0)
30
31 #undef CPP_SPEC
32 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
33
34 #undef  LIB_SPEC
35 #define LIB_SPEC \
36   "%{pthread:-lpthread} \
37    %{shared:-lgcc -lc} \
38    %{!shared:%{mieee-fp:-lieee} %{shared-libgcc:-lgcc} %{profile:-lc_p}%{!profile:-lc}}"
39
40 #undef ASM_SPEC
41 #define ASM_SPEC \
42   "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
43
44 /* Define this for shared library support because it isn't in the main
45    linux.h file.  */
46
47 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
48
49 #undef LINK_SPEC
50 #define LINK_SPEC "\
51   %{shared:-shared} \
52   %{!shared: \
53     %{!static: \
54       %{rdynamic:-export-dynamic} \
55       %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
56       %{static:-static}}"
57
58 /* glibc's profiling functions don't need gcc to allocate counters.  */
59 #define NO_DEFERRED_PROFILE_COUNTERS 1
60
61 /* Define the strings used for the special svr4 .type and .size directives.
62    These strings generally do not vary from one system running svr4 to
63    another, but if a given system (e.g. m88k running svr) needs to use
64    different pseudo-op names for these, they may be overridden in the
65    file which includes this one.  */
66
67 #undef STRING_ASM_OP
68 #define STRING_ASM_OP   "\t.stringz\t"
69
70 #define TEXT_SECTION_ASM_OP "\t.text"
71 #define DATA_SECTION_ASM_OP "\t.data"
72 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
73
74 #define TARGET_ASM_FILE_START pa_linux_file_start
75
76 /* We want local labels to start with period if made with asm_fprintf.  */
77 #undef LOCAL_LABEL_PREFIX
78 #define LOCAL_LABEL_PREFIX "."
79
80 /* Define these to generate the Linux/ELF/SysV style of internal
81    labels all the time - i.e. to be compatible with
82    ASM_GENERATE_INTERNAL_LABEL in <elfos.h>.  Compare these with the
83    ones in pa.h and note the lack of dollar signs in these.  FIXME:
84    shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
85
86 #undef ASM_OUTPUT_ADDR_VEC_ELT
87 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
88   if (TARGET_BIG_SWITCH)                                        \
89     fprintf (FILE, "\t.word .L%d\n", VALUE);                    \
90   else                                                          \
91     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
92
93 #undef ASM_OUTPUT_ADDR_DIFF_ELT
94 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
95   if (TARGET_BIG_SWITCH)                                        \
96     fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL);          \
97   else                                                          \
98     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
99
100 /* Use the default.  */
101 #undef ASM_OUTPUT_LABEL
102
103 /* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
104    does what we want (i.e. uses colons).  It must be compatible with
105    ASM_GENERATE_INTERNAL_LABEL(), so do not define it here.  */
106
107 /* Use the default.  */
108 #undef ASM_OUTPUT_INTERNAL_LABEL
109
110 /* Use the default.  */
111 #undef TARGET_ASM_GLOBALIZE_LABEL
112 /* Globalizing directive for a label.  */
113 #define GLOBAL_ASM_OP ".globl "
114
115 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
116    labels in a function declaration (since pa.c seems determined to do
117    it differently)  */
118
119 #undef ASM_DECLARE_FUNCTION_NAME
120 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)             \
121   do                                                            \
122     {                                                           \
123       ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");       \
124       ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));            \
125     }                                                           \
126   while (0)
127
128 /* As well as globalizing the label, we need to encode the label
129    to ensure a plabel is generated in an indirect call.  */
130
131 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
132 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)                  \
133   do                                                            \
134     {                                                           \
135       if (!FUNCTION_NAME_P (XSTR (FUN, 0)))                     \
136         hppa_encode_label (FUN);                                \
137       (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
138     }                                                           \
139   while (0)
140
141 /* Linux always uses gas.  */
142 #undef TARGET_GAS
143 #define TARGET_GAS 1