Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/rs6000/sysv4.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
rev | line source |
---|---|
0 | 1 /* Target definitions for GNU compiler for PowerPC running System V.4 |
131 | 2 Copyright (C) 1995-2018 Free Software Foundation, Inc. |
0 | 3 Contributed by Cygnus Support. |
4 | |
5 This file is part of GCC. | |
6 | |
7 GCC is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published | |
9 by the Free Software Foundation; either version 3, or (at your | |
10 option) any later version. | |
11 | |
12 GCC is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
15 License for more details. | |
16 | |
17 Under Section 7 of GPL version 3, you are granted additional | |
18 permissions described in the GCC Runtime Library Exception, version | |
19 3.1, as published by the Free Software Foundation. | |
20 | |
21 You should have received a copy of the GNU General Public License and | |
22 a copy of the GCC Runtime Library Exception along with this program; | |
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
24 <http://www.gnu.org/licenses/>. */ | |
25 | |
26 /* Yes! We are ELF. */ | |
27 #define TARGET_OBJECT_FORMAT OBJECT_ELF | |
28 | |
29 /* Default ABI to compile code for. */ | |
30 #define DEFAULT_ABI rs6000_current_abi | |
31 | |
32 /* Default ABI to use. */ | |
33 #define RS6000_ABI_NAME "sysv" | |
34 | |
35 /* Override rs6000.h definition. */ | |
36 #undef ASM_DEFAULT_SPEC | |
37 #define ASM_DEFAULT_SPEC "-mppc" | |
38 | |
111 | 39 #define TARGET_TOC (TARGET_64BIT \ |
40 || (TARGET_MINIMAL_TOC \ | |
0 | 41 && flag_pic > 1) \ |
111 | 42 || DEFAULT_ABI != ABI_V4) |
0 | 43 |
44 #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE) | |
45 #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
46 #define TARGET_PROTOTYPE target_prototype |
0 | 47 #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE) |
48 #define TARGET_NO_TOC (! TARGET_TOC) | |
49 #define TARGET_NO_EABI (! TARGET_EABI) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
50 #define TARGET_REGNAMES rs6000_regnames |
0 | 51 |
52 #ifdef HAVE_AS_REL16 | |
53 #undef TARGET_SECURE_PLT | |
54 #define TARGET_SECURE_PLT secure_plt | |
55 #endif | |
56 | |
57 #define SDATA_DEFAULT_SIZE 8 | |
58 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
59 /* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
60 get control in TARGET_OPTION_OVERRIDE. */ |
0 | 61 |
62 #define SUBTARGET_OVERRIDE_OPTIONS \ | |
63 do { \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
64 if (!global_options_set.x_g_switch_value) \ |
0 | 65 g_switch_value = SDATA_DEFAULT_SIZE; \ |
66 \ | |
67 if (rs6000_abi_name == NULL) \ | |
68 rs6000_abi_name = RS6000_ABI_NAME; \ | |
69 \ | |
70 if (!strcmp (rs6000_abi_name, "sysv")) \ | |
71 rs6000_current_abi = ABI_V4; \ | |
72 else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \ | |
73 { \ | |
74 rs6000_current_abi = ABI_V4; \ | |
111 | 75 rs6000_isa_flags &= ~ OPTION_MASK_EABI; \ |
0 | 76 } \ |
77 else if (!strcmp (rs6000_abi_name, "sysv-eabi") \ | |
78 || !strcmp (rs6000_abi_name, "eabi")) \ | |
79 { \ | |
80 rs6000_current_abi = ABI_V4; \ | |
111 | 81 rs6000_isa_flags |= OPTION_MASK_EABI; \ |
0 | 82 } \ |
83 else if (!strcmp (rs6000_abi_name, "aixdesc")) \ | |
84 rs6000_current_abi = ABI_AIX; \ | |
111 | 85 else if (!strcmp (rs6000_abi_name, "freebsd") \ |
86 || !strcmp (rs6000_abi_name, "linux")) \ | |
0 | 87 { \ |
88 if (TARGET_64BIT) \ | |
89 rs6000_current_abi = ABI_AIX; \ | |
90 else \ | |
91 rs6000_current_abi = ABI_V4; \ | |
92 } \ | |
93 else if (!strcmp (rs6000_abi_name, "netbsd")) \ | |
94 rs6000_current_abi = ABI_V4; \ | |
95 else if (!strcmp (rs6000_abi_name, "openbsd")) \ | |
96 rs6000_current_abi = ABI_V4; \ | |
97 else if (!strcmp (rs6000_abi_name, "i960-old")) \ | |
98 { \ | |
99 rs6000_current_abi = ABI_V4; \ | |
111 | 100 rs6000_isa_flags |= (OPTION_MASK_LITTLE_ENDIAN | OPTION_MASK_EABI); \ |
101 rs6000_isa_flags &= ~OPTION_MASK_STRICT_ALIGN; \ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
102 TARGET_NO_BITFIELD_WORD = 1; \ |
0 | 103 } \ |
104 else \ | |
105 { \ | |
106 rs6000_current_abi = ABI_V4; \ | |
111 | 107 error ("bad value for %<%s-%s%>", "-mcall", rs6000_abi_name); \ |
0 | 108 } \ |
109 \ | |
110 if (rs6000_sdata_name) \ | |
111 { \ | |
112 if (!strcmp (rs6000_sdata_name, "none")) \ | |
113 rs6000_sdata = SDATA_NONE; \ | |
114 else if (!strcmp (rs6000_sdata_name, "data")) \ | |
115 rs6000_sdata = SDATA_DATA; \ | |
116 else if (!strcmp (rs6000_sdata_name, "default")) \ | |
117 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \ | |
118 else if (!strcmp (rs6000_sdata_name, "sysv")) \ | |
119 rs6000_sdata = SDATA_SYSV; \ | |
120 else if (!strcmp (rs6000_sdata_name, "eabi")) \ | |
121 rs6000_sdata = SDATA_EABI; \ | |
122 else \ | |
111 | 123 error ("bad value for %<%s=%s%>", "-msdata", rs6000_sdata_name);\ |
0 | 124 } \ |
125 else if (DEFAULT_ABI == ABI_V4) \ | |
126 { \ | |
127 rs6000_sdata = SDATA_DATA; \ | |
128 rs6000_sdata_name = "data"; \ | |
129 } \ | |
130 else \ | |
131 { \ | |
132 rs6000_sdata = SDATA_NONE; \ | |
133 rs6000_sdata_name = "none"; \ | |
134 } \ | |
135 \ | |
136 if (TARGET_RELOCATABLE && \ | |
137 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ | |
138 { \ | |
139 rs6000_sdata = SDATA_DATA; \ | |
111 | 140 error ("%qs and %<%s=%s%> are incompatible", rs6000_sdata_name, \ |
141 "-mrelocatable", "-msdata"); \ | |
0 | 142 } \ |
143 \ | |
111 | 144 else if (flag_pic && DEFAULT_ABI == ABI_V4 \ |
0 | 145 && (rs6000_sdata == SDATA_EABI \ |
146 || rs6000_sdata == SDATA_SYSV)) \ | |
147 { \ | |
148 rs6000_sdata = SDATA_DATA; \ | |
111 | 149 error ("%<-f%s%> and %<%s=%s%> are incompatible", \ |
0 | 150 (flag_pic > 1) ? "PIC" : "pic", \ |
111 | 151 "-msdata", rs6000_sdata_name); \ |
0 | 152 } \ |
153 \ | |
154 if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4) \ | |
155 || (rs6000_sdata == SDATA_EABI && !TARGET_EABI)) \ | |
156 { \ | |
157 rs6000_sdata = SDATA_NONE; \ | |
111 | 158 error ("%<%s=%s%> and %<%s-%s%> are incompatible", \ |
159 "-msdata", rs6000_sdata_name, "-mcall", rs6000_abi_name); \ | |
0 | 160 } \ |
161 \ | |
162 targetm.have_srodata_section = rs6000_sdata == SDATA_EABI; \ | |
163 \ | |
164 if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \ | |
165 { \ | |
111 | 166 rs6000_isa_flags |= OPTION_MASK_MINIMAL_TOC; \ |
167 error ("%qs and %qs are incompatible", "-mrelocatable", \ | |
168 "-mno-minimal-toc"); \ | |
0 | 169 } \ |
170 \ | |
111 | 171 if (TARGET_RELOCATABLE && rs6000_current_abi != ABI_V4) \ |
172 { \ | |
173 rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \ | |
174 error ("%qs and %<%s-%s%> are incompatible", \ | |
175 "-mrelocatable", "-mcall", rs6000_abi_name); \ | |
176 } \ | |
177 \ | |
178 if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi != ABI_V4) \ | |
0 | 179 { \ |
180 flag_pic = 0; \ | |
111 | 181 error ("%qs and %<%s-%s%> are incompatible", \ |
182 "-fPIC", "-mcall", rs6000_abi_name); \ | |
0 | 183 } \ |
184 \ | |
185 if (TARGET_SECURE_PLT != secure_plt) \ | |
186 { \ | |
111 | 187 error ("%qs not supported by your assembler", "-msecure-plt"); \ |
0 | 188 } \ |
189 \ | |
111 | 190 if (flag_pic > 1 && DEFAULT_ABI == ABI_V4) \ |
0 | 191 { \ |
111 | 192 /* Note: flag_pic should not change any option flags that would \ |
193 be invalid with or pessimise -fno-PIC code. LTO turns off \ | |
194 flag_pic when linking/recompiling a fixed position executable. \ | |
195 However, if the objects were originally compiled with -fPIC, \ | |
196 then other target options forced on here by -fPIC are restored \ | |
197 when recompiling those objects without -fPIC. In particular \ | |
198 TARGET_RELOCATABLE must not be enabled here by flag_pic. */ \ | |
199 rs6000_isa_flags |= OPTION_MASK_MINIMAL_TOC; \ | |
0 | 200 TARGET_NO_FP_IN_TOC = 1; \ |
201 } \ | |
202 \ | |
111 | 203 if (TARGET_RELOCATABLE) \ |
204 { \ | |
205 if (!flag_pic) \ | |
206 flag_pic = 2; \ | |
207 TARGET_NO_FP_IN_TOC = 1; \ | |
208 } \ | |
0 | 209 } while (0) |
210 | |
211 #ifndef RS6000_BI_ARCH | |
212 # define SUBSUBTARGET_OVERRIDE_OPTIONS \ | |
213 do { \ | |
111 | 214 if ((TARGET_DEFAULT ^ rs6000_isa_flags) & OPTION_MASK_64BIT) \ |
215 error ("%<-m%s%> not supported in this configuration", \ | |
216 (rs6000_isa_flags & OPTION_MASK_64BIT) ? "64" : "32"); \ | |
0 | 217 } while (0) |
218 #endif | |
219 | |
220 /* Override rs6000.h definition. */ | |
221 #undef TARGET_DEFAULT | |
111 | 222 #define TARGET_DEFAULT 0 |
0 | 223 |
224 /* Override rs6000.h definition. */ | |
225 #undef PROCESSOR_DEFAULT | |
226 #define PROCESSOR_DEFAULT PROCESSOR_PPC750 | |
227 | |
228 #define FIXED_R2 1 | |
229 /* System V.4 uses register 13 as a pointer to the small data area, | |
230 so it is not available to the normal user. */ | |
231 #define FIXED_R13 1 | |
232 | |
233 /* Override default big endianism definitions in rs6000.h. */ | |
234 #undef BYTES_BIG_ENDIAN | |
235 #undef WORDS_BIG_ENDIAN | |
236 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN) | |
237 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN) | |
238 | |
239 /* Put jump tables in read-only memory, rather than in .text. */ | |
240 #define JUMP_TABLES_IN_TEXT_SECTION 0 | |
241 | |
242 /* Prefix and suffix to use to saving floating point. */ | |
243 #define SAVE_FP_PREFIX "_savefpr_" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
244 #define SAVE_FP_SUFFIX "" |
0 | 245 |
246 /* Prefix and suffix to use to restoring floating point. */ | |
247 #define RESTORE_FP_PREFIX "_restfpr_" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
248 #define RESTORE_FP_SUFFIX "" |
0 | 249 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
250 /* Type used for size_t, as a string used in a declaration. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
251 #undef SIZE_TYPE |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
252 #define SIZE_TYPE "unsigned int" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
253 |
0 | 254 /* Type used for ptrdiff_t, as a string used in a declaration. */ |
255 #define PTRDIFF_TYPE "int" | |
256 | |
257 #undef WCHAR_TYPE | |
258 #define WCHAR_TYPE "long int" | |
259 | |
260 #undef WCHAR_TYPE_SIZE | |
261 #define WCHAR_TYPE_SIZE 32 | |
262 | |
263 /* Make int foo : 8 not cause structures to be aligned to an int boundary. */ | |
264 /* Override elfos.h definition. */ | |
265 #undef PCC_BITFIELD_TYPE_MATTERS | |
266 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE) | |
267 | |
268 #undef BITFIELD_NBYTES_LIMITED | |
269 #define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD) | |
270 | |
271 /* Define this macro to be the value 1 if instructions will fail to | |
272 work if given data not on the nominal alignment. If instructions | |
273 will merely go slower in that case, define this macro as 0. */ | |
274 #undef STRICT_ALIGNMENT | |
275 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN) | |
276 | |
277 /* Define this macro if you wish to preserve a certain alignment for | |
278 the stack pointer, greater than what the hardware enforces. The | |
279 definition is a C expression for the desired alignment (measured | |
280 in bits). This macro must evaluate to a value equal to or larger | |
281 than STACK_BOUNDARY. | |
282 For the SYSV ABI and variants the alignment of the stack pointer | |
283 is usually controlled manually in rs6000.c. However, to maintain | |
284 alignment across alloca () in all circumstances, | |
285 PREFERRED_STACK_BOUNDARY needs to be set as well. | |
286 This has the additional advantage of allowing a bigger maximum | |
287 alignment of user objects on the stack. */ | |
288 | |
289 #undef PREFERRED_STACK_BOUNDARY | |
290 #define PREFERRED_STACK_BOUNDARY 128 | |
291 | |
292 /* Real stack boundary as mandated by the appropriate ABI. */ | |
293 #define ABI_STACK_BOUNDARY \ | |
294 ((TARGET_EABI && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI) ? 64 : 128) | |
295 | |
296 /* An expression for the alignment of a structure field FIELD if the | |
297 alignment computed in the usual way is COMPUTED. */ | |
111 | 298 #define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ |
299 (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED)) \ | |
0 | 300 ? 128 : COMPUTED) |
301 | |
302 #undef BIGGEST_FIELD_ALIGNMENT | |
303 | |
304 /* Use ELF style section commands. */ | |
305 | |
306 #define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" | |
307 | |
308 #define DATA_SECTION_ASM_OP "\t.section\t\".data\"" | |
309 | |
310 #define BSS_SECTION_ASM_OP "\t.section\t\".bss\"" | |
311 | |
312 /* Override elfos.h definition. */ | |
313 #undef INIT_SECTION_ASM_OP | |
314 #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\"" | |
315 | |
316 /* Override elfos.h definition. */ | |
317 #undef FINI_SECTION_ASM_OP | |
318 #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\"" | |
319 | |
320 #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\"" | |
321 | |
322 /* Put PC relative got entries in .got2. */ | |
323 #define MINIMAL_TOC_SECTION_ASM_OP \ | |
111 | 324 (flag_pic ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"") |
0 | 325 |
326 #define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\"" | |
327 #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\"" | |
328 #define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits" | |
329 | |
330 /* Override default elf definitions. */ | |
331 #define TARGET_ASM_INIT_SECTIONS rs6000_elf_asm_init_sections | |
332 #undef TARGET_ASM_RELOC_RW_MASK | |
333 #define TARGET_ASM_RELOC_RW_MASK rs6000_elf_reloc_rw_mask | |
334 #undef TARGET_ASM_SELECT_RTX_SECTION | |
335 #define TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section | |
336 | |
337 /* Return nonzero if this entry is to be written into the constant pool | |
338 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST | |
339 containing one of them. If -mfp-in-toc (the default), we also do | |
340 this for floating-point constants. We actually can only do this | |
341 if the FP formats of the target and host machines are the same, but | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
342 we can't check that since not every file that uses these target macros |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
343 includes real.h. |
0 | 344 |
345 Unlike AIX, we don't key off of -mminimal-toc, but instead do not | |
346 allow floating point constants in the TOC if -mrelocatable. */ | |
347 | |
348 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P | |
349 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ | |
350 (TARGET_TOC \ | |
351 && (GET_CODE (X) == SYMBOL_REF \ | |
352 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ | |
353 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ | |
354 || GET_CODE (X) == LABEL_REF \ | |
355 || (GET_CODE (X) == CONST_INT \ | |
356 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ | |
357 || (!TARGET_NO_FP_IN_TOC \ | |
358 && GET_CODE (X) == CONST_DOUBLE \ | |
359 && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \ | |
360 && BITS_PER_WORD == HOST_BITS_PER_INT))) | |
361 | |
362 /* These macros generate the special .type and .size directives which | |
363 are used to set the corresponding fields of the linker symbol table | |
364 entries in an ELF object file under SVR4. These macros also output | |
365 the starting labels for the relevant functions/objects. */ | |
366 | |
367 /* Write the extra assembler code needed to declare a function properly. | |
368 Some svr4 assemblers need to also have something extra said about the | |
369 function's return value. We allow for that here. */ | |
370 | |
371 /* Override elfos.h definition. */ | |
372 #undef ASM_DECLARE_FUNCTION_NAME | |
373 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ | |
374 rs6000_elf_declare_function_name ((FILE), (NAME), (DECL)) | |
375 | |
376 /* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore | |
377 flag. The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */ | |
378 | |
379 #define LOCAL_LABEL_PREFIX "." | |
380 #define USER_LABEL_PREFIX "" | |
381 | |
382 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \ | |
383 asm_fprintf (FILE, "%L%s", PREFIX) | |
384 | |
385 /* Globalizing directive for a label. */ | |
386 #define GLOBAL_ASM_OP "\t.globl " | |
387 | |
388 /* This says how to output assembler code to declare an | |
389 uninitialized internal linkage data object. Under SVR4, | |
390 the linker seems to want the alignment of data objects | |
391 to depend on their types. We do exactly that here. */ | |
392 | |
393 #define LOCAL_ASM_OP "\t.local\t" | |
394 | |
395 #define LCOMM_ASM_OP "\t.lcomm\t" | |
396 | |
397 /* Describe how to emit uninitialized local items. */ | |
398 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ | |
399 do { \ | |
400 if ((DECL) && rs6000_elf_in_small_data_p (DECL)) \ | |
401 { \ | |
402 switch_to_section (sbss_section); \ | |
403 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ | |
404 ASM_OUTPUT_LABEL (FILE, NAME); \ | |
405 ASM_OUTPUT_SKIP (FILE, SIZE); \ | |
406 if (!flag_inhibit_size_directive && (SIZE) > 0) \ | |
407 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE); \ | |
408 } \ | |
409 else \ | |
410 { \ | |
411 fprintf (FILE, "%s", LCOMM_ASM_OP); \ | |
412 assemble_name ((FILE), (NAME)); \ | |
111 | 413 fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ |
0 | 414 (SIZE), (ALIGN) / BITS_PER_UNIT); \ |
415 } \ | |
416 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ | |
417 } while (0) | |
418 | |
419 /* Describe how to emit uninitialized external linkage items. */ | |
420 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ | |
421 do { \ | |
422 ASM_OUTPUT_ALIGNED_DECL_LOCAL (FILE, DECL, NAME, SIZE, ALIGN); \ | |
423 } while (0) | |
424 | |
425 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN | |
426 /* To support -falign-* switches we need to use .p2align so | |
427 that alignment directives in code sections will be padded | |
428 with no-op instructions, rather than zeroes. */ | |
429 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ | |
430 if ((LOG) != 0) \ | |
431 { \ | |
432 if ((MAX_SKIP) == 0) \ | |
433 fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ | |
434 else \ | |
435 fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ | |
436 } | |
437 #endif | |
438 | |
439 /* This is how to output code to push a register on the stack. | |
440 It need not be very fast code. | |
441 | |
442 On the rs6000, we must keep the backchain up to date. In order | |
443 to simplify things, always allocate 16 bytes for a push (System V | |
444 wants to keep stack aligned to a 16 byte boundary). */ | |
445 | |
446 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \ | |
447 do { \ | |
448 if (DEFAULT_ABI == ABI_V4) \ | |
449 asm_fprintf (FILE, \ | |
111 | 450 "\tstwu %s,-16(%s)\n\tstw %s,12(%s)\n", \ |
0 | 451 reg_names[1], reg_names[1], reg_names[REGNO], \ |
452 reg_names[1]); \ | |
453 } while (0) | |
454 | |
455 /* This is how to output an insn to pop a register from the stack. | |
456 It need not be very fast code. */ | |
457 | |
458 #define ASM_OUTPUT_REG_POP(FILE, REGNO) \ | |
459 do { \ | |
460 if (DEFAULT_ABI == ABI_V4) \ | |
461 asm_fprintf (FILE, \ | |
111 | 462 "\tlwz %s,12(%s)\n\taddi %s,%s,16\n", \ |
0 | 463 reg_names[REGNO], reg_names[1], reg_names[1], \ |
464 reg_names[1]); \ | |
465 } while (0) | |
466 | |
467 extern int fixuplabelno; | |
468 | |
469 /* Handle constructors specially for -mrelocatable. */ | |
470 #define TARGET_ASM_CONSTRUCTOR rs6000_elf_asm_out_constructor | |
471 #define TARGET_ASM_DESTRUCTOR rs6000_elf_asm_out_destructor | |
472 | |
473 /* This is the end of what might become sysv4.h. */ | |
474 | |
475 /* Use DWARF 2 debugging information by default. */ | |
476 #undef PREFERRED_DEBUGGING_TYPE | |
477 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG | |
478 | |
479 /* Historically we have also supported stabs debugging. */ | |
480 #define DBX_DEBUGGING_INFO 1 | |
481 | |
482 #define TARGET_ENCODE_SECTION_INFO rs6000_elf_encode_section_info | |
483 #define TARGET_IN_SMALL_DATA_P rs6000_elf_in_small_data_p | |
484 | |
485 /* The ELF version doesn't encode [DS] or whatever at the end of symbols. */ | |
486 | |
487 #define RS6000_OUTPUT_BASENAME(FILE, NAME) \ | |
488 assemble_name (FILE, NAME) | |
489 | |
490 /* We have to output the stabs for the function name *first*, before | |
491 outputting its label. */ | |
492 | |
493 #define DBX_FUNCTION_FIRST | |
494 | |
495 /* This is the end of what might become sysv4dbx.h. */ | |
496 | |
497 #define TARGET_OS_SYSV_CPP_BUILTINS() \ | |
498 do \ | |
499 { \ | |
111 | 500 if (rs6000_isa_flags_explicit \ |
501 & OPTION_MASK_RELOCATABLE) \ | |
0 | 502 builtin_define ("_RELOCATABLE"); \ |
503 } \ | |
504 while (0) | |
505 | |
506 #ifndef TARGET_OS_CPP_BUILTINS | |
507 #define TARGET_OS_CPP_BUILTINS() \ | |
508 do \ | |
509 { \ | |
510 builtin_define_std ("PPC"); \ | |
511 builtin_define_std ("unix"); \ | |
512 builtin_define ("__svr4__"); \ | |
513 builtin_assert ("system=unix"); \ | |
514 builtin_assert ("system=svr4"); \ | |
515 builtin_assert ("cpu=powerpc"); \ | |
516 builtin_assert ("machine=powerpc"); \ | |
517 TARGET_OS_SYSV_CPP_BUILTINS (); \ | |
518 } \ | |
519 while (0) | |
520 #endif | |
521 | |
111 | 522 /* Select one of BIG_OPT, LITTLE_OPT or DEFAULT_OPT depending |
523 on various -mbig, -mlittle and -mcall- options. */ | |
524 #define ENDIAN_SELECT(BIG_OPT, LITTLE_OPT, DEFAULT_OPT) \ | |
525 "%{mlittle|mlittle-endian:" LITTLE_OPT ";" \ | |
526 "mbig|mbig-endian:" BIG_OPT ";" \ | |
527 "mcall-i960-old:" LITTLE_OPT ";" \ | |
528 ":" DEFAULT_OPT "}" | |
529 | |
530 #define DEFAULT_ASM_ENDIAN " -mbig" | |
531 | |
0 | 532 #undef ASM_SPEC |
533 #define ASM_SPEC "%(asm_cpu) \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
534 %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \ |
111 | 535 %{mrelocatable} %{mrelocatable-lib} %{" FPIE_OR_FPIC_SPEC ":-K PIC} \ |
536 %{memb|msdata=eabi: -memb}" \ | |
537 ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN) | |
0 | 538 |
539 #ifndef CC1_SECURE_PLT_DEFAULT_SPEC | |
540 #define CC1_SECURE_PLT_DEFAULT_SPEC "" | |
541 #endif | |
111 | 542 #ifndef LINK_SECURE_PLT_DEFAULT_SPEC |
543 #define LINK_SECURE_PLT_DEFAULT_SPEC "" | |
544 #endif | |
0 | 545 |
111 | 546 /* Pass -G xxx to the compiler. */ |
547 #undef CC1_SPEC | |
548 #define CC1_SPEC "%{G*} %(cc1_cpu)" \ | |
549 "%{meabi: %{!mcall-*: -mcall-sysv }} \ | |
0 | 550 %{!meabi: %{!mno-eabi: \ |
551 %{mrelocatable: -meabi } \ | |
552 %{mcall-freebsd: -mno-eabi } \ | |
553 %{mcall-i960-old: -meabi } \ | |
554 %{mcall-linux: -mno-eabi } \ | |
555 %{mcall-netbsd: -mno-eabi } \ | |
556 %{mcall-openbsd: -mno-eabi }}} \ | |
557 %{msdata: -msdata=default} \ | |
558 %{mno-sdata: -msdata=none} \ | |
559 %{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}} \ | |
560 %{profile: -p}" | |
561 | |
562 /* Default starting address if specified. */ | |
563 #define LINK_START_SPEC "\ | |
564 %{mads : %(link_start_ads) ; \ | |
565 myellowknife : %(link_start_yellowknife) ; \ | |
566 mmvme : %(link_start_mvme) ; \ | |
567 msim : %(link_start_sim) ; \ | |
568 mcall-freebsd: %(link_start_freebsd) ; \ | |
569 mcall-linux : %(link_start_linux) ; \ | |
570 mcall-netbsd : %(link_start_netbsd) ; \ | |
571 mcall-openbsd: %(link_start_openbsd) ; \ | |
572 : %(link_start_default) }" | |
573 | |
574 #define LINK_START_DEFAULT_SPEC "" | |
111 | 575 #define LINK_SECURE_PLT_SPEC LINK_SECURE_PLT_DEFAULT_SPEC |
0 | 576 |
577 #undef LINK_SPEC | |
578 #define LINK_SPEC "\ | |
579 %{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
580 %{R*} \ |
0 | 581 %(link_shlib) \ |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
582 %{!T*: %(link_start) } \ |
111 | 583 %{!static: %{!mbss-plt: %(link_secure_plt)}} \ |
0 | 584 %(link_os)" |
585 | |
586 /* Shared libraries are not default. */ | |
587 #define LINK_SHLIB_SPEC "\ | |
588 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \ | |
589 %{static: } \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
590 %{shared:-G -dy -z text } \ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
591 %{symbolic:-Bsymbolic -G -dy -z text }" |
0 | 592 |
593 /* Any specific OS flags. */ | |
594 #define LINK_OS_SPEC "\ | |
595 %{mads : %(link_os_ads) ; \ | |
596 myellowknife : %(link_os_yellowknife) ; \ | |
597 mmvme : %(link_os_mvme) ; \ | |
598 msim : %(link_os_sim) ; \ | |
599 mcall-freebsd: %(link_os_freebsd) ; \ | |
600 mcall-linux : %(link_os_linux) ; \ | |
601 mcall-netbsd : %(link_os_netbsd) ; \ | |
602 mcall-openbsd: %(link_os_openbsd) ; \ | |
603 : %(link_os_default) }" | |
604 | |
605 #define LINK_OS_DEFAULT_SPEC "" | |
606 | |
607 /* Override rs6000.h definition. */ | |
608 #undef CPP_SPEC | |
609 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \ | |
610 %{mads : %(cpp_os_ads) ; \ | |
611 myellowknife : %(cpp_os_yellowknife) ; \ | |
612 mmvme : %(cpp_os_mvme) ; \ | |
613 msim : %(cpp_os_sim) ; \ | |
614 mcall-freebsd: %(cpp_os_freebsd) ; \ | |
615 mcall-linux : %(cpp_os_linux) ; \ | |
616 mcall-netbsd : %(cpp_os_netbsd) ; \ | |
617 mcall-openbsd: %(cpp_os_openbsd) ; \ | |
618 : %(cpp_os_default) }" | |
619 | |
620 #define CPP_OS_DEFAULT_SPEC "" | |
621 | |
622 #undef STARTFILE_SPEC | |
623 #define STARTFILE_SPEC "\ | |
624 %{mads : %(startfile_ads) ; \ | |
625 myellowknife : %(startfile_yellowknife) ; \ | |
626 mmvme : %(startfile_mvme) ; \ | |
627 msim : %(startfile_sim) ; \ | |
628 mcall-freebsd: %(startfile_freebsd) ; \ | |
629 mcall-linux : %(startfile_linux) ; \ | |
630 mcall-netbsd : %(startfile_netbsd) ; \ | |
631 mcall-openbsd: %(startfile_openbsd) ; \ | |
632 : %(startfile_default) }" | |
633 | |
634 #define STARTFILE_DEFAULT_SPEC "ecrti.o%s crtbegin.o%s" | |
635 | |
636 #undef LIB_SPEC | |
637 #define LIB_SPEC "\ | |
638 %{mads : %(lib_ads) ; \ | |
639 myellowknife : %(lib_yellowknife) ; \ | |
640 mmvme : %(lib_mvme) ; \ | |
641 msim : %(lib_sim) ; \ | |
642 mcall-freebsd: %(lib_freebsd) ; \ | |
643 mcall-linux : %(lib_linux) ; \ | |
644 mcall-netbsd : %(lib_netbsd) ; \ | |
645 mcall-openbsd: %(lib_openbsd) ; \ | |
646 : %(lib_default) }" | |
647 | |
648 #define LIB_DEFAULT_SPEC "-lc" | |
649 | |
650 #undef ENDFILE_SPEC | |
651 #define ENDFILE_SPEC "\ | |
652 %{mads : %(endfile_ads) ; \ | |
653 myellowknife : %(endfile_yellowknife) ; \ | |
654 mmvme : %(endfile_mvme) ; \ | |
655 msim : %(endfile_sim) ; \ | |
656 mcall-freebsd: %(endfile_freebsd) ; \ | |
657 mcall-linux : %(endfile_linux) ; \ | |
658 mcall-netbsd : %(endfile_netbsd) ; \ | |
659 mcall-openbsd: %(endfile_openbsd) ; \ | |
660 : %(crtsavres_default) %(endfile_default) }" | |
661 | |
662 #define CRTSAVRES_DEFAULT_SPEC "" | |
663 | |
664 #define ENDFILE_DEFAULT_SPEC "crtend.o%s ecrtn.o%s" | |
665 | |
666 /* Motorola ADS support. */ | |
667 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group" | |
668 | |
669 #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" | |
670 | |
671 #define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s" | |
672 | |
673 #define LINK_START_ADS_SPEC "-T ads.ld%s" | |
674 | |
675 #define LINK_OS_ADS_SPEC "" | |
676 | |
677 #define CPP_OS_ADS_SPEC "" | |
678 | |
679 /* Motorola Yellowknife support. */ | |
680 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group" | |
681 | |
682 #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" | |
683 | |
684 #define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s" | |
685 | |
686 #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s" | |
687 | |
688 #define LINK_OS_YELLOWKNIFE_SPEC "" | |
689 | |
690 #define CPP_OS_YELLOWKNIFE_SPEC "" | |
691 | |
692 /* Motorola MVME support. */ | |
693 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group" | |
694 | |
695 #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" | |
696 | |
697 #define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s" | |
698 | |
699 #define LINK_START_MVME_SPEC "-Ttext 0x40000" | |
700 | |
701 #define LINK_OS_MVME_SPEC "" | |
702 | |
703 #define CPP_OS_MVME_SPEC "" | |
704 | |
705 /* PowerPC simulator based on netbsd system calls support. */ | |
706 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group" | |
707 | |
708 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s" | |
709 | |
710 #define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s" | |
711 | |
712 #define LINK_START_SIM_SPEC "" | |
713 | |
714 #define LINK_OS_SIM_SPEC "-m elf32ppcsim" | |
715 | |
716 #define CPP_OS_SIM_SPEC "" | |
717 | |
718 /* FreeBSD support. */ | |
719 | |
720 #define CPP_OS_FREEBSD_SPEC "\ | |
721 -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \ | |
722 -Acpu=powerpc -Amachine=powerpc" | |
723 | |
724 #define STARTFILE_FREEBSD_SPEC FBSD_STARTFILE_SPEC | |
725 #define ENDFILE_FREEBSD_SPEC FBSD_ENDFILE_SPEC | |
726 #define LIB_FREEBSD_SPEC FBSD_LIB_SPEC | |
727 #define LINK_START_FREEBSD_SPEC "" | |
728 | |
729 #define LINK_OS_FREEBSD_SPEC "\ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
730 %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ |
0 | 731 %{v:-V} \ |
732 %{assert*} %{R*} %{rpath*} %{defsym*} \ | |
733 %{shared:-Bshareable %{h*} %{soname*}} \ | |
734 %{!shared: \ | |
735 %{!static: \ | |
736 %{rdynamic: -export-dynamic} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
737 -dynamic-linker %(fbsd_dynamic_linker) } \ |
0 | 738 %{static:-Bstatic}} \ |
739 %{symbolic:-Bsymbolic}" | |
740 | |
741 /* GNU/Linux support. */ | |
742 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \ | |
743 %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \ | |
744 %{!shared: %{profile:-lc_p} %{!profile:-lc}}}" | |
745 | |
111 | 746 #if ENABLE_OFFLOADING == 1 |
747 #define CRTOFFLOADBEGIN "%{fopenacc|fopenmp:crtoffloadbegin%O%s}" | |
748 #define CRTOFFLOADEND "%{fopenacc|fopenmp:crtoffloadend%O%s}" | |
0 | 749 #else |
111 | 750 #define CRTOFFLOADBEGIN "" |
751 #define CRTOFFLOADEND "" | |
0 | 752 #endif |
753 | |
111 | 754 /* STARTFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_STARTFILE_SPEC |
755 but with the mnewlib ecrti.o%s selection substituted for crti.o%s. */ | |
756 #define STARTFILE_LINUX_SPEC \ | |
757 "%{shared:; \ | |
758 pg|p|profile:gcrt1.o%s; \ | |
759 static:crt1.o%s; \ | |
760 static-pie|" PIE_SPEC ":Scrt1.o%s; \ | |
761 :crt1.o%s} \ | |
762 %{mnewlib:ecrti.o%s;:crti.o%s} \ | |
763 %{static:crtbeginT.o%s; \ | |
764 shared|static-pie|" PIE_SPEC ":crtbeginS.o%s; \ | |
765 :crtbegin.o%s} \ | |
766 %{fvtable-verify=none:%s; \ | |
767 fvtable-verify=preinit:vtv_start_preinit.o%s; \ | |
768 fvtable-verify=std:vtv_start.o%s} \ | |
769 " CRTOFFLOADBEGIN | |
770 | |
771 /* ENDFILE_LINUX_SPEC should be the same as GNU_USER_TARGET_ENDFILE_SPEC | |
772 but with the mnewlib ecrtn.o%s selection substituted for crtn.o%s. */ | |
773 #define ENDFILE_LINUX_SPEC \ | |
774 "%{fvtable-verify=none:%s; \ | |
775 fvtable-verify=preinit:vtv_end_preinit.o%s; \ | |
776 fvtable-verify=std:vtv_end.o%s} \ | |
777 %{static:crtend.o%s; \ | |
778 shared|static-pie|" PIE_SPEC ":crtendS.o%s; \ | |
779 :crtend.o%s} \ | |
780 %{mnewlib:ecrtn.o%s;:crtn.o%s} \ | |
781 " CRTOFFLOADEND | |
0 | 782 |
783 #define LINK_START_LINUX_SPEC "" | |
784 | |
111 | 785 #define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","") |
786 | |
0 | 787 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" |
788 #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" | |
111 | 789 #define MUSL_DYNAMIC_LINKER \ |
790 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
791 #if DEFAULT_LIBC == LIBC_UCLIBC |
111 | 792 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \ |
793 "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" | |
794 #elif DEFAULT_LIBC == LIBC_MUSL | |
795 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \ | |
796 "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
797 #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC |
111 | 798 #define CHOOSE_DYNAMIC_LINKER(G, U, M) \ |
799 "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" | |
0 | 800 #else |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
801 #error "Unsupported DEFAULT_LIBC" |
0 | 802 #endif |
111 | 803 #define GNU_USER_DYNAMIC_LINKER \ |
804 CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ | |
805 MUSL_DYNAMIC_LINKER) | |
0 | 806 |
807 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ | |
808 %{rdynamic:-export-dynamic} \ | |
111 | 809 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" |
0 | 810 |
811 #if defined(HAVE_LD_EH_FRAME_HDR) | |
111 | 812 # define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " |
0 | 813 #endif |
814 | |
815 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ | |
816 %{!undef: \ | |
817 %{!ansi: \ | |
818 %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \ | |
819 %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \ | |
820 -Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}" | |
821 | |
822 /* NetBSD support. */ | |
823 #define LIB_NETBSD_SPEC "\ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
824 -lc" |
0 | 825 |
826 #define STARTFILE_NETBSD_SPEC "\ | |
827 ncrti.o%s crt0.o%s \ | |
828 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" | |
829 | |
830 #define ENDFILE_NETBSD_SPEC "\ | |
831 %{!shared:crtend.o%s} %{shared:crtendS.o%s} \ | |
832 ncrtn.o%s" | |
833 | |
834 #define LINK_START_NETBSD_SPEC "\ | |
835 " | |
836 | |
837 #define LINK_OS_NETBSD_SPEC "\ | |
838 %{!shared: %{!static: \ | |
839 %{rdynamic:-export-dynamic} \ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
840 -dynamic-linker /usr/libexec/ld.elf_so}}" |
0 | 841 |
842 #define CPP_OS_NETBSD_SPEC "\ | |
843 -D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__" | |
844 | |
845 /* OpenBSD support. */ | |
846 #ifndef LIB_OPENBSD_SPEC | |
847 #define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}" | |
848 #endif | |
849 | |
850 #ifndef STARTFILE_OPENBSD_SPEC | |
851 #define STARTFILE_OPENBSD_SPEC "\ | |
852 %{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \ | |
853 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" | |
854 #endif | |
855 | |
856 #ifndef ENDFILE_OPENBSD_SPEC | |
857 #define ENDFILE_OPENBSD_SPEC "\ | |
858 %{!shared:crtend.o%s} %{shared:crtendS.o%s}" | |
859 #endif | |
860 | |
861 #ifndef LINK_START_OPENBSD_SPEC | |
862 #define LINK_START_OPENBSD_SPEC "-Ttext 0x400074" | |
863 #endif | |
864 | |
865 #ifndef LINK_OS_OPENBSD_SPEC | |
866 #define LINK_OS_OPENBSD_SPEC "" | |
867 #endif | |
868 | |
869 #ifndef CPP_OS_OPENBSD_SPEC | |
870 #define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}" | |
871 #endif | |
872 | |
873 /* Define any extra SPECS that the compiler needs to generate. */ | |
874 /* Override rs6000.h definition. */ | |
875 #undef SUBTARGET_EXTRA_SPECS | |
876 #define SUBTARGET_EXTRA_SPECS \ | |
877 { "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \ | |
878 { "lib_ads", LIB_ADS_SPEC }, \ | |
879 { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \ | |
880 { "lib_mvme", LIB_MVME_SPEC }, \ | |
881 { "lib_sim", LIB_SIM_SPEC }, \ | |
882 { "lib_freebsd", LIB_FREEBSD_SPEC }, \ | |
883 { "lib_linux", LIB_LINUX_SPEC }, \ | |
884 { "lib_netbsd", LIB_NETBSD_SPEC }, \ | |
885 { "lib_openbsd", LIB_OPENBSD_SPEC }, \ | |
886 { "lib_default", LIB_DEFAULT_SPEC }, \ | |
887 { "startfile_ads", STARTFILE_ADS_SPEC }, \ | |
888 { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \ | |
889 { "startfile_mvme", STARTFILE_MVME_SPEC }, \ | |
890 { "startfile_sim", STARTFILE_SIM_SPEC }, \ | |
891 { "startfile_freebsd", STARTFILE_FREEBSD_SPEC }, \ | |
892 { "startfile_linux", STARTFILE_LINUX_SPEC }, \ | |
893 { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \ | |
894 { "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \ | |
895 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ | |
896 { "endfile_ads", ENDFILE_ADS_SPEC }, \ | |
897 { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \ | |
898 { "endfile_mvme", ENDFILE_MVME_SPEC }, \ | |
899 { "endfile_sim", ENDFILE_SIM_SPEC }, \ | |
900 { "endfile_freebsd", ENDFILE_FREEBSD_SPEC }, \ | |
901 { "endfile_linux", ENDFILE_LINUX_SPEC }, \ | |
902 { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \ | |
903 { "endfile_openbsd", ENDFILE_OPENBSD_SPEC }, \ | |
904 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \ | |
905 { "link_shlib", LINK_SHLIB_SPEC }, \ | |
906 { "link_start", LINK_START_SPEC }, \ | |
907 { "link_start_ads", LINK_START_ADS_SPEC }, \ | |
908 { "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \ | |
909 { "link_start_mvme", LINK_START_MVME_SPEC }, \ | |
910 { "link_start_sim", LINK_START_SIM_SPEC }, \ | |
911 { "link_start_freebsd", LINK_START_FREEBSD_SPEC }, \ | |
912 { "link_start_linux", LINK_START_LINUX_SPEC }, \ | |
913 { "link_start_netbsd", LINK_START_NETBSD_SPEC }, \ | |
914 { "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \ | |
915 { "link_start_default", LINK_START_DEFAULT_SPEC }, \ | |
916 { "link_os", LINK_OS_SPEC }, \ | |
917 { "link_os_ads", LINK_OS_ADS_SPEC }, \ | |
918 { "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \ | |
919 { "link_os_mvme", LINK_OS_MVME_SPEC }, \ | |
920 { "link_os_sim", LINK_OS_SIM_SPEC }, \ | |
921 { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \ | |
922 { "link_os_linux", LINK_OS_LINUX_SPEC }, \ | |
923 { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \ | |
924 { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ | |
925 { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ | |
926 { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ | |
111 | 927 { "link_secure_plt", LINK_SECURE_PLT_SPEC }, \ |
0 | 928 { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ |
929 { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ | |
930 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ | |
931 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \ | |
932 { "cpp_os_freebsd", CPP_OS_FREEBSD_SPEC }, \ | |
933 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ | |
934 { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \ | |
935 { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \ | |
936 { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \ | |
937 { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }, \ | |
938 SUBSUBTARGET_EXTRA_SPECS | |
939 | |
940 #define SUBSUBTARGET_EXTRA_SPECS | |
941 | |
942 /* Define this macro as a C expression for the initializer of an | |
943 array of string to tell the driver program which options are | |
944 defaults for this target and thus do not need to be handled | |
945 specially when using `MULTILIB_OPTIONS'. | |
946 | |
947 Do not define this macro if `MULTILIB_OPTIONS' is not defined in | |
948 the target makefile fragment or if none of the options listed in | |
949 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */ | |
950 | |
951 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" } | |
952 | |
953 /* Define this macro if the code for function profiling should come | |
954 before the function prologue. Normally, the profiling code comes | |
955 after. */ | |
956 #define PROFILE_BEFORE_PROLOGUE 1 | |
957 | |
958 /* Function name to call to do profiling. */ | |
959 #define RS6000_MCOUNT "_mcount" | |
960 | |
961 /* Select a format to encode pointers in exception handling data. CODE | |
962 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is | |
963 true if the symbol may be affected by dynamic relocations. */ | |
111 | 964 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ |
965 (flag_pic \ | |
966 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \ | |
967 | DW_EH_PE_sdata4) \ | |
0 | 968 : DW_EH_PE_absptr) |
969 | |
970 #define DOUBLE_INT_ASM_OP "\t.quad\t" | |
971 | |
972 /* Generate entries in .fixup for relocatable addresses. */ | |
973 #define RELOCATABLE_NEEDS_FIXUP 1 | |
974 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
975 #define TARGET_ASM_FILE_END rs6000_elf_file_end |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
976 |
111 | 977 #undef TARGET_ASAN_SHADOW_OFFSET |
978 #define TARGET_ASAN_SHADOW_OFFSET rs6000_asan_shadow_offset | |
979 | |
0 | 980 /* This target uses the sysv4.opt file. */ |
981 #define TARGET_USES_SYSV4_OPT 1 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
982 |
111 | 983 /* Include order changes for musl, same as in generic linux.h. */ |
984 #if DEFAULT_LIBC == LIBC_MUSL | |
985 #define INCLUDE_DEFAULTS_MUSL_GPP \ | |
986 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ | |
987 GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ | |
988 { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ | |
989 GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ | |
990 { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ | |
991 GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, | |
992 | |
993 #ifdef LOCAL_INCLUDE_DIR | |
994 #define INCLUDE_DEFAULTS_MUSL_LOCAL \ | |
995 { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ | |
996 { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, | |
997 #else | |
998 #define INCLUDE_DEFAULTS_MUSL_LOCAL | |
999 #endif | |
1000 | |
1001 #ifdef PREFIX_INCLUDE_DIR | |
1002 #define INCLUDE_DEFAULTS_MUSL_PREFIX \ | |
1003 { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, | |
1004 #else | |
1005 #define INCLUDE_DEFAULTS_MUSL_PREFIX | |
1006 #endif | |
1007 | |
1008 #ifdef CROSS_INCLUDE_DIR | |
1009 #define INCLUDE_DEFAULTS_MUSL_CROSS \ | |
1010 { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, | |
1011 #else | |
1012 #define INCLUDE_DEFAULTS_MUSL_CROSS | |
1013 #endif | |
1014 | |
1015 #ifdef TOOL_INCLUDE_DIR | |
1016 #define INCLUDE_DEFAULTS_MUSL_TOOL \ | |
1017 { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, | |
1018 #else | |
1019 #define INCLUDE_DEFAULTS_MUSL_TOOL | |
1020 #endif | |
1021 | |
1022 #ifdef NATIVE_SYSTEM_HEADER_DIR | |
1023 #define INCLUDE_DEFAULTS_MUSL_NATIVE \ | |
1024 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ | |
1025 { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, | |
1026 #else | |
1027 #define INCLUDE_DEFAULTS_MUSL_NATIVE | |
1028 #endif | |
1029 | |
1030 #if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) | |
1031 # undef INCLUDE_DEFAULTS_MUSL_LOCAL | |
1032 # define INCLUDE_DEFAULTS_MUSL_LOCAL | |
1033 # undef INCLUDE_DEFAULTS_MUSL_NATIVE | |
1034 # define INCLUDE_DEFAULTS_MUSL_NATIVE | |
1035 #else | |
1036 # undef INCLUDE_DEFAULTS_MUSL_CROSS | |
1037 # define INCLUDE_DEFAULTS_MUSL_CROSS | |
1038 #endif | |
1039 | |
1040 #undef INCLUDE_DEFAULTS | |
1041 #define INCLUDE_DEFAULTS \ | |
1042 { \ | |
1043 INCLUDE_DEFAULTS_MUSL_GPP \ | |
1044 INCLUDE_DEFAULTS_MUSL_LOCAL \ | |
1045 INCLUDE_DEFAULTS_MUSL_PREFIX \ | |
1046 INCLUDE_DEFAULTS_MUSL_CROSS \ | |
1047 INCLUDE_DEFAULTS_MUSL_TOOL \ | |
1048 INCLUDE_DEFAULTS_MUSL_NATIVE \ | |
1049 { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ | |
1050 { 0, 0, 0, 0, 0, 0 } \ | |
1051 } | |
1052 #endif |