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