freebsd.h revision 34229
1262261Sdim/* Definitions for Intel 386 running FreeBSD with either a.out or ELF format 2262261Sdim Copyright (C) 1994, 1995 Free Software Foundation, Inc. 3262261Sdim Contributed by Eric Youngdale. 4262261Sdim Modified for stabs-in-ELF by H.J. Lu. 5262261Sdim Adapted from Linux version by John Polstra. 6262261Sdim Added support for generating "old a.out gas" on the fly by Peter Wemm. 7262261Sdim 8262261SdimThis file is part of GNU CC. 9262261Sdim 10262261SdimGNU CC is free software; you can redistribute it and/or modify 11262261Sdimit under the terms of the GNU General Public License as published by 12262261Sdimthe Free Software Foundation; either version 2, or (at your option) 13262261Sdimany later version. 14262261Sdim 15262261SdimGNU CC is distributed in the hope that it will be useful, 16262261Sdimbut WITHOUT ANY WARRANTY; without even the implied warranty of 17276479SdimMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18262261SdimGNU General Public License for more details. 19262261Sdim 20262261SdimYou should have received a copy of the GNU General Public License 21262261Sdimalong with GNU CC; see the file COPYING. If not, write to 22276479Sdimthe Free Software Foundation, 59 Temple Place - Suite 330, 23276479SdimBoston, MA 02111-1307, USA. */ 24262261Sdim 25262261Sdim/* A lie, I guess, but the general idea behind FreeBSD/ELF is that we are 26262261Sdim supposed to be outputting something that will assemble under SVr4. 27262261Sdim This gets us pretty close. */ 28262261Sdim#include <i386/i386.h> /* Base i386 target machine definitions */ 29262261Sdim#include <i386/att.h> /* Use the i386 AT&T assembler syntax */ 30262261Sdim#include <linux.h> /* some common stuff */ 31262261Sdim 32262261Sdim/* Don't assume anything about the header files. */ 33262261Sdim#define NO_IMPLICIT_EXTERN_C 34262261Sdim 35262261Sdim/* This defines which switch letters take arguments. On svr4, most of 36262261Sdim the normal cases (defined in gcc.c) apply, and we also have -h* and 37276479Sdim -z* options (for the linker). We have a slightly different mix. We 38262261Sdim have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 39262261Sdim 40262261Sdim#undef SWITCH_TAKES_ARG 41262261Sdim#define SWITCH_TAKES_ARG(CHAR) \ 42262261Sdim ( (CHAR) == 'D' \ 43262261Sdim || (CHAR) == 'U' \ 44262261Sdim || (CHAR) == 'o' \ 45262261Sdim || (CHAR) == 'e' \ 46262261Sdim || (CHAR) == 'T' \ 47262261Sdim || (CHAR) == 'u' \ 48262261Sdim || (CHAR) == 'I' \ 49262261Sdim || (CHAR) == 'm' \ 50262261Sdim || (CHAR) == 'L' \ 51262261Sdim || (CHAR) == 'A' \ 52262261Sdim || (CHAR) == 'h' \ 53262261Sdim || (CHAR) == 'z' /* ignored by ld */ \ 54262261Sdim || (CHAR) == 'R') 55262261Sdim 56262261Sdim#undef WORD_SWITCH_TAKES_ARG 57262261Sdim#define WORD_SWITCH_TAKES_ARG(STR) \ 58262261Sdim (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 59262261Sdim || !strcmp (STR, "rpath") || !strcmp (STR, "rpath-link") \ 60262261Sdim || !strcmp (STR, "soname") || !strcmp (STR, "defsym") \ 61262261Sdim || !strcmp (STR, "assert") || !strcmp (STR, "dynamic-linker")) 62288943Sdim 63262261Sdim#undef TARGET_VERSION 64288943Sdim#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD)"); 65262261Sdim 66288943Sdim#define MASK_PROFILER_EPILOGUE 010000000000 67262261Sdim#define MASK_AOUT 004000000000 /* a.out not elf */ 68262261Sdim#define MASK_UNDERSCORES 002000000000 /* use leading _ */ 69262261Sdim 70262261Sdim#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE) 71262261Sdim#define TARGET_AOUT (target_flags & MASK_AOUT) 72262261Sdim#define TARGET_ELF ((target_flags & MASK_AOUT) == 0) 73262261Sdim#define TARGET_UNDERSCORES ((target_flags & MASK_UNDERSCORES) != 0) 74262261Sdim 75262261Sdim#undef SUBTARGET_SWITCHES 76262261Sdim#define SUBTARGET_SWITCHES \ 77288943Sdim { "profiler-epilogue", MASK_PROFILER_EPILOGUE}, \ 78262261Sdim { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE}, \ 79262261Sdim { "aout", MASK_AOUT}, \ 80288943Sdim { "no-aout", -MASK_AOUT}, \ 81262261Sdim { "underscores", MASK_UNDERSCORES}, \ 82262261Sdim { "no-underscores", -MASK_UNDERSCORES}, 83262261Sdim 84262261Sdim/* The svr4 ABI for the i386 says that records and unions are returned 85262261Sdim in memory. */ 86262261Sdim/* On FreeBSD, we do not. */ 87262261Sdim#undef DEFAULT_PCC_STRUCT_RETURN 88262261Sdim#define DEFAULT_PCC_STRUCT_RETURN 0 89262261Sdim 90262261Sdim#define SUPPORTS_WEAK TARGET_ELF 91262261Sdim 92262261Sdim/* Prefix for internally generated assembler labels. If we aren't using 93262261Sdim underscores, we are using prefix `.'s to identify labels that should 94262261Sdim be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ 95262261Sdim#undef LPREFIX 96262261Sdim#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L") 97262261Sdim 98262261Sdim/* Override the default comment-starter of "/". */ 99262261Sdim#undef ASM_COMMENT_START 100262261Sdim#define ASM_COMMENT_START "#" 101262261Sdim 102262261Sdim#undef COMMENT_BEGIN 103262261Sdim#define COMMENT_BEGIN "#" 104262261Sdim 105262261Sdim#undef ASM_APP_ON 106262261Sdim#define ASM_APP_ON "#APP\n" 107262261Sdim 108262261Sdim#undef ASM_APP_OFF 109262261Sdim#define ASM_APP_OFF "#NO_APP\n" 110 111/* Output at beginning of assembler file. */ 112/* The .file command should always begin the output. */ 113 114#undef ASM_FILE_START 115#define ASM_FILE_START(FILE) \ 116 do { \ 117 output_file_directive (FILE, main_input_filename); \ 118 if (TARGET_ELF) \ 119 fprintf (FILE, "\t.version\t\"01.01\"\n"); \ 120 } while (0) 121 122/* This is how to store into the string BUF 123 the symbol_ref name of an internal numbered label where 124 PREFIX is the class of label and NUM is the number within the class. 125 This is suitable for output with `assemble_name'. */ 126#undef ASM_GENERATE_INTERNAL_LABEL 127#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ 128 sprintf ((BUF), "*%s%s%d", (TARGET_UNDERSCORES) ? "" : ".", \ 129 (PREFIX), (NUMBER)) 130 131/* This is how to output an internal numbered label where 132 PREFIX is the class of label and NUM is the number within the class. */ 133#undef ASM_OUTPUT_INTERNAL_LABEL 134#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 135 fprintf (FILE, "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \ 136 PREFIX, NUM) 137 138/* This is how to output a reference to a user-level label named NAME. */ 139#undef ASM_OUTPUT_LABELREF 140#define ASM_OUTPUT_LABELREF(FILE,NAME) \ 141 fprintf (FILE, "%s%s", (TARGET_UNDERSCORES) ? "_" : "", NAME) 142 143 144/* This is how to output an element of a case-vector that is relative. 145 This is only used for PIC code. See comments by the `casesi' insn in 146 i386.md for an explanation of the expression this outputs. */ 147#undef ASM_OUTPUT_ADDR_DIFF_ELT 148#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ 149 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE) 150 151#undef ASM_OUTPUT_ALIGN 152#define ASM_OUTPUT_ALIGN(FILE,LOG) \ 153 if ((LOG)!=0) fprintf ((FILE), "\t.p2align %d\n", (LOG)) 154 155/* Align labels, etc. at 4-byte boundaries. 156 For the 486, align to 16-byte boundary for sake of cache. */ 157#undef ASM_OUTPUT_ALIGN_CODE 158#define ASM_OUTPUT_ALIGN_CODE(FILE) \ 159 fprintf ((FILE), "\t.p2align %d,0x90\n", i386_align_jumps) 160 161/* Align start of loop at 4-byte boundary. */ 162#undef ASM_OUTPUT_LOOP_ALIGN 163#define ASM_OUTPUT_LOOP_ALIGN(FILE) \ 164 fprintf ((FILE), "\t.p2align %d,0x90\n", i386_align_loops) 165 166 167/* A C statement to output assembler commands which will identify the object 168 file as having been compile with GNU CC. We don't need or want this for 169 GDB. */ 170#undef ASM_IDENTIFY_GCC 171#define ASM_IDENTIFY_GCC(FILE) 172 173/* conditionalize the use of ".section rodata" on elf mode - otherwise .text */ 174#undef USE_CONST_SECTION 175#define USE_CONST_SECTION TARGET_ELF 176 177/* A C statement (sans semicolon) to output an element in the table of 178 global constructors. */ 179#undef ASM_OUTPUT_CONSTRUCTOR 180#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ 181 do { \ 182 if (TARGET_ELF) { \ 183 ctors_section (); \ 184 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ 185 assemble_name (FILE, NAME); \ 186 fprintf (FILE, "\n"); \ 187 } else { \ 188 fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,", ASM_STABS_OP, \ 189 (TARGET_UNDERSCORES) ? "_" : ""); \ 190 assemble_name (asm_out_file, name); \ 191 fputc ('\n', asm_out_file); \ 192 } \ 193 } while (0) 194 195/* A C statement (sans semicolon) to output an element in the table of 196 global destructors. */ 197#undef ASM_OUTPUT_DESTRUCTOR 198#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ 199 do { \ 200 if (TARGET_ELF) { \ 201 dtors_section (); \ 202 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ 203 assemble_name (FILE, NAME); \ 204 fprintf (FILE, "\n"); \ 205 } else { \ 206 fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,", ASM_STABS_OP, \ 207 (TARGET_UNDERSCORES) ? "_" : ""); \ 208 assemble_name (asm_out_file, name); \ 209 fputc ('\n', asm_out_file); \ 210 } \ 211 } while (0) 212 213/* This says how to output assembler code to declare an 214 uninitialized internal linkage data object. Under SVR4, 215 the linker seems to want the alignment of data objects 216 to depend on their types. We do exactly that here. */ 217 218#undef ASM_OUTPUT_ALIGNED_LOCAL 219#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 220do { \ 221 if (TARGET_ELF) { \ 222 fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \ 223 assemble_name ((FILE), (NAME)); \ 224 fprintf ((FILE), "\n"); \ 225 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ 226 } else { \ 227 int rounded = (SIZE); \ 228 if (rounded == 0) rounded = 1; \ 229 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 230 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 231 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 232 fputs (".lcomm ", (FILE)); \ 233 assemble_name ((FILE), (NAME)); \ 234 fprintf ((FILE), ",%u\n", (rounded)); \ 235 } \ 236} while (0) 237 238#undef ASM_OUTPUT_ALIGNED_COMMON 239#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 240do { \ 241 if (TARGET_ELF) { \ 242 fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \ 243 assemble_name ((FILE), (NAME)); \ 244 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ 245 } else { \ 246 int rounded = (SIZE); \ 247 if (rounded == 0) rounded = 1; \ 248 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 249 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 250 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 251 fputs (".comm ", (FILE)); \ 252 assemble_name ((FILE), (NAME)); \ 253 fprintf ((FILE), ",%u\n", (rounded)); \ 254 } \ 255} while (0) 256 257/* Turn off svr4.h version, it chokes the old gas. The old layout 258 works fine under new gas anyway. */ 259#undef ASM_OUTPUT_ASCII 260 261/* How to output some space */ 262#undef ASM_OUTPUT_SKIP 263#define ASM_OUTPUT_SKIP(FILE,SIZE) \ 264do { \ 265 if (TARGET_ELF) { \ 266 fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE)); \ 267 } else { \ 268 fprintf (FILE, "\t.space %u\n", (SIZE)); \ 269 } \ 270} while (0) 271 272#undef ASM_OUTPUT_SOURCE_LINE 273#define ASM_OUTPUT_SOURCE_LINE(file, line) \ 274do { \ 275 static int sym_lineno = 1; \ 276 if (TARGET_ELF) { \ 277 fprintf (file, ".stabn 68,0,%d,.LM%d-", line, sym_lineno); \ 278 assemble_name (file, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\ 279 fprintf (file, "\n.LM%d:\n", sym_lineno); \ 280 sym_lineno += 1; \ 281 } else { \ 282 fprintf (file, "\t%s %d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno); \ 283 } \ 284} while (0) 285 286/* stabs-in-elf has offsets relative to function beginning */ 287#undef DBX_OUTPUT_LBRAC 288#define DBX_OUTPUT_LBRAC(file,name) \ 289do { \ 290 fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC); \ 291 assemble_name (asmfile, buf); \ 292 if (TARGET_ELF) { \ 293 fputc ('-', asmfile); \ 294 assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ 295 } \ 296 fprintf (asmfile, "\n"); \ 297} while (0) 298 299#undef DBX_OUTPUT_RBRAC 300#define DBX_OUTPUT_RBRAC(file,name) \ 301do { \ 302 fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC); \ 303 assemble_name (asmfile, buf); \ 304 if (TARGET_ELF) { \ 305 fputc ('-', asmfile); \ 306 assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ 307 } \ 308 fprintf (asmfile, "\n"); \ 309} while (0) 310 311 312/* Define macro used to output shift-double opcodes when the shift 313 count is in %cl. Some assemblers require %cl as an argument; 314 some don't. 315 316 *OLD* GAS requires the %cl argument, so override i386/unix.h. */ 317 318#undef AS3_SHIFT_DOUBLE 319#define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d) 320 321/* Indicate that jump tables go in the text section. This is 322 necessary when compiling PIC code. */ 323#define JUMP_TABLES_IN_TEXT_SECTION 324 325/* override the exception table positioning */ 326#define EXCEPTION_SECTION_FUNCTION \ 327do { \ 328 if (TARGET_ELF) { \ 329 named_section (NULL_TREE, ".gcc_except_table"); \ 330 } else { \ 331 if (flag_pic) \ 332 data_section (); \ 333 else \ 334 readonly_data_section (); \ 335 } \ 336} while (0); 337 338/* supply our own hook for calling __main() from main() */ 339#define GEN_CALL__MAIN \ 340 do { \ 341 if (!(TARGET_ELF)) \ 342 emit_library_call (gen_rtx (SYMBOL_REF, Pmode, NAME__MAIN), 0, \ 343 VOIDmode, 0); \ 344 } while (0) 345 346/* Map i386 registers to the numbers dwarf expects. Of course this is different 347 from what stabs expects. */ 348 349#undef DWARF_DBX_REGISTER_NUMBER 350#define DWARF_DBX_REGISTER_NUMBER(n) \ 351((n) == 0 ? 0 \ 352 : (n) == 1 ? 2 \ 353 : (n) == 2 ? 1 \ 354 : (n) == 3 ? 3 \ 355 : (n) == 4 ? 6 \ 356 : (n) == 5 ? 7 \ 357 : (n) == 6 ? 5 \ 358 : (n) == 7 ? 4 \ 359 : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \ 360 : (-1)) 361 362/* Now what stabs expects in the register. */ 363#define STABS_DBX_REGISTER_NUMBER(n) \ 364((n) == 0 ? 0 : \ 365 (n) == 1 ? 2 : \ 366 (n) == 2 ? 1 : \ 367 (n) == 3 ? 3 : \ 368 (n) == 4 ? 6 : \ 369 (n) == 5 ? 7 : \ 370 (n) == 6 ? 4 : \ 371 (n) == 7 ? 5 : \ 372 (n) + 4) 373 374#undef DBX_REGISTER_NUMBER 375#define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \ 376 ? DWARF_DBX_REGISTER_NUMBER(n) \ 377 : STABS_DBX_REGISTER_NUMBER(n)) 378 379/* Tell final.c that we don't need a label passed to mcount. */ 380#define NO_PROFILE_DATA 381 382/* Output assembler code to FILE to increment profiler label # LABELNO 383 for profiling a function entry. */ 384/* Redefine this to not pass an unused label in %edx. */ 385 386#undef FUNCTION_PROFILER 387#define FUNCTION_PROFILER(FILE, LABELNO) \ 388{ \ 389 if (flag_pic) \ 390 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \ 391 else \ 392 fprintf (FILE, "\tcall mcount\n"); \ 393} 394 395#define FUNCTION_PROFILER_EPILOGUE(FILE) \ 396{ \ 397 if (TARGET_PROFILER_EPILOGUE) \ 398 { \ 399 if (flag_pic) \ 400 fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \ 401 else \ 402 fprintf (FILE, "\tcall mexitcount\n"); \ 403 } \ 404} 405 406#undef SIZE_TYPE 407#define SIZE_TYPE "unsigned int" 408 409#undef PTRDIFF_TYPE 410#define PTRDIFF_TYPE "int" 411 412#undef WCHAR_TYPE 413#define WCHAR_TYPE "int" 414 415#define WCHAR_UNSIGNED 0 416 417#undef WCHAR_TYPE_SIZE 418#define WCHAR_TYPE_SIZE BITS_PER_WORD 419 420/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD 421 source tree so it can be configured appropriately without using 422 the GNU configure/build mechanism. */ 423 424#ifdef FREEBSD_NATIVE 425 426/* Look for the include files in the system-defined places. */ 427 428#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" 429 430#define GCC_INCLUDE_DIR "/usr/include" 431 432/* FreeBSD has GCC_INCLUDE_DIR first. */ 433#define INCLUDE_DEFAULTS \ 434 { \ 435 { GCC_INCLUDE_DIR, 0, 0 }, \ 436 { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \ 437 { 0, 0, 0 } \ 438 } 439 440/* Under FreeBSD, the normal location of the compiler back ends is the 441 /usr/libexec directory. */ 442 443#define STANDARD_EXEC_PREFIX "/usr/libexec/" 444 445/* Under FreeBSD, the normal location of the various *crt*.o files is the 446 /usr/lib directory. */ 447 448#define STANDARD_STARTFILE_PREFIX "/usr/lib/" 449 450/* On FreeBSD, gcc is called 'cc' */ 451#define GCC_NAME "cc" 452 453/* FreeBSD is 4.4BSD derived */ 454#define bsd4_4 455 456#endif /* FREEBSD_NATIVE */ 457 458#undef CPP_PREDEFINES 459#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" 460 461#undef CPP_SPEC 462#if TARGET_CPU_DEFAULT == 2 463#define CPP_SPEC "\ 464%{!maout: -D__ELF__} \ 465%{munderscores: -D__UNDERSCORES__} \ 466%{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ 467%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__}" 468#else 469#define CPP_SPEC "\ 470%{!maout: -D__ELF__} \ 471%{munderscores: -D__UNDERSCORES__} \ 472%{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ 473%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{m486:-D__i486__}" 474#endif 475 476#undef CC1_SPEC 477#define CC1_SPEC "\ 478%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ 479%{maout: %{!mno-underscores: %{!munderscores: -munderscores }}}" 480 481#undef ASM_SPEC 482#define ASM_SPEC "%{v*: -v} %{maout: %{fpic:-k} %{fPIC:-k}}" 483 484/* Like the default, except no -lg, and no -p. */ 485#undef LIB_SPEC 486#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:-lc}%{pthread:-lc_r}}%{pg:%{!pthread:-lc_p}%{pthread:-lc_r_p}}}" 487 488/* Let gcc locate this for us according to the -m rules */ 489#undef LIBGCC_SPEC 490#define LIBGCC_SPEC "%{!shared:libgcc.a%s}" 491 492/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support 493 for the special GCC options -static and -shared, which allow us to 494 link things in one of these three modes by applying the appropriate 495 combinations of options at link-time. We like to support here for 496 as many of the other GNU linker options as possible. But I don't 497 have the time to search for those flags. I am sure how to add 498 support for -soname shared_object_name. H.J. 499 500 When the -shared link option is used a final link is not being 501 done. */ 502 503#undef LINK_SPEC 504#define LINK_SPEC "\ 505 %{p:%e`-p' not supported; use `-pg' and gprof(1)} \ 506 %{maout: %{shared:-Bshareable} \ 507 %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \ 508 %{pg:-Bstatic} %{Z}} \ 509 %{assert*} %{R*}} \ 510 %{!maout: \ 511 -m elf_i386 \ 512 %{Wl,*:%*} \ 513 %{assert*} %{R*} %{rpath*} %{defsym*} \ 514 %{shared:-Bshared %{h*} %{soname*}} \ 515 %{symbolic:-Bsymbolic} \ 516 %{!shared: \ 517 %{!static: \ 518 %{rdynamic: -export-dynamic} \ 519 %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}} \ 520 %{static:-Bstatic}}}" 521 522/* Get perform_* macros to build libgcc.a. */ 523#include "i386/perform.h" 524 525#undef STARTFILE_SPEC 526#define STARTFILE_SPEC "\ 527 %{maout: %{shared:c++rt0.o%s} \ 528 %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}} \ 529 %{!maout: %{!shared: \ 530 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ 531 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 532 533#undef ENDFILE_SPEC 534#define ENDFILE_SPEC \ 535 "%{!maout: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}" 536 537/* This goes away when the math emulator is fixed. */ 538#undef TARGET_DEFAULT 539#define TARGET_DEFAULT (MASK_NO_FANCY_MATH_387 | 0301) 540 541#define HAVE_ATEXIT 542#define HAVE_PUTENV 543 544/* to assist building libgcc2.c */ 545#ifndef __ELF__ 546#undef OBJECT_FORMAT_ELF 547#endif 548