1 /* Target definitions for GNU compiler for PowerPC running System V.4 2 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 3 Free Software Foundation, Inc. 4 Contributed by Cygnus Support. 5 6 This file is part of GNU CC. 7 8 GNU CC is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2, or (at your option) 11 any later version. 12 13 GNU CC is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with GNU CC; see the file COPYING. If not, write to 20 the Free Software Foundation, 59 Temple Place - Suite 330, 21 Boston, MA 02111-1307, USA. */ 22 23 24 /* Header files should be C++ aware in general. */ 25 #define NO_IMPLICIT_EXTERN_C 26 27 /* Yes! We are ELF. */ 28 #define TARGET_OBJECT_FORMAT OBJECT_ELF 29 30 /* Default ABI to compile code for. */ 31 #define DEFAULT_ABI rs6000_current_abi 32 33 /* Default ABI to use. */ 34 #define RS6000_ABI_NAME "sysv" 35 36 /* Override rs6000.h definition. */ 37 #undef ASM_DEFAULT_SPEC 38 #define ASM_DEFAULT_SPEC "-mppc" 39 40 /* Small data support types. */ 41 enum rs6000_sdata_type { 42 SDATA_NONE, /* No small data support. */ 43 SDATA_DATA, /* Just put data in .sbss/.sdata, don't use relocs. */ 44 SDATA_SYSV, /* Use r13 to point to .sdata/.sbss. */ 45 SDATA_EABI /* Use r13 like above, r2 points to .sdata2/.sbss2. */ 46 }; 47 48 extern enum rs6000_sdata_type rs6000_sdata; 49 50 /* V.4/eabi switches. */ 51 #define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0. */ 52 #define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */ 53 #define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative. */ 54 #define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec. */ 55 #define MASK_LITTLE_ENDIAN 0x04000000 /* Target is little endian. */ 56 #define MASK_REGNAMES 0x02000000 /* Use alternate register names. */ 57 #define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args. */ 58 #define MASK_NO_BITFIELD_WORD 0x00800000 /* Bitfields cannot cross word boundaries */ 59 60 #define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE) 61 #define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN) 62 #define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE) 63 #define TARGET_EABI (target_flags & MASK_EABI) 64 #define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) 65 #define TARGET_REGNAMES (target_flags & MASK_REGNAMES) 66 #define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE) 67 #define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD) 68 #define TARGET_TOC ((target_flags & MASK_64BIT) \ 69 || ((target_flags & (MASK_RELOCATABLE \ 70 | MASK_MINIMAL_TOC)) \ 71 && flag_pic > 1) \ 72 || DEFAULT_ABI == ABI_AIX) 73 74 #define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE) 75 #define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) 76 #define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE) 77 #define TARGET_NO_TOC (! TARGET_TOC) 78 #define TARGET_NO_EABI (! TARGET_EABI) 79 80 /* Strings provided by SUBTARGET_OPTIONS */ 81 extern const char *rs6000_abi_name; 82 extern const char *rs6000_sdata_name; 83 84 /* Override rs6000.h definition. */ 85 #undef SUBTARGET_OPTIONS 86 #define SUBTARGET_OPTIONS \ 87 { "call-", &rs6000_abi_name, N_("Select ABI calling convention") }, \ 88 { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling") } 89 90 /* Max # of bytes for variables to automatically be put into the .sdata 91 or .sdata2 sections. */ 92 extern int g_switch_value; /* Value of the -G xx switch. */ 93 extern int g_switch_set; /* Whether -G xx was passed. */ 94 95 #define SDATA_DEFAULT_SIZE 8 96 97 /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just 98 the same as -mminimal-toc. */ 99 /* Override rs6000.h definition. */ 100 #undef SUBTARGET_SWITCHES 101 #define SUBTARGET_SWITCHES \ 102 { "bit-align", -MASK_NO_BITFIELD_TYPE, \ 103 N_("Align to the base type of the bit-field") }, \ 104 { "no-bit-align", MASK_NO_BITFIELD_TYPE, \ 105 N_("Don't align to the base type of the bit-field") }, \ 106 { "strict-align", MASK_STRICT_ALIGN, \ 107 N_("Don't assume that unaligned accesses are handled by the system") }, \ 108 { "no-strict-align", -MASK_STRICT_ALIGN, \ 109 N_("Assume that unaligned accesses are handled by the system") }, \ 110 { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ 111 N_("Produce code relocatable at runtime") }, \ 112 { "no-relocatable", -MASK_RELOCATABLE, \ 113 N_("Don't produce code relocatable at runtime") }, \ 114 { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ 115 N_("Produce code relocatable at runtime") }, \ 116 { "no-relocatable-lib", -MASK_RELOCATABLE, \ 117 N_("Don't produce code relocatable at runtime") }, \ 118 { "little-endian", MASK_LITTLE_ENDIAN, \ 119 N_("Produce little endian code") }, \ 120 { "little", MASK_LITTLE_ENDIAN, \ 121 N_("Produce little endian code") }, \ 122 { "big-endian", -MASK_LITTLE_ENDIAN, \ 123 N_("Produce big endian code") }, \ 124 { "big", -MASK_LITTLE_ENDIAN, \ 125 N_("Produce big endian code") }, \ 126 { "no-toc", 0, N_("no description yet") }, \ 127 { "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ 128 { "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ 129 { "prototype", MASK_PROTOTYPE, N_("no description yet") }, \ 130 { "no-prototype", -MASK_PROTOTYPE, N_("no description yet") }, \ 131 { "no-traceback", 0, N_("no description yet") }, \ 132 { "eabi", MASK_EABI, N_("Use EABI") }, \ 133 { "no-eabi", -MASK_EABI, N_("Don't use EABI") }, \ 134 { "bit-word", -MASK_NO_BITFIELD_WORD, "" }, \ 135 { "no-bit-word", MASK_NO_BITFIELD_WORD, \ 136 N_("Do not allow bit-fields to cross word boundaries") }, \ 137 { "regnames", MASK_REGNAMES, \ 138 N_("Use alternate register names") }, \ 139 { "no-regnames", -MASK_REGNAMES, \ 140 N_("Don't use alternate register names") }, \ 141 { "sdata", 0, N_("no description yet") }, \ 142 { "no-sdata", 0, N_("no description yet") }, \ 143 { "sim", 0, \ 144 N_("Link with libsim.a, libc.a and sim-crt0.o") }, \ 145 { "ads", 0, \ 146 N_("Link with libads.a, libc.a and crt0.o") }, \ 147 { "yellowknife", 0, \ 148 N_("Link with libyk.a, libc.a and crt0.o") }, \ 149 { "mvme", 0, \ 150 N_("Link with libmvme.a, libc.a and crt0.o") }, \ 151 { "emb", 0, \ 152 N_("Set the PPC_EMB bit in the ELF flags header") }, \ 153 { "vxworks", 0, N_("no description yet") }, \ 154 { "windiss", 0, N_("Use the WindISS simulator") }, \ 155 { "shlib", 0, N_("no description yet") }, \ 156 EXTRA_SUBTARGET_SWITCHES \ 157 { "newlib", 0, N_("no description yet") }, 158 159 /* This is meant to be redefined in the host dependent files. */ 160 #define EXTRA_SUBTARGET_SWITCHES 161 162 /* Sometimes certain combinations of command options do not make sense 163 on a particular target machine. You can define a macro 164 `OVERRIDE_OPTIONS' to take account of this. This macro, if 165 defined, is executed once just after all the command options have 166 been parsed. 167 168 The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to 169 get control. */ 170 171 #define SUBTARGET_OVERRIDE_OPTIONS \ 172 do { \ 173 if (!g_switch_set) \ 174 g_switch_value = SDATA_DEFAULT_SIZE; \ 175 \ 176 if (!strcmp (rs6000_abi_name, "sysv")) \ 177 rs6000_current_abi = ABI_V4; \ 178 else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \ 179 { \ 180 rs6000_current_abi = ABI_V4; \ 181 target_flags &= ~ MASK_EABI; \ 182 } \ 183 else if (!strcmp (rs6000_abi_name, "sysv-eabi") \ 184 || !strcmp (rs6000_abi_name, "eabi")) \ 185 { \ 186 rs6000_current_abi = ABI_V4; \ 187 target_flags |= MASK_EABI; \ 188 } \ 189 else if (!strcmp (rs6000_abi_name, "aix")) \ 190 { \ 191 rs6000_current_abi = ABI_AIX_NODESC; \ 192 target_flags |= MASK_EABI; \ 193 } \ 194 else if (!strcmp (rs6000_abi_name, "aixdesc")) \ 195 rs6000_current_abi = ABI_AIX; \ 196 else if (!strcmp (rs6000_abi_name, "freebsd")) \ 197 rs6000_current_abi = ABI_V4; \ 198 else if (!strcmp (rs6000_abi_name, "linux")) \ 199 rs6000_current_abi = ABI_V4; \ 200 else if (!strcmp (rs6000_abi_name, "openbsd")) \ 201 rs6000_current_abi = ABI_V4; \ 202 else if (!strcmp (rs6000_abi_name, "gnu")) \ 203 rs6000_current_abi = ABI_V4; \ 204 else if (!strcmp (rs6000_abi_name, "netbsd")) \ 205 rs6000_current_abi = ABI_V4; \ 206 else if (!strcmp (rs6000_abi_name, "i960-old")) \ 207 { \ 208 rs6000_current_abi = ABI_V4; \ 209 target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI \ 210 | MASK_NO_BITFIELD_WORD); \ 211 target_flags &= ~MASK_STRICT_ALIGN; \ 212 } \ 213 else \ 214 { \ 215 rs6000_current_abi = ABI_V4; \ 216 error ("bad value for -mcall-%s", rs6000_abi_name); \ 217 } \ 218 \ 219 if (rs6000_sdata_name) \ 220 { \ 221 if (!strcmp (rs6000_sdata_name, "none")) \ 222 rs6000_sdata = SDATA_NONE; \ 223 else if (!strcmp (rs6000_sdata_name, "data")) \ 224 rs6000_sdata = SDATA_DATA; \ 225 else if (!strcmp (rs6000_sdata_name, "default")) \ 226 rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \ 227 else if (!strcmp (rs6000_sdata_name, "sysv")) \ 228 rs6000_sdata = SDATA_SYSV; \ 229 else if (!strcmp (rs6000_sdata_name, "eabi")) \ 230 rs6000_sdata = SDATA_EABI; \ 231 else \ 232 error ("bad value for -msdata=%s", rs6000_sdata_name); \ 233 } \ 234 else if (DEFAULT_ABI == ABI_V4) \ 235 { \ 236 rs6000_sdata = SDATA_DATA; \ 237 rs6000_sdata_name = "data"; \ 238 } \ 239 else \ 240 { \ 241 rs6000_sdata = SDATA_NONE; \ 242 rs6000_sdata_name = "none"; \ 243 } \ 244 \ 245 if (TARGET_RELOCATABLE && \ 246 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ 247 { \ 248 rs6000_sdata = SDATA_DATA; \ 249 error ("-mrelocatable and -msdata=%s are incompatible", \ 250 rs6000_sdata_name); \ 251 } \ 252 \ 253 else if (flag_pic && \ 254 (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ 255 { \ 256 rs6000_sdata = SDATA_DATA; \ 257 error ("-f%s and -msdata=%s are incompatible", \ 258 (flag_pic > 1) ? "PIC" : "pic", \ 259 rs6000_sdata_name); \ 260 } \ 261 \ 262 if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4) \ 263 || (rs6000_sdata == SDATA_EABI && !TARGET_EABI)) \ 264 { \ 265 rs6000_sdata = SDATA_NONE; \ 266 error ("-msdata=%s and -mcall-%s are incompatible", \ 267 rs6000_sdata_name, rs6000_abi_name); \ 268 } \ 269 \ 270 targetm.have_srodata_section = rs6000_sdata == SDATA_EABI; \ 271 \ 272 if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \ 273 { \ 274 target_flags |= MASK_MINIMAL_TOC; \ 275 error ("-mrelocatable and -mno-minimal-toc are incompatible"); \ 276 } \ 277 \ 278 if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX) \ 279 { \ 280 target_flags &= ~MASK_RELOCATABLE; \ 281 error ("-mrelocatable and -mcall-%s are incompatible", \ 282 rs6000_abi_name); \ 283 } \ 284 \ 285 if (flag_pic > 1 && rs6000_current_abi == ABI_AIX) \ 286 { \ 287 flag_pic = 0; \ 288 error ("-fPIC and -mcall-%s are incompatible", \ 289 rs6000_abi_name); \ 290 } \ 291 \ 292 if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \ 293 { \ 294 target_flags &= ~MASK_LITTLE_ENDIAN; \ 295 error ("-mcall-aixdesc must be big endian"); \ 296 } \ 297 \ 298 /* Treat -fPIC the same as -mrelocatable. */ \ 299 if (flag_pic > 1) \ 300 target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \ 301 \ 302 else if (TARGET_RELOCATABLE) \ 303 flag_pic = 2; \ 304 \ 305 } while (0) 306 307 308 /* Override rs6000.h definition. */ 309 #undef TARGET_DEFAULT 310 #define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS) 311 312 /* Override rs6000.h definition. */ 313 #undef PROCESSOR_DEFAULT 314 #define PROCESSOR_DEFAULT PROCESSOR_PPC750 315 316 #define FIXED_R2 1 317 /* System V.4 uses register 13 as a pointer to the small data area, 318 so it is not available to the normal user. */ 319 #define FIXED_R13 1 320 321 /* Size of the V.4 varargs area if needed. */ 322 /* Override rs6000.h definition. */ 323 #undef RS6000_VARARGS_AREA 324 #define RS6000_VARARGS_AREA ((cfun->machine->sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0) 325 326 /* Override default big endianism definitions in rs6000.h. */ 327 #undef BYTES_BIG_ENDIAN 328 #undef WORDS_BIG_ENDIAN 329 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN) 330 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN) 331 332 /* Define this to set the endianness to use in libgcc2.c, which can 333 not depend on target_flags. */ 334 #if !defined(__LITTLE_ENDIAN__) && !defined(__sun__) 335 #define LIBGCC2_WORDS_BIG_ENDIAN 1 336 #else 337 #define LIBGCC2_WORDS_BIG_ENDIAN 0 338 #endif 339 340 /* Define cutoff for using external functions to save floating point. 341 Currently on V.4, always use inline stores. */ 342 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64) 343 344 /* Put jump tables in read-only memory, rather than in .text. */ 345 #define JUMP_TABLES_IN_TEXT_SECTION 0 346 347 /* Prefix and suffix to use to saving floating point. */ 348 #define SAVE_FP_PREFIX "_savefpr_" 349 #define SAVE_FP_SUFFIX "_l" 350 351 /* Prefix and suffix to use to restoring floating point. */ 352 #define RESTORE_FP_PREFIX "_restfpr_" 353 #define RESTORE_FP_SUFFIX "_l" 354 355 /* Type used for ptrdiff_t, as a string used in a declaration. */ 356 #define PTRDIFF_TYPE "int" 357 358 /* Type used for wchar_t, as a string used in a declaration. */ 359 /* Override svr4.h definition. */ 360 #undef WCHAR_TYPE 361 #define WCHAR_TYPE "long int" 362 363 /* Width of wchar_t in bits. */ 364 /* Override svr4.h definition. */ 365 #undef WCHAR_TYPE_SIZE 366 #define WCHAR_TYPE_SIZE 32 367 368 /* Make int foo : 8 not cause structures to be aligned to an int boundary. */ 369 /* Override elfos.h definition. */ 370 #undef PCC_BITFIELD_TYPE_MATTERS 371 #define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE) 372 373 #undef BITFIELD_NBYTES_LIMITED 374 #define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD) 375 376 /* Define this macro to be the value 1 if instructions will fail to 377 work if given data not on the nominal alignment. If instructions 378 will merely go slower in that case, define this macro as 0. */ 379 #undef STRICT_ALIGNMENT 380 #define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN) 381 382 /* Alignment in bits of the stack boundary. Note, in order to allow building 383 one set of libraries with -mno-eabi instead of eabi libraries and non-eabi 384 versions, just use 64 as the stack boundary. */ 385 #undef STACK_BOUNDARY 386 #define STACK_BOUNDARY (TARGET_ALTIVEC_ABI ? 128 : 64) 387 388 /* Define this macro if you wish to preserve a certain alignment for 389 the stack pointer, greater than what the hardware enforces. The 390 definition is a C expression for the desired alignment (measured 391 in bits). This macro must evaluate to a value equal to or larger 392 than STACK_BOUNDARY. 393 For the SYSV ABI and variants the alignment of the stack pointer 394 is usually controlled manually in rs6000.c. However, to maintain 395 alignment across alloca () in all circumstances, 396 PREFERRED_STACK_BOUNDARY needs to be set as well. 397 This has the additional advantage of allowing a bigger maximum 398 alignment of user objects on the stack. */ 399 400 #undef PREFERRED_STACK_BOUNDARY 401 #define PREFERRED_STACK_BOUNDARY 128 402 403 /* Real stack boundary as mandated by the appropriate ABI. */ 404 #define ABI_STACK_BOUNDARY ((TARGET_EABI && !TARGET_ALTIVEC_ABI) ? 64 : 128) 405 406 /* An expression for the alignment of a structure field FIELD if the 407 alignment computed in the usual way is COMPUTED. */ 408 #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ 409 ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \ 410 ? 128 : COMPUTED) 411 412 /* Define this macro as an expression for the alignment of a type 413 (given by TYPE as a tree node) if the alignment computed in the 414 usual way is COMPUTED and the alignment explicitly specified was 415 SPECIFIED. */ 416 #define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED) \ 417 ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) \ 418 ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \ 419 : MAX (COMPUTED, SPECIFIED)) 420 421 #undef BIGGEST_FIELD_ALIGNMENT 422 423 /* Use ELF style section commands. */ 424 425 #define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" 426 427 #define DATA_SECTION_ASM_OP "\t.section\t\".data\"" 428 429 #define BSS_SECTION_ASM_OP "\t.section\t\".bss\"" 430 431 /* Override elfos.h definition. */ 432 #undef INIT_SECTION_ASM_OP 433 #define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\"" 434 435 /* Override elfos.h definition. */ 436 #undef FINI_SECTION_ASM_OP 437 #define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\"" 438 439 #define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\"" 440 441 /* Put PC relative got entries in .got2. */ 442 #define MINIMAL_TOC_SECTION_ASM_OP \ 443 ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"") 444 445 #define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\"" 446 #define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\"" 447 #define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits" 448 449 /* Besides the usual ELF sections, we need a toc section. */ 450 /* Override elfos.h definition. */ 451 #undef EXTRA_SECTIONS 452 #define EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini 453 454 /* Override elfos.h definition. */ 455 #undef EXTRA_SECTION_FUNCTIONS 456 #define EXTRA_SECTION_FUNCTIONS \ 457 TOC_SECTION_FUNCTION \ 458 SDATA_SECTION_FUNCTION \ 459 SDATA2_SECTION_FUNCTION \ 460 SBSS_SECTION_FUNCTION \ 461 INIT_SECTION_FUNCTION \ 462 FINI_SECTION_FUNCTION 463 464 #define TOC_SECTION_FUNCTION \ 465 void \ 466 toc_section () \ 467 { \ 468 if (in_section != in_toc) \ 469 { \ 470 in_section = in_toc; \ 471 if (DEFAULT_ABI == ABI_AIX \ 472 && TARGET_MINIMAL_TOC \ 473 && !TARGET_RELOCATABLE) \ 474 { \ 475 if (! toc_initialized) \ 476 { \ 477 toc_initialized = 1; \ 478 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ 479 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LCTOC", 0); \ 480 fprintf (asm_out_file, "\t.tc "); \ 481 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \ 482 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ 483 fprintf (asm_out_file, "\n"); \ 484 \ 485 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ 486 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ 487 fprintf (asm_out_file, " = .+32768\n"); \ 488 } \ 489 else \ 490 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ 491 } \ 492 else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE) \ 493 fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ 494 else \ 495 { \ 496 fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ 497 if (! toc_initialized) \ 498 { \ 499 ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ 500 fprintf (asm_out_file, " = .+32768\n"); \ 501 toc_initialized = 1; \ 502 } \ 503 } \ 504 } \ 505 } \ 506 \ 507 extern int in_toc_section PARAMS ((void)); \ 508 int in_toc_section () \ 509 { \ 510 return in_section == in_toc; \ 511 } 512 513 #define SDATA_SECTION_FUNCTION \ 514 void \ 515 sdata_section () \ 516 { \ 517 if (in_section != in_sdata) \ 518 { \ 519 in_section = in_sdata; \ 520 fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ 521 } \ 522 } 523 524 #define SDATA2_SECTION_FUNCTION \ 525 void \ 526 sdata2_section () \ 527 { \ 528 if (in_section != in_sdata2) \ 529 { \ 530 in_section = in_sdata2; \ 531 fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \ 532 } \ 533 } 534 535 #define SBSS_SECTION_FUNCTION \ 536 void \ 537 sbss_section () \ 538 { \ 539 if (in_section != in_sbss) \ 540 { \ 541 in_section = in_sbss; \ 542 fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \ 543 } \ 544 } 545 546 #define INIT_SECTION_FUNCTION \ 547 void \ 548 init_section () \ 549 { \ 550 if (in_section != in_init) \ 551 { \ 552 in_section = in_init; \ 553 fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \ 554 } \ 555 } 556 557 #define FINI_SECTION_FUNCTION \ 558 void \ 559 fini_section () \ 560 { \ 561 if (in_section != in_fini) \ 562 { \ 563 in_section = in_fini; \ 564 fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \ 565 } \ 566 } 567 568 /* Override default elf definitions. */ 569 #undef TARGET_ASM_SELECT_RTX_SECTION 570 #define TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section 571 #undef TARGET_ASM_SELECT_SECTION 572 #define TARGET_ASM_SELECT_SECTION rs6000_elf_select_section 573 #define TARGET_ASM_UNIQUE_SECTION rs6000_elf_unique_section 574 575 /* Return nonzero if this entry is to be written into the constant pool 576 in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST 577 containing one of them. If -mfp-in-toc (the default), we also do 578 this for floating-point constants. We actually can only do this 579 if the FP formats of the target and host machines are the same, but 580 we can't check that since not every file that uses 581 GO_IF_LEGITIMATE_ADDRESS_P includes real.h. 582 583 Unlike AIX, we don't key off of -mminimal-toc, but instead do not 584 allow floating point constants in the TOC if -mrelocatable. */ 585 586 #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P 587 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ 588 (TARGET_TOC \ 589 && (GET_CODE (X) == SYMBOL_REF \ 590 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ 591 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ 592 || GET_CODE (X) == LABEL_REF \ 593 || (GET_CODE (X) == CONST_INT \ 594 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ 595 || (!TARGET_NO_FP_IN_TOC \ 596 && !TARGET_RELOCATABLE \ 597 && GET_CODE (X) == CONST_DOUBLE \ 598 && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ 599 && BITS_PER_WORD == HOST_BITS_PER_INT))) 600 601 /* These macros generate the special .type and .size directives which 602 are used to set the corresponding fields of the linker symbol table 603 entries in an ELF object file under SVR4. These macros also output 604 the starting labels for the relevant functions/objects. */ 605 606 /* Write the extra assembler code needed to declare a function properly. 607 Some svr4 assemblers need to also have something extra said about the 608 function's return value. We allow for that here. */ 609 610 extern int rs6000_pic_labelno; 611 612 /* Override elfos.h definition. */ 613 #undef ASM_DECLARE_FUNCTION_NAME 614 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 615 do { \ 616 const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \ 617 \ 618 if (TARGET_RELOCATABLE \ 619 && (get_pool_size () != 0 || current_function_profile) \ 620 && uses_TOC()) \ 621 { \ 622 char buf[256]; \ 623 \ 624 ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \ 625 \ 626 ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \ 627 fprintf (FILE, "\t%s ", init_ptr); \ 628 assemble_name (FILE, buf); \ 629 putc ('-', FILE); \ 630 ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \ 631 assemble_name (FILE, buf); \ 632 putc ('\n', FILE); \ 633 } \ 634 \ 635 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ 636 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ 637 \ 638 if (DEFAULT_ABI == ABI_AIX) \ 639 { \ 640 const char *desc_name, *orig_name; \ 641 \ 642 orig_name = (*targetm.strip_name_encoding) (NAME); \ 643 desc_name = orig_name; \ 644 while (*desc_name == '.') \ 645 desc_name++; \ 646 \ 647 if (TREE_PUBLIC (DECL)) \ 648 fprintf (FILE, "\t.globl %s\n", desc_name); \ 649 \ 650 fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ 651 fprintf (FILE, "%s:\n", desc_name); \ 652 fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \ 653 fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \ 654 if (DEFAULT_ABI == ABI_AIX) \ 655 fprintf (FILE, "\t%s 0\n", init_ptr); \ 656 fprintf (FILE, "\t.previous\n"); \ 657 } \ 658 ASM_OUTPUT_LABEL (FILE, NAME); \ 659 } while (0) 660 661 /* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore 662 flag. The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */ 663 664 #define LOCAL_LABEL_PREFIX "." 665 #define USER_LABEL_PREFIX "" 666 667 /* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */ 668 669 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \ 670 asm_fprintf (FILE, "%L%s", PREFIX) 671 672 /* Globalizing directive for a label. */ 673 #define GLOBAL_ASM_OP "\t.globl " 674 675 /* This says how to output assembler code to declare an 676 uninitialized internal linkage data object. Under SVR4, 677 the linker seems to want the alignment of data objects 678 to depend on their types. We do exactly that here. */ 679 680 #define LOCAL_ASM_OP "\t.local\t" 681 682 #define LCOMM_ASM_OP "\t.lcomm\t" 683 684 /* Override elfos.h definition. */ 685 #undef ASM_OUTPUT_ALIGNED_LOCAL 686 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 687 do { \ 688 if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \ 689 && (SIZE) <= g_switch_value) \ 690 { \ 691 sbss_section (); \ 692 ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ 693 ASM_OUTPUT_LABEL (FILE, NAME); \ 694 ASM_OUTPUT_SKIP (FILE, SIZE); \ 695 if (!flag_inhibit_size_directive && (SIZE) > 0) \ 696 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE); \ 697 } \ 698 else \ 699 { \ 700 fprintf (FILE, "%s", LCOMM_ASM_OP); \ 701 assemble_name ((FILE), (NAME)); \ 702 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ 703 } \ 704 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ 705 } while (0) 706 707 /* Describe how to emit uninitialized external linkage items. */ 708 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ 709 do { \ 710 ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \ 711 } while (0) 712 713 /* This is how to output code to push a register on the stack. 714 It need not be very fast code. 715 716 On the rs6000, we must keep the backchain up to date. In order 717 to simplify things, always allocate 16 bytes for a push (System V 718 wants to keep stack aligned to a 16 byte boundary). */ 719 720 #define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \ 721 do { \ 722 if (DEFAULT_ABI == ABI_V4) \ 723 asm_fprintf (FILE, \ 724 "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n", \ 725 reg_names[1], reg_names[1], reg_names[REGNO], \ 726 reg_names[1]); \ 727 } while (0) 728 729 /* This is how to output an insn to pop a register from the stack. 730 It need not be very fast code. */ 731 732 #define ASM_OUTPUT_REG_POP(FILE, REGNO) \ 733 do { \ 734 if (DEFAULT_ABI == ABI_V4) \ 735 asm_fprintf (FILE, \ 736 "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n", \ 737 reg_names[REGNO], reg_names[1], reg_names[1], \ 738 reg_names[1]); \ 739 } while (0) 740 741 /* Switch Recognition by gcc.c. Add -G xx support. */ 742 743 /* Override svr4.h definition. */ 744 #undef SWITCH_TAKES_ARG 745 #define SWITCH_TAKES_ARG(CHAR) \ 746 ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \ 747 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ 748 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \ 749 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \ 750 || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G') 751 752 /* Output .file. */ 753 /* Override elfos.h definition. */ 754 #undef ASM_FILE_START 755 #define ASM_FILE_START(FILE) \ 756 do { \ 757 output_file_directive ((FILE), main_input_filename); \ 758 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \ 759 } while (0) 760 761 762 extern int fixuplabelno; 763 764 /* Handle constructors specially for -mrelocatable. */ 765 #define TARGET_ASM_CONSTRUCTOR rs6000_elf_asm_out_constructor 766 #define TARGET_ASM_DESTRUCTOR rs6000_elf_asm_out_destructor 767 768 /* This is the end of what might become sysv4.h. */ 769 770 /* Use DWARF 2 debugging information by default. */ 771 #undef PREFERRED_DEBUGGING_TYPE 772 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG 773 774 /* Historically we have also supported stabs debugging. */ 775 #define DBX_DEBUGGING_INFO 1 776 777 #define TARGET_ENCODE_SECTION_INFO rs6000_elf_encode_section_info 778 #define TARGET_STRIP_NAME_ENCODING rs6000_elf_strip_name_encoding 779 #define TARGET_IN_SMALL_DATA_P rs6000_elf_in_small_data_p 780 #define TARGET_SECTION_TYPE_FLAGS rs6000_elf_section_type_flags 781 782 /* The ELF version doesn't encode [DS] or whatever at the end of symbols. */ 783 784 #define RS6000_OUTPUT_BASENAME(FILE, NAME) \ 785 assemble_name (FILE, NAME) 786 787 /* This is how to output a reference to a user-level label named NAME. 788 `assemble_name' uses this. */ 789 790 /* Override elfos.h definition. */ 791 #undef ASM_OUTPUT_LABELREF 792 #define ASM_OUTPUT_LABELREF(FILE,NAME) \ 793 do { \ 794 const char *_name = NAME; \ 795 if (*_name == '@') \ 796 _name++; \ 797 \ 798 if (*_name == '*') \ 799 fprintf (FILE, "%s", _name + 1); \ 800 else \ 801 asm_fprintf (FILE, "%U%s", _name); \ 802 } while (0) 803 804 /* But, to make this work, we have to output the stabs for the function 805 name *first*... */ 806 807 #define DBX_FUNCTION_FIRST 808 809 /* This is the end of what might become sysv4dbx.h. */ 810 811 #ifndef TARGET_VERSION 812 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)"); 813 #endif 814 815 #ifndef TARGET_OS_CPP_BUILTINS 816 #define TARGET_OS_CPP_BUILTINS() \ 817 do \ 818 { \ 819 builtin_define_std ("PPC"); \ 820 builtin_define_std ("unix"); \ 821 builtin_define ("__svr4__"); \ 822 builtin_assert ("system=unix"); \ 823 builtin_assert ("system=svr4"); \ 824 builtin_assert ("cpu=powerpc"); \ 825 builtin_assert ("machine=powerpc"); \ 826 } \ 827 while (0) 828 #endif 829 830 /* Pass various options to the assembler. */ 831 /* Override svr4.h definition. */ 832 #undef ASM_SPEC 833 #define ASM_SPEC "%(asm_cpu) \ 834 %{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \ 835 %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ 836 %{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ 837 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \ 838 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \ 839 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ 840 %{mcall-freebsd: -mbig} \ 841 %{mcall-i960-old: -mlittle} \ 842 %{mcall-linux: -mbig} \ 843 %{mcall-openbsd: -mbig} \ 844 %{mcall-gnu: -mbig} \ 845 %{mcall-netbsd: -mbig} \ 846 }}}}" 847 848 #define CC1_ENDIAN_BIG_SPEC "" 849 850 #define CC1_ENDIAN_LITTLE_SPEC "\ 851 %{!mstrict-align: %{!mno-strict-align: \ 852 %{!mcall-i960-old: \ 853 -mstrict-align \ 854 } \ 855 }}" 856 857 #define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)" 858 859 /* Pass -G xxx to the compiler and set correct endian mode. */ 860 #define CC1_SPEC "%{G*} \ 861 %{mlittle: %(cc1_endian_little)} %{!mlittle: %{mlittle-endian: %(cc1_endian_little)}} \ 862 %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \ 863 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ 864 %{mcall-aixdesc: -mbig %(cc1_endian_big) } \ 865 %{mcall-freebsd: -mbig %(cc1_endian_big) } \ 866 %{mcall-i960-old: -mlittle %(cc1_endian_little) } \ 867 %{mcall-linux: -mbig %(cc1_endian_big) } \ 868 %{mcall-openbsd: -mbig %(cc1_endian_big) } \ 869 %{mcall-gnu: -mbig %(cc1_endian_big) } \ 870 %{mcall-netbsd: -mbig %(cc1_endian_big) } \ 871 %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-i960-old: %{!mcall-linux: \ 872 %{!mcall-openbsd: %{!mcall-gnu: %{!mcall-netbsd: \ 873 %(cc1_endian_default) \ 874 }}}}}}} \ 875 }}}} \ 876 %{mno-sdata: -msdata=none } \ 877 %{meabi: %{!mcall-*: -mcall-sysv }} \ 878 %{!meabi: %{!mno-eabi: \ 879 %{mrelocatable: -meabi } \ 880 %{mcall-freebsd: -mno-eabi } \ 881 %{mcall-i960-old: -meabi } \ 882 %{mcall-linux: -mno-eabi } \ 883 %{mcall-openbsd: -mno-eabi } \ 884 %{mcall-gnu: -mno-eabi } \ 885 %{mcall-netbsd: -mno-eabi }}} \ 886 %{msdata: -msdata=default} \ 887 %{mno-sdata: -msdata=none} \ 888 %{profile: -p}" 889 890 /* Don't put -Y P,<path> for cross compilers. */ 891 #ifndef CROSS_COMPILE 892 #define LINK_PATH_SPEC "\ 893 %{!R*:%{L*:-R %*}} \ 894 %{!nostdlib: %{!YP,*: \ 895 %{compat-bsd: \ 896 %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 897 %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \ 898 %{!R*: %{!L*: -R /usr/ucblib}} \ 899 %{!compat-bsd: \ 900 %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ 901 %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}" 902 903 #else 904 #define LINK_PATH_SPEC "" 905 #endif 906 907 /* Default starting address if specified. */ 908 #define LINK_START_SPEC "\ 909 %{mads: %(link_start_ads) } \ 910 %{myellowknife: %(link_start_yellowknife) } \ 911 %{mmvme: %(link_start_mvme) } \ 912 %{msim: %(link_start_sim) } \ 913 %{mwindiss: %(link_start_windiss) } \ 914 %{mcall-freebsd: %(link_start_freebsd) } \ 915 %{mcall-linux: %(link_start_linux) } \ 916 %{mcall-openbsd: %(link_start_openbsd) } \ 917 %{mcall-gnu: %(link_start_gnu) } \ 918 %{mcall-netbsd: %(link_start_netbsd) } \ 919 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \ 920 %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: %{!mcall-netbsd: \ 921 %{!mcall-freebsd: %(link_start_default) }}}}}}}}}}" 922 923 #define LINK_START_DEFAULT_SPEC "" 924 925 /* Override svr4.h definition. */ 926 #undef LINK_SPEC 927 #define LINK_SPEC "\ 928 %{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \ 929 %{YP,*} %{R*} \ 930 %{Qy:} %{!Qn:-Qy} \ 931 %(link_shlib) \ 932 %{!Wl,-T*: %{!T*: %(link_start) }} \ 933 %(link_target) \ 934 %(link_os)" 935 936 /* For now, turn off shared libraries by default. */ 937 #ifndef SHARED_LIB_SUPPORT 938 #define NO_SHARED_LIB_SUPPORT 939 #endif 940 941 #ifndef NO_SHARED_LIB_SUPPORT 942 /* Shared libraries are default. */ 943 #define LINK_SHLIB_SPEC "\ 944 %{!static: %(link_path) %{!R*:%{L*:-R %*}}} \ 945 %{mshlib: } \ 946 %{static:-dn -Bstatic} \ 947 %{shared:-G -dy -z text} \ 948 %{symbolic:-Bsymbolic -G -dy -z text}" 949 950 #else 951 /* Shared libraries are not default. */ 952 #define LINK_SHLIB_SPEC "\ 953 %{mshlib: %(link_path) } \ 954 %{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \ 955 %{static: } \ 956 %{shared:-G -dy -z text %(link_path) } \ 957 %{symbolic:-Bsymbolic -G -dy -z text %(link_path) }" 958 #endif 959 960 /* Override the default target of the linker. */ 961 #define LINK_TARGET_SPEC "\ 962 %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \ 963 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ 964 %{mcall-i960-old: --oformat elf32-powerpcle} \ 965 }}}}" 966 967 /* Any specific OS flags. */ 968 #define LINK_OS_SPEC "\ 969 %{mads: %(link_os_ads) } \ 970 %{myellowknife: %(link_os_yellowknife) } \ 971 %{mmvme: %(link_os_mvme) } \ 972 %{msim: %(link_os_sim) } \ 973 %{mwindiss: %(link_os_windiss) } \ 974 %{mcall-freebsd: %(link_os_freebsd) } \ 975 %{mcall-linux: %(link_os_linux) } \ 976 %{mcall-openbsd: %(link_os_openbsd) } \ 977 %{mcall-gnu: %(link_os_gnu) } \ 978 %{mcall-netbsd: %(link_os_netbsd) } \ 979 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \ 980 %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \ 981 %{!mcall-netbsd: %(link_os_default) }}}}}}}}}}" 982 983 #define LINK_OS_DEFAULT_SPEC "" 984 985 #define CPP_SYSV_SPEC \ 986 "%{mrelocatable*: -D_RELOCATABLE} \ 987 %{fpic: -D__PIC__=1 -D__pic__=1} \ 988 %{!fpic: %{fPIC: -D__PIC__=2 -D__pic__=2}}" 989 990 /* Override rs6000.h definition. */ 991 #undef CPP_SPEC 992 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) \ 993 %{mads: %(cpp_os_ads) } \ 994 %{myellowknife: %(cpp_os_yellowknife) } \ 995 %{mmvme: %(cpp_os_mvme) } \ 996 %{msim: %(cpp_os_sim) } \ 997 %{mwindiss: %(cpp_os_windiss) } \ 998 %{mcall-freebsd: %(cpp_os_freebsd) } \ 999 %{mcall-openbsd: %(cpp_os_openbsd) } \ 1000 %{mcall-linux: %(cpp_os_linux) } \ 1001 %{mcall-gnu: %(cpp_os_gnu) } \ 1002 %{mcall-netbsd: %(cpp_os_netbsd) } \ 1003 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \ 1004 %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \ 1005 %{!mcall-netbsd: %(cpp_os_default) }}}}}}}}}}" 1006 1007 #define CPP_OS_DEFAULT_SPEC "" 1008 1009 /* Override svr4.h definition. */ 1010 #undef STARTFILE_SPEC 1011 #define STARTFILE_SPEC "\ 1012 %{mads: %(startfile_ads) } \ 1013 %{myellowknife: %(startfile_yellowknife) } \ 1014 %{mmvme: %(startfile_mvme) } \ 1015 %{msim: %(startfile_sim) } \ 1016 %{mwindiss: %(startfile_windiss) } \ 1017 %{mcall-freebsd: %(startfile_freebsd) } \ 1018 %{mcall-linux: %(startfile_linux) } \ 1019 %{mcall-openbsd: %(startfile_openbsd) } \ 1020 %{mcall-gnu: %(startfile_gnu) } \ 1021 %{mcall-netbsd: %(startfile_netbsd) } \ 1022 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \ 1023 %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \ 1024 %{!mcall-netbsd: %(startfile_default) }}}}}}}}}}" 1025 1026 #define STARTFILE_DEFAULT_SPEC "" 1027 1028 /* Override svr4.h definition. */ 1029 #undef LIB_SPEC 1030 #define LIB_SPEC "\ 1031 %{mads: %(lib_ads) } \ 1032 %{myellowknife: %(lib_yellowknife) } \ 1033 %{mmvme: %(lib_mvme) } \ 1034 %{msim: %(lib_sim) } \ 1035 %{mwindiss: %(lib_windiss) } \ 1036 %{mcall-freebsd: %(lib_freebsd) } \ 1037 %{mcall-linux: %(lib_linux) } \ 1038 %{mcall-openbsd: %(lib_openbsd) } \ 1039 %{mcall-gnu: %(lib_gnu) } \ 1040 %{mcall-netbsd: %(lib_netbsd) } \ 1041 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \ 1042 %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \ 1043 %{!mcall-netbsd: %(lib_default) }}}}}}}}}}" 1044 1045 #define LIB_DEFAULT_SPEC "" 1046 1047 /* Override svr4.h definition. */ 1048 #undef ENDFILE_SPEC 1049 #define ENDFILE_SPEC "\ 1050 %{mads: crtsavres.o%s %(endfile_ads)} \ 1051 %{myellowknife: crtsavres.o%s %(endfile_yellowknife)} \ 1052 %{mmvme: crtsavres.o%s %(endfile_mvme)} \ 1053 %{msim: crtsavres.o%s %(endfile_sim)} \ 1054 %{mwindiss: %(endfile_windiss)} \ 1055 %{mcall-freebsd: crtsavres.o%s %(endfile_freebsd) } \ 1056 %{mcall-linux: crtsavres.o%s %(endfile_linux) } \ 1057 %{mcall-openbsd: crtsavres.o%s %(endfile_openbsd) } \ 1058 %{mcall-gnu: crtsavres.o%s %(endfile_gnu) } \ 1059 %{mcall-netbsd: crtsavres.o%s %(endfile_netbsd) } \ 1060 %{mvxworks: crtsavres.o%s %(endfile_vxworks) } \ 1061 %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mwindiss: \ 1062 %{!mcall-freebsd: %{!mcall-linux: %{!mcall-openbsd: %{!mcall-gnu: \ 1063 %{!mcall-netbsd: %{!mvxworks: %(crtsavres_default) \ 1064 %(endfile_default) }}}}}}}}}}}" 1065 1066 #define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s" 1067 1068 #define ENDFILE_DEFAULT_SPEC "" 1069 1070 /* Motorola ADS support. */ 1071 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group" 1072 1073 #define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" 1074 1075 #define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s" 1076 1077 #define LINK_START_ADS_SPEC "-T ads.ld%s" 1078 1079 #define LINK_OS_ADS_SPEC "" 1080 1081 #define CPP_OS_ADS_SPEC "" 1082 1083 /* Motorola Yellowknife support. */ 1084 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group" 1085 1086 #define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" 1087 1088 #define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s" 1089 1090 #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s" 1091 1092 #define LINK_OS_YELLOWKNIFE_SPEC "" 1093 1094 #define CPP_OS_YELLOWKNIFE_SPEC "" 1095 1096 /* Motorola MVME support. */ 1097 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group" 1098 1099 #define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" 1100 1101 #define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s" 1102 1103 #define LINK_START_MVME_SPEC "-Ttext 0x40000" 1104 1105 #define LINK_OS_MVME_SPEC "" 1106 1107 #define CPP_OS_MVME_SPEC "" 1108 1109 /* PowerPC simulator based on netbsd system calls support. */ 1110 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group" 1111 1112 #define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s" 1113 1114 #define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s" 1115 1116 #define LINK_START_SIM_SPEC "" 1117 1118 #define LINK_OS_SIM_SPEC "-m elf32ppcsim" 1119 1120 #define CPP_OS_SIM_SPEC "" 1121 1122 /* FreeBSD support. */ 1123 1124 #define CPP_OS_FREEBSD_SPEC "\ 1125 -D__ELF__ -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \ 1126 -Acpu=powerpc -Amachine=powerpc" 1127 1128 #define STARTFILE_FREEBSD_SPEC FBSD_STARTFILE_SPEC 1129 #define ENDFILE_FREEBSD_SPEC FBSD_ENDFILE_SPEC 1130 #define LIB_FREEBSD_SPEC FBSD_LIB_SPEC 1131 #define LINK_START_FREEBSD_SPEC "" 1132 1133 #define LINK_OS_FREEBSD_SPEC "\ 1134 %{p:%e`-p' not supported; use `-pg' and gprof(1)} \ 1135 %{Wl,*:%*} \ 1136 %{v:-V} \ 1137 %{assert*} %{R*} %{rpath*} %{defsym*} \ 1138 %{shared:-Bshareable %{h*} %{soname*}} \ 1139 %{!shared: \ 1140 %{!static: \ 1141 %{rdynamic: -export-dynamic} \ 1142 %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}} \ 1143 %{static:-Bstatic}} \ 1144 %{symbolic:-Bsymbolic}" 1145 1146 /* GNU/Linux support. */ 1147 #ifdef USE_GNULIBC_1 1148 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \ 1149 %{!mnewlib: -lc }" 1150 #else 1151 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \ 1152 %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} %{!shared: \ 1153 %{profile:-lc_p} %{!profile:-lc}}}" 1154 #endif 1155 1156 #ifdef USE_GNULIBC_1 1157 #define STARTFILE_LINUX_SPEC "\ 1158 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ 1159 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \ 1160 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" 1161 #else 1162 #define STARTFILE_LINUX_SPEC "\ 1163 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ 1164 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \ 1165 %{static:crtbeginT.o%s} \ 1166 %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 1167 #endif 1168 1169 #define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \ 1170 %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}" 1171 1172 #define LINK_START_LINUX_SPEC "" 1173 1174 #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ 1175 %{rdynamic:-export-dynamic} \ 1176 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" 1177 1178 #if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR) 1179 # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " 1180 #endif 1181 1182 #ifdef USE_GNULIBC_1 1183 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ 1184 %{!undef: \ 1185 %{!ansi: \ 1186 %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \ 1187 %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \ 1188 -Asystem=unix -Asystem=posix" 1189 #else 1190 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ 1191 %{!undef: \ 1192 %{!ansi: \ 1193 %{!std=*:-Dunix -D__unix -Dlinux -D__linux} \ 1194 %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \ 1195 -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}" 1196 #endif 1197 1198 /* GNU/Hurd support. */ 1199 #define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \ 1200 %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \ 1201 %{profile:-lc_p} %{!profile:-lc}}}" 1202 1203 #define STARTFILE_GNU_SPEC "\ 1204 %{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \ 1205 %{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \ 1206 %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \ 1207 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" 1208 1209 #define ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \ 1210 %{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}" 1211 1212 #define LINK_START_GNU_SPEC "" 1213 1214 #define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \ 1215 %{rdynamic:-export-dynamic} \ 1216 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" 1217 1218 #define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__ \ 1219 %{!undef: \ 1220 %{!ansi: -Dunix -D__unix}} \ 1221 -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}" 1222 1223 /* NetBSD support. */ 1224 #define LIB_NETBSD_SPEC "\ 1225 %{profile:-lgmon -lc_p} %{!profile:-lc}" 1226 1227 #define STARTFILE_NETBSD_SPEC "\ 1228 ncrti.o%s crt0.o%s \ 1229 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" 1230 1231 #define ENDFILE_NETBSD_SPEC "\ 1232 %{!shared:crtend.o%s} %{shared:crtendS.o%s} \ 1233 ncrtn.o%s" 1234 1235 #define LINK_START_NETBSD_SPEC "\ 1236 " 1237 1238 #define LINK_OS_NETBSD_SPEC "\ 1239 %{!shared: %{!static: \ 1240 %{rdynamic:-export-dynamic} \ 1241 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}" 1242 1243 #define CPP_OS_NETBSD_SPEC "\ 1244 -D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__" 1245 1246 /* RTEMS support. */ 1247 1248 #define CPP_OS_RTEMS_SPEC "\ 1249 %{!mcpu*: %{!Dppc*: %{!Dmpc*: -Dmpc750} } }\ 1250 %{mcpu=403: %{!Dppc*: %{!Dmpc*: -Dppc403} } } \ 1251 %{mcpu=505: %{!Dppc*: %{!Dmpc*: -Dmpc505} } } \ 1252 %{mcpu=601: %{!Dppc*: %{!Dmpc*: -Dppc601} } } \ 1253 %{mcpu=602: %{!Dppc*: %{!Dmpc*: -Dppc602} } } \ 1254 %{mcpu=603: %{!Dppc*: %{!Dmpc*: -Dppc603} } } \ 1255 %{mcpu=603e: %{!Dppc*: %{!Dmpc*: -Dppc603e} } } \ 1256 %{mcpu=604: %{!Dppc*: %{!Dmpc*: -Dmpc604} } } \ 1257 %{mcpu=750: %{!Dppc*: %{!Dmpc*: -Dmpc750} } } \ 1258 %{mcpu=821: %{!Dppc*: %{!Dmpc*: -Dmpc821} } } \ 1259 %{mcpu=860: %{!Dppc*: %{!Dmpc*: -Dmpc860} } }" 1260 1261 /* OpenBSD support. */ 1262 #ifndef LIB_OPENBSD_SPEC 1263 #define LIB_OPENBSD_SPEC "%{mnewlib: --start-group %(libc_openbsd) --end-group } %{!mnewlib: %(libc_openbsd) }" 1264 #endif 1265 1266 #ifndef LIBC_OPENBSD_SPEC 1267 #define LIBC_OPENBSD_SPEC OBSD_LIB_SPEC 1268 #endif 1269 1270 #ifndef STARTFILE_OPENBSD_SPEC 1271 #define STARTFILE_OPENBSD_SPEC "\ 1272 %{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \ 1273 %{mnewlib: ecrti.o%s} \ 1274 %{!mnewlib: %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 1275 #endif 1276 /* 1277 %{!mnewlib: crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 1278 */ 1279 1280 #ifndef ENDFILE_OPENBSD_SPEC 1281 #define ENDFILE_OPENBSD_SPEC "\ 1282 %{mnewlib: ecrtn.o%s} \ 1283 %{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s}}" 1284 #endif 1285 /* 1286 %{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}" 1287 */ 1288 1289 #ifndef LINK_START_OPENBSD_SPEC 1290 #define LINK_START_OPENBSD_SPEC "-Ttext 0x400074" 1291 #endif 1292 1293 #ifndef LINK_OS_OPENBSD_SPEC 1294 #define LINK_OS_OPENBSD_SPEC "" 1295 #endif 1296 1297 #ifndef CPP_OS_OPENBSD_SPEC 1298 #define CPP_OS_OPENBSD_SPEC OBSD_CPP_SPEC 1299 #endif 1300 1301 /* VxWorks support. */ 1302 /* VxWorks does all the library stuff itself. */ 1303 #define LIB_VXWORKS_SPEC "" 1304 1305 /* VxWorks provides the functionality of crt0.o and friends itself. */ 1306 1307 #define STARTFILE_VXWORKS_SPEC "" 1308 1309 #define ENDFILE_VXWORKS_SPEC "" 1310 1311 /* Because it uses ld -r, vxworks has no start/end files, nor starting 1312 address. */ 1313 1314 #define LINK_START_VXWORKS_SPEC "" 1315 1316 #define LINK_OS_VXWORKS_SPEC "-r" 1317 1318 #define CPP_OS_VXWORKS_SPEC "\ 1319 -DCPU_FAMILY=PPC \ 1320 %{!mcpu*: \ 1321 %{mpowerpc*: -DCPU=PPC603} \ 1322 %{!mno-powerpc: -DCPU=PPC603}} \ 1323 %{mcpu=powerpc: -DCPU=PPC603} \ 1324 %{mcpu=401: -DCPU=PPC403} \ 1325 %{mcpu=403: -DCPU=PPC403} \ 1326 %{mcpu=405: -DCPU=PPC405} \ 1327 %{mcpu=601: -DCPU=PPC601} \ 1328 %{mcpu=602: -DCPU=PPC603} \ 1329 %{mcpu=603: -DCPU=PPC603} \ 1330 %{mcpu=603e: -DCPU=PPC603} \ 1331 %{mcpu=ec603e: -DCPU=PPC603} \ 1332 %{mcpu=604: -DCPU=PPC604} \ 1333 %{mcpu=604e: -DCPU=PPC604} \ 1334 %{mcpu=620: -DCPU=PPC604} \ 1335 %{mcpu=740: -DCPU=PPC603} \ 1336 %{mcpu=7450: -DCPU=PPC603} \ 1337 %{mcpu=750: -DCPU=PPC603} \ 1338 %{mcpu=801: -DCPU=PPC603} \ 1339 %{mcpu=821: -DCPU=PPC603} \ 1340 %{mcpu=823: -DCPU=PPC603} \ 1341 %{mcpu=860: -DCPU=PPC603}" 1342 1343 /* WindISS support. */ 1344 1345 #define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group" 1346 1347 #define CPP_OS_WINDISS_SPEC "\ 1348 -D__rtasim \ 1349 -D__EABI__ \ 1350 -D__ppc \ 1351 %{!msoft-float: -D__hardfp} \ 1352 " 1353 1354 #define STARTFILE_WINDISS_SPEC "crt0.o%s crtbegin.o%s" 1355 1356 #define ENDFILE_WINDISS_SPEC "crtend.o%s" 1357 1358 #define LINK_START_WINDISS_SPEC "" 1359 1360 #define LINK_OS_WINDISS_SPEC "" 1361 1362 /* Define any extra SPECS that the compiler needs to generate. */ 1363 /* Override rs6000.h definition. */ 1364 #undef SUBTARGET_EXTRA_SPECS 1365 #define SUBTARGET_EXTRA_SPECS \ 1366 { "cpp_sysv", CPP_SYSV_SPEC }, \ 1367 { "crtsavres_default", CRTSAVRES_DEFAULT_SPEC }, \ 1368 { "lib_ads", LIB_ADS_SPEC }, \ 1369 { "lib_yellowknife", LIB_YELLOWKNIFE_SPEC }, \ 1370 { "lib_mvme", LIB_MVME_SPEC }, \ 1371 { "lib_sim", LIB_SIM_SPEC }, \ 1372 { "lib_freebsd", LIB_FREEBSD_SPEC }, \ 1373 { "lib_gnu", LIB_GNU_SPEC }, \ 1374 { "lib_linux", LIB_LINUX_SPEC }, \ 1375 { "lib_netbsd", LIB_NETBSD_SPEC }, \ 1376 { "lib_openbsd", LIB_OPENBSD_SPEC }, \ 1377 { "libc_openbsd", LIBC_OPENBSD_SPEC }, \ 1378 { "lib_vxworks", LIB_VXWORKS_SPEC }, \ 1379 { "lib_windiss", LIB_WINDISS_SPEC }, \ 1380 { "lib_default", LIB_DEFAULT_SPEC }, \ 1381 { "startfile_ads", STARTFILE_ADS_SPEC }, \ 1382 { "startfile_yellowknife", STARTFILE_YELLOWKNIFE_SPEC }, \ 1383 { "startfile_mvme", STARTFILE_MVME_SPEC }, \ 1384 { "startfile_sim", STARTFILE_SIM_SPEC }, \ 1385 { "startfile_freebsd", STARTFILE_FREEBSD_SPEC }, \ 1386 { "startfile_gnu", STARTFILE_GNU_SPEC }, \ 1387 { "startfile_linux", STARTFILE_LINUX_SPEC }, \ 1388 { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \ 1389 { "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \ 1390 { "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \ 1391 { "startfile_windiss", STARTFILE_WINDISS_SPEC }, \ 1392 { "startfile_default", STARTFILE_DEFAULT_SPEC }, \ 1393 { "endfile_ads", ENDFILE_ADS_SPEC }, \ 1394 { "endfile_yellowknife", ENDFILE_YELLOWKNIFE_SPEC }, \ 1395 { "endfile_mvme", ENDFILE_MVME_SPEC }, \ 1396 { "endfile_sim", ENDFILE_SIM_SPEC }, \ 1397 { "endfile_freebsd", ENDFILE_FREEBSD_SPEC }, \ 1398 { "endfile_gnu", ENDFILE_GNU_SPEC }, \ 1399 { "endfile_linux", ENDFILE_LINUX_SPEC }, \ 1400 { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \ 1401 { "endfile_openbsd", ENDFILE_OPENBSD_SPEC }, \ 1402 { "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \ 1403 { "endfile_windiss", ENDFILE_WINDISS_SPEC }, \ 1404 { "endfile_default", ENDFILE_DEFAULT_SPEC }, \ 1405 { "link_path", LINK_PATH_SPEC }, \ 1406 { "link_shlib", LINK_SHLIB_SPEC }, \ 1407 { "link_target", LINK_TARGET_SPEC }, \ 1408 { "link_start", LINK_START_SPEC }, \ 1409 { "link_start_ads", LINK_START_ADS_SPEC }, \ 1410 { "link_start_yellowknife", LINK_START_YELLOWKNIFE_SPEC }, \ 1411 { "link_start_mvme", LINK_START_MVME_SPEC }, \ 1412 { "link_start_sim", LINK_START_SIM_SPEC }, \ 1413 { "link_start_freebsd", LINK_START_FREEBSD_SPEC }, \ 1414 { "link_start_gnu", LINK_START_GNU_SPEC }, \ 1415 { "link_start_linux", LINK_START_LINUX_SPEC }, \ 1416 { "link_start_netbsd", LINK_START_NETBSD_SPEC }, \ 1417 { "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \ 1418 { "link_start_vxworks", LINK_START_VXWORKS_SPEC }, \ 1419 { "link_start_windiss", LINK_START_WINDISS_SPEC }, \ 1420 { "link_start_default", LINK_START_DEFAULT_SPEC }, \ 1421 { "link_os", LINK_OS_SPEC }, \ 1422 { "link_os_ads", LINK_OS_ADS_SPEC }, \ 1423 { "link_os_yellowknife", LINK_OS_YELLOWKNIFE_SPEC }, \ 1424 { "link_os_mvme", LINK_OS_MVME_SPEC }, \ 1425 { "link_os_sim", LINK_OS_SIM_SPEC }, \ 1426 { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \ 1427 { "link_os_linux", LINK_OS_LINUX_SPEC }, \ 1428 { "link_os_gnu", LINK_OS_GNU_SPEC }, \ 1429 { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \ 1430 { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ 1431 { "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \ 1432 { "link_os_windiss", LINK_OS_WINDISS_SPEC }, \ 1433 { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ 1434 { "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \ 1435 { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \ 1436 { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \ 1437 { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ 1438 { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ 1439 { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ 1440 { "cpp_os_sim", CPP_OS_SIM_SPEC }, \ 1441 { "cpp_os_freebsd", CPP_OS_FREEBSD_SPEC }, \ 1442 { "cpp_os_gnu", CPP_OS_GNU_SPEC }, \ 1443 { "cpp_os_linux", CPP_OS_LINUX_SPEC }, \ 1444 { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \ 1445 { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \ 1446 { "cpp_os_rtems", CPP_OS_RTEMS_SPEC }, \ 1447 { "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \ 1448 { "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \ 1449 { "cpp_os_default", CPP_OS_DEFAULT_SPEC }, 1450 1451 /* Define this macro as a C expression for the initializer of an 1452 array of string to tell the driver program which options are 1453 defaults for this target and thus do not need to be handled 1454 specially when using `MULTILIB_OPTIONS'. 1455 1456 Do not define this macro if `MULTILIB_OPTIONS' is not defined in 1457 the target makefile fragment or if none of the options listed in 1458 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */ 1459 1460 #define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" } 1461 1462 /* Define this macro if the code for function profiling should come 1463 before the function prologue. Normally, the profiling code comes 1464 after. */ 1465 #define PROFILE_BEFORE_PROLOGUE 1 1466 1467 /* Function name to call to do profiling. */ 1468 #define RS6000_MCOUNT "_mcount" 1469 1470 /* Define this macro (to a value of 1) if you want to support the 1471 Win32 style pragmas #pragma pack(push,<n>)' and #pragma 1472 pack(pop)'. The pack(push,<n>) pragma specifies the maximum 1473 alignment (in bytes) of fields within a structure, in much the 1474 same way as the __aligned__' and __packed__' __attribute__'s 1475 do. A pack value of zero resets the behavior to the default. 1476 Successive invocations of this pragma cause the previous values to 1477 be stacked, so that invocations of #pragma pack(pop)' will return 1478 to the previous value. */ 1479 1480 #define HANDLE_PRAGMA_PACK_PUSH_POP 1481 1482 /* Define library calls for quad FP operations. These are all part of the 1483 PowerPC 32bit ABI. */ 1484 #define ADDTF3_LIBCALL "_q_add" 1485 #define DIVTF3_LIBCALL "_q_div" 1486 #define EXTENDDFTF2_LIBCALL "_q_dtoq" 1487 #define EQTF2_LIBCALL "_q_feq" 1488 #define GETF2_LIBCALL "_q_fge" 1489 #define GTTF2_LIBCALL "_q_fgt" 1490 #define LETF2_LIBCALL "_q_fle" 1491 #define LTTF2_LIBCALL "_q_flt" 1492 #define NETF2_LIBCALL "_q_fne" 1493 #define FLOATSITF2_LIBCALL "_q_itoq" 1494 #define MULTF3_LIBCALL "_q_mul" 1495 #define NEGTF2_LIBCALL "_q_neg" 1496 #define TRUNCTFDF2_LIBCALL "_q_qtod" 1497 #define FIX_TRUNCTFSI2_LIBCALL "_q_qtoi" 1498 #define TRUNCTFSF2_LIBCALL "_q_qtos" 1499 #define FIXUNS_TRUNCTFSI2_LIBCALL "_q_qtou" 1500 #define SQRTTF_LIBCALL "_q_sqrt" 1501 #define EXTENDSFTF2_LIBCALL "_q_stoq" 1502 #define SUBTF3_LIBCALL "_q_sub" 1503 #define FLOATUNSSITF2_LIBCALL "_q_utoq" 1504 1505 #define INIT_TARGET_OPTABS \ 1506 do { \ 1507 if (TARGET_HARD_FLOAT) \ 1508 { \ 1509 add_optab->handlers[(int) TFmode].libfunc \ 1510 = init_one_libfunc (ADDTF3_LIBCALL); \ 1511 sub_optab->handlers[(int) TFmode].libfunc \ 1512 = init_one_libfunc (SUBTF3_LIBCALL); \ 1513 neg_optab->handlers[(int) TFmode].libfunc \ 1514 = init_one_libfunc (NEGTF2_LIBCALL); \ 1515 smul_optab->handlers[(int) TFmode].libfunc \ 1516 = init_one_libfunc (MULTF3_LIBCALL); \ 1517 sdiv_optab->handlers[(int) TFmode].libfunc \ 1518 = init_one_libfunc (DIVTF3_LIBCALL); \ 1519 eqtf2_libfunc = init_one_libfunc (EQTF2_LIBCALL); \ 1520 netf2_libfunc = init_one_libfunc (NETF2_LIBCALL); \ 1521 gttf2_libfunc = init_one_libfunc (GTTF2_LIBCALL); \ 1522 getf2_libfunc = init_one_libfunc (GETF2_LIBCALL); \ 1523 lttf2_libfunc = init_one_libfunc (LTTF2_LIBCALL); \ 1524 letf2_libfunc = init_one_libfunc (LETF2_LIBCALL); \ 1525 trunctfsf2_libfunc = init_one_libfunc (TRUNCTFSF2_LIBCALL); \ 1526 trunctfdf2_libfunc = init_one_libfunc (TRUNCTFDF2_LIBCALL); \ 1527 extendsftf2_libfunc = init_one_libfunc (EXTENDSFTF2_LIBCALL); \ 1528 extenddftf2_libfunc = init_one_libfunc (EXTENDDFTF2_LIBCALL); \ 1529 floatsitf_libfunc = init_one_libfunc (FLOATSITF2_LIBCALL); \ 1530 fixtfsi_libfunc = init_one_libfunc (FIX_TRUNCTFSI2_LIBCALL); \ 1531 fixunstfsi_libfunc \ 1532 = init_one_libfunc (FIXUNS_TRUNCTFSI2_LIBCALL); \ 1533 if (TARGET_PPC_GPOPT || TARGET_POWER2) \ 1534 sqrt_optab->handlers[(int) TFmode].libfunc \ 1535 = init_one_libfunc (SQRTTF_LIBCALL); \ 1536 } \ 1537 } while (0) 1538 1539 /* Select a format to encode pointers in exception handling data. CODE 1540 is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is 1541 true if the symbol may be affected by dynamic relocations. */ 1542 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ 1543 ((flag_pic || TARGET_RELOCATABLE) \ 1544 ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \ 1545 : DW_EH_PE_absptr) 1546 1547 #define TARGET_ASM_EXCEPTION_SECTION readonly_data_section 1548 1549 #define DOUBLE_INT_ASM_OP "\t.quad\t" 1550 1551 /* Generate entries in .fixup for relocatable addresses. */ 1552 #define RELOCATABLE_NEEDS_FIXUP 1553