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