]>
Commit | Line | Data |
---|---|---|
956d6950 | 1 | /* Definitions for 64-bit SPARC running Linux-based GNU systems with ELF. |
e5e809f4 | 2 | Copyright 1996, 1997, 1998 Free Software Foundation, Inc. |
bfe87013 DE |
3 | Contributed by David S. Miller (davem@caip.rutgers.edu) |
4 | ||
5 | This file is part of GNU CC. | |
6 | ||
7 | GNU CC 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 | GNU CC 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 GNU CC; see the file COPYING. If not, write to | |
19 | the Free Software Foundation, 59 Temple Place - Suite 330, | |
20 | Boston, MA 02111-1307, USA. */ | |
21 | ||
a0a301fc DE |
22 | /* ??? bi-architecture support will require changes to the linker |
23 | related specs, among perhaps other things (multilibs). */ | |
24 | /* #define SPARC_BI_ARCH */ | |
bfe87013 | 25 | |
a0a301fc | 26 | #define LINUX_DEFAULT_ELF |
bfe87013 DE |
27 | |
28 | /* Don't assume anything about the header files. */ | |
29 | #define NO_IMPLICIT_EXTERN_C | |
30 | ||
31 | #undef HAVE_ATEXIT | |
32 | #define HAVE_ATEXIT | |
33 | ||
34 | #include <sparc/sysv4.h> | |
35 | ||
36 | #undef MD_EXEC_PREFIX | |
37 | #undef MD_STARTFILE_PREFIX | |
38 | ||
39 | /* Output at beginning of assembler file. */ | |
40 | /* The .file command should always begin the output. */ | |
41 | #undef ASM_FILE_START | |
42 | #define ASM_FILE_START(FILE) \ | |
43 | do { \ | |
44 | output_file_directive (FILE, main_input_filename); \ | |
45 | fprintf (FILE, "\t.version\t\"01.01\"\n"); \ | |
46 | } while (0) | |
47 | ||
a0a301fc DE |
48 | #undef ASM_CPU_DEFAULT_SPEC |
49 | #define ASM_CPU_DEFAULT_SPEC "-Av9a" | |
bfe87013 | 50 | |
956d6950 JL |
51 | /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add |
52 | the GNU/Linux magical crtbegin.o file (see crtstuff.c) which | |
bfe87013 DE |
53 | provides part of the support for getting C++ file-scope static |
54 | object constructed before entering `main'. */ | |
55 | ||
56 | #undef STARTFILE_SPEC | |
57 | #define STARTFILE_SPEC \ | |
58 | "%{!shared: \ | |
59 | %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ | |
60 | crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" | |
61 | ||
956d6950 JL |
62 | /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on |
63 | the GNU/Linux magical crtend.o file (see crtstuff.c) which | |
bfe87013 DE |
64 | provides part of the support for getting C++ file-scope static |
65 | object constructed before entering `main', followed by a normal | |
956d6950 | 66 | GNU/Linux "finalizer" file, `crtn.o'. */ |
bfe87013 DE |
67 | |
68 | #undef ENDFILE_SPEC | |
69 | #define ENDFILE_SPEC \ | |
70 | "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" | |
71 | ||
72 | #undef TARGET_VERSION | |
956d6950 | 73 | #define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)"); |
bfe87013 | 74 | |
a0a301fc DE |
75 | /* A 64 bit v9 compiler with stack-bias, |
76 | in a Medium/Anywhere code model environment. */ | |
bfe87013 DE |
77 | |
78 | #undef TARGET_DEFAULT | |
79 | #define TARGET_DEFAULT \ | |
a0a301fc DE |
80 | (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \ |
81 | + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU) | |
82 | ||
83 | /* The default code model. */ | |
84 | #undef SPARC_DEFAULT_CMODEL | |
85 | #define SPARC_DEFAULT_CMODEL CM_MEDANY | |
bfe87013 DE |
86 | |
87 | #undef SIZE_TYPE | |
88 | #define SIZE_TYPE "long long unsigned int" | |
89 | ||
90 | #undef PTRDIFF_TYPE | |
91 | #define PTRDIFF_TYPE "long long int" | |
92 | ||
93 | #undef WCHAR_TYPE | |
94 | #define WCHAR_TYPE "long int" | |
95 | ||
96 | #undef WCHAR_TYPE_SIZE | |
97 | #define WCHAR_TYPE_SIZE BITS_PER_WORD | |
a0a301fc DE |
98 | |
99 | #undef LONG_DOUBLE_TYPE_SIZE | |
100 | #define LONG_DOUBLE_TYPE_SIZE 128 | |
bfe87013 DE |
101 | |
102 | #undef CPP_PREDEFINES | |
a0a301fc | 103 | #define CPP_PREDEFINES "-D__ELF__ -Dunix -Dsparc -Dlinux -Asystem(unix) -Asystem(posix)" |
bfe87013 | 104 | |
a0a301fc DE |
105 | #undef CPP_SUBTARGET_SPEC |
106 | #define CPP_SUBTARGET_SPEC "\ | |
bfe87013 DE |
107 | %{fPIC:-D__PIC__ -D__pic__} \ |
108 | %{fpic:-D__PIC__ -D__pic__} \ | |
bfe87013 | 109 | %{posix:-D_POSIX_SOURCE} \ |
afc96791 | 110 | %{pthread:-D_REENTRANT} \ |
bfe87013 | 111 | " |
afc96791 | 112 | |
bfe87013 DE |
113 | #undef LIB_SPEC |
114 | #define LIB_SPEC \ | |
1398405b L |
115 | "%{shared: -lc} \ |
116 | %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ | |
afc96791 | 117 | %{profile:-lc_p} %{!profile: -lc}}" |
bfe87013 | 118 | |
956d6950 | 119 | /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support |
bfe87013 DE |
120 | for the special GCC options -static and -shared, which allow us to |
121 | link things in one of these three modes by applying the appropriate | |
122 | combinations of options at link-time. We like to support here for | |
123 | as many of the other GNU linker options as possible. But I don't | |
124 | have the time to search for those flags. I am sure how to add | |
125 | support for -soname shared_object_name. H.J. | |
126 | ||
127 | I took out %{v:%{!V:-V}}. It is too much :-(. They can use | |
128 | -Wl,-V. | |
129 | ||
130 | When the -shared link option is used a final link is not being | |
131 | done. */ | |
132 | ||
133 | /* If ELF is the default format, we should not use /lib/elf. */ | |
134 | ||
135 | #undef LINK_SPEC | |
136 | #define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \ | |
137 | %{!shared: \ | |
138 | %{!ibcs: \ | |
139 | %{!static: \ | |
140 | %{rdynamic:-export-dynamic} \ | |
bf2a2c6b | 141 | %{!dynamic-linker:-dynamic-linker /lib/ld-linux64.so.2}} \ |
bfe87013 DE |
142 | %{static:-static}}} \ |
143 | %{mlittle-endian:-EL} \ | |
144 | " | |
145 | ||
146 | /* The sun bundled assembler doesn't accept -Yd, (and neither does gas). | |
147 | It's safe to pass -s always, even if -g is not used. */ | |
148 | #undef ASM_SPEC | |
149 | #define ASM_SPEC "\ | |
150 | %{V} \ | |
151 | %{v:%{!V:-V}} \ | |
152 | %{!Qn:-Qy} \ | |
153 | %{n} \ | |
154 | %{T} \ | |
155 | %{Ym,*} \ | |
156 | %{Wa,*:%*} \ | |
157 | -s %{fpic:-K PIC} %{fPIC:-K PIC} \ | |
158 | %{mlittle-endian:-EL} \ | |
a0a301fc | 159 | %(asm_cpu) %(asm_arch) \ |
bfe87013 DE |
160 | " |
161 | ||
162 | /* Same as sparc.h */ | |
163 | #undef DBX_REGISTER_NUMBER | |
164 | #define DBX_REGISTER_NUMBER(REGNO) (REGNO) | |
165 | ||
166 | /* System V Release 4 uses DWARF debugging info. Buf DWARF1 doesn't do | |
167 | 64-bit anything, so we use DWARF2. */ | |
168 | ||
169 | #undef DWARF2_DEBUGGING_INFO | |
170 | #undef DWARF_DEBUGGING_INFO | |
171 | #undef DBX_DEBUGGING_INFO | |
172 | #define DWARF2_DEBUGGING_INFO | |
173 | #define DBX_DEBUGGING_INFO | |
174 | ||
175 | #undef PREFERRED_DEBUGGING_TYPE | |
176 | #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG | |
177 | ||
178 | #undef ASM_OUTPUT_ALIGNED_LOCAL | |
179 | #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ | |
180 | do { \ | |
181 | fputs ("\t.local\t", (FILE)); \ | |
182 | assemble_name ((FILE), (NAME)); \ | |
183 | putc ('\n', (FILE)); \ | |
184 | ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ | |
185 | } while (0) | |
186 | ||
187 | #undef COMMON_ASM_OP | |
188 | #define COMMON_ASM_OP "\t.common" | |
189 | ||
190 | /* This is how to output a definition of an internal numbered label where | |
191 | PREFIX is the class of label and NUM is the number within the class. */ | |
192 | ||
193 | #undef ASM_OUTPUT_INTERNAL_LABEL | |
194 | #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ | |
195 | fprintf (FILE, ".L%s%d:\n", PREFIX, NUM) | |
196 | ||
197 | /* This is how to output a reference to an internal numbered label where | |
198 | PREFIX is the class of label and NUM is the number within the class. */ | |
199 | ||
200 | #undef ASM_OUTPUT_INTERNAL_LABELREF | |
201 | #define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \ | |
202 | fprintf (FILE, ".L%s%d", PREFIX, NUM) | |
203 | ||
204 | /* This is how to store into the string LABEL | |
205 | the symbol_ref name of an internal numbered label where | |
206 | PREFIX is the class of label and NUM is the number within the class. | |
207 | This is suitable for output with `assemble_name'. */ | |
208 | ||
209 | #undef ASM_GENERATE_INTERNAL_LABEL | |
210 | #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ | |
211 | sprintf (LABEL, "*.L%s%d", PREFIX, NUM) | |
212 | ||
213 | /* Stabs doesn't use this, and it confuses a simulator. */ | |
214 | /* ??? Need to see what DWARF needs, if anything. */ | |
215 | #undef ASM_IDENTIFY_GCC | |
216 | #define ASM_IDENTIFY_GCC(FILE) | |
217 | ||
218 | /* Define the names of various pseudo-ops used by the Sparc/svr4 assembler. | |
219 | ??? If ints are 64 bits then UNALIGNED_INT_ASM_OP (defined elsewhere) is | |
220 | misnamed. These should all refer to explicit sizes (half/word/xword?), | |
221 | anything other than short/int/long/etc. */ | |
222 | ||
223 | #define UNALIGNED_DOUBLE_INT_ASM_OP ".uaxword" | |
224 | ||
225 | /* DWARF bits. */ | |
226 | ||
227 | /* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets. | |
228 | Obviously the Dwarf2 folks havn't tried to actually build systems | |
229 | with their spec. On a 64-bit system, only 64-bit relocs become | |
230 | RELATIVE relocations. */ | |
231 | ||
232 | /* #define DWARF_OFFSET_SIZE PTR_SIZE */ |