OSDN Git Service

* pa-linux.h (LIB_SPEC): Update definition.
[pf3gnuchains/gcc-fork.git] / gcc / config / pa / pa-linux.h
1 /* Definitions for PA_RISC with ELF format
2    Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* Use DWARF2 debugging info and unwind.  */
22 #undef PREFERRED_DEBUGGING_TYPE
23 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
24 #define DWARF2_ASM_LINE_DEBUG_INFO 1
25 #define DWARF2_UNWIND_INFO 1
26
27 #undef CPP_PREDEFINES
28 #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian"
29
30 #undef  LIB_SPEC
31 #define LIB_SPEC \
32   "%{shared: -lgcc -lc} \
33    %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
34         %{shared-libgcc: -lgcc} %{profile:-lc_p} %{!profile: -lc}}"
35
36 #undef ASM_SPEC
37 #define ASM_SPEC \
38   "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
39
40 /* Define this for shared library support because it isn't in the main
41    linux.h file.  */
42
43 #undef LINK_SPEC
44 #define LINK_SPEC "\
45   %{shared:-shared} \
46   %{!shared: \
47     %{!static: \
48       %{rdynamic:-export-dynamic} \
49       %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
50       %{static:-static}}"
51
52 /* Sibcalls, stubs, and elf sections don't play well.  */
53 #undef FUNCTION_OK_FOR_SIBCALL
54 #define FUNCTION_OK_FOR_SIBCALL(x) 0
55
56 /* glibc's profiling functions don't need gcc to allocate counters.  */
57 #define NO_PROFILE_COUNTERS 1
58
59 /* Put plabels into the data section so we can relocate them.  */
60 #undef SELECT_RTX_SECTION
61 #define SELECT_RTX_SECTION(MODE,RTX,ALIGN)      \
62   if (flag_pic && function_label_operand (RTX, MODE))   \
63     data_section ();                                    \
64   else                                                  \
65     readonly_data_section ();
66
67 /* A C expression whose value is RTL representing the location of the
68    incoming return address at the beginning of any function, before the
69    prologue.  */
70 #define INCOMING_RETURN_ADDR_RTX  (gen_rtx_REG (word_mode, 2))
71 #define DWARF_FRAME_RETURN_COLUMN (DWARF_FRAME_REGNUM (2))
72
73 /* Define the strings used for the special svr4 .type and .size directives.
74    These strings generally do not vary from one system running svr4 to
75    another, but if a given system (e.g. m88k running svr) needs to use
76    different pseudo-op names for these, they may be overridden in the
77    file which includes this one.  */
78
79 #undef STRING_ASM_OP
80 #define STRING_ASM_OP   ".stringz"
81
82 #define TEXT_SECTION_ASM_OP "\t.text"
83 #define DATA_SECTION_ASM_OP "\t.data"
84 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
85
86 /* Output at beginning of assembler file.  We override the definition
87    from <linux.h> so that we can get the proper .LEVEL directive.  */
88 #undef ASM_FILE_START
89 #define ASM_FILE_START(FILE) \
90   do                                                            \
91     {                                                           \
92       if (write_symbols != NO_DEBUG)                            \
93         {                                                       \
94           output_file_directive (FILE, main_input_filename);    \
95           fputs ("\t.version\t\"01.01\"\n", FILE);              \
96         }                                                       \
97       if (TARGET_64BIT)                                         \
98         fputs("\t.LEVEL 2.0w\n", FILE);                         \
99       else if (TARGET_PA_20)                                    \
100         fputs("\t.LEVEL 2.0\n", FILE);                          \
101       else if (TARGET_PA_11)                                    \
102         fputs("\t.LEVEL 1.1\n", FILE);                          \
103       else                                                      \
104         fputs("\t.LEVEL 1.0\n", FILE);                          \
105       if (profile_flag)                                         \
106         fputs ("\t.IMPORT _mcount, CODE\n", FILE);              \
107     }                                                           \
108    while (0)
109
110 /* Output a definition */
111 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
112   do                                                            \
113     {                                                           \
114       fprintf ((FILE), "\t%s\t", SET_ASM_OP);                   \
115       assemble_name (FILE, LABEL1);                             \
116       fprintf (FILE, ",");                                      \
117       assemble_name (FILE, LABEL2);                             \
118       fprintf (FILE, "\n");                                     \
119     }                                                           \
120   while (0)
121
122 /* Define these to generate the Linux/ELF/SysV style of internal
123    labels all the time - i.e. to be compatible with
124    ASM_GENERATE_INTERNAL_LABEL in <elfos.h>.  Compare these with the
125    ones in pa.h and note the lack of dollar signs in these.  FIXME:
126    shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */
127
128 #undef ASM_OUTPUT_ADDR_VEC_ELT
129 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
130   if (TARGET_BIG_SWITCH)                                        \
131     fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'.L%d,%%r1\n\tbe RR'.L%d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE);              \
132   else                                                          \
133     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
134
135 #undef ASM_OUTPUT_ADDR_DIFF_ELT
136 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
137   if (TARGET_BIG_SWITCH)                                        \
138     fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'.L%d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE);                         \
139   else                                                          \
140     fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
141
142 /* This is how to output the definition of a user-level label named NAME,
143    such as the label on a static function or variable NAME.  */
144
145 #undef ASM_OUTPUT_LABEL
146 #define ASM_OUTPUT_LABEL(FILE, NAME) \
147   do                                                            \
148     {                                                           \
149       assemble_name (FILE, NAME);                               \
150       fputs (":\n", FILE);                                      \
151     }                                                           \
152   while (0)
153
154 /* NOTE: ASM_OUTPUT_INTERNAL_LABEL() is defined for us by elfos.h, and
155    does what we want (i.e. uses colons).  It must be compatible with
156    ASM_GENERATE_INTERNAL_LABEL(), so do not define it here.  */
157
158 #undef ASM_GLOBALIZE_LABEL
159 #define ASM_GLOBALIZE_LABEL(FILE, NAME) \
160   (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
161
162 /* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
163    labels in a function declaration (since pa.c seems determined to do
164    it differently)  */
165
166 #undef ASM_DECLARE_FUNCTION_NAME
167 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)             \
168   do                                                            \
169     {                                                           \
170       fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                   \
171       assemble_name (FILE, NAME);                               \
172       putc (',', FILE);                                         \
173       fprintf (FILE, TYPE_OPERAND_FMT, "function");             \
174       putc ('\n', FILE);                                        \
175       ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));            \
176     }                                                           \
177   while (0)
178
179 /* Linux always uses gas.  */
180 #undef TARGET_GAS
181 #define TARGET_GAS 1