OSDN Git Service

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