1/* Definitions for Intel 386 running FreeBSD with either a.out or ELF format 2 Copyright (C) 1994, 1995 Free Software Foundation, Inc. 3 Contributed by Eric Youngdale. 4 Modified for stabs-in-ELF by H.J. Lu. 5 Adapted from Linux version by John Polstra. 6 Added support for generating "old a.out gas" on the fly by Peter Wemm. 7 8This file is part of GNU CC. 9 10GNU CC is free software; you can redistribute it and/or modify 11it under the terms of the GNU General Public License as published by 12the Free Software Foundation; either version 2, or (at your option) 13any later version. 14 15GNU CC is distributed in the hope that it will be useful, 16but WITHOUT ANY WARRANTY; without even the implied warranty of 17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18GNU General Public License for more details. 19 20You should have received a copy of the GNU General Public License 21along with GNU CC; see the file COPYING. If not, write to 22the Free Software Foundation, 59 Temple Place - Suite 330, 23Boston, MA 02111-1307, USA. */ 24 25/* A lie, I guess, but the general idea behind FreeBSD/ELF is that we are 26 supposed to be outputting something that will assemble under SVr4. 27 This gets us pretty close. */ 28#include <i386/i386.h> /* Base i386 target machine definitions */ 29#include <i386/att.h> /* Use the i386 AT&T assembler syntax */ 30#include <linux.h> /* some common stuff */ 31 32/* Don't assume anything about the header files. */ 33#define NO_IMPLICIT_EXTERN_C 34 35/* This defines which switch letters take arguments. On svr4, most of 36 the normal cases (defined in gcc.c) apply, and we also have -h* and 37 -z* options (for the linker). We have a slightly different mix. We 38 have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 39 40#undef SWITCH_TAKES_ARG 41#define SWITCH_TAKES_ARG(CHAR) \ 42 ( (CHAR) == 'D' \ 43 || (CHAR) == 'U' \ 44 || (CHAR) == 'o' \ 45 || (CHAR) == 'e' \ 46 || (CHAR) == 'T' \ 47 || (CHAR) == 'u' \ 48 || (CHAR) == 'I' \ 49 || (CHAR) == 'm' \ 50 || (CHAR) == 'L' \ 51 || (CHAR) == 'A' \ 52 || (CHAR) == 'h' \ 53 || (CHAR) == 'z' /* ignored by ld */ \ 54 || (CHAR) == 'R') 55 56#undef WORD_SWITCH_TAKES_ARG 57#define WORD_SWITCH_TAKES_ARG(STR) \ 58 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 59 || !strcmp (STR, "rpath") || !strcmp (STR, "rpath-link") \ 60 || !strcmp (STR, "soname") || !strcmp (STR, "defsym") \ 61 || !strcmp (STR, "assert") || !strcmp (STR, "dynamic-linker")) 62 63#undef TARGET_VERSION 64#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD)"); 65 66#define MASK_PROFILER_EPILOGUE 010000000000 67#define MASK_AOUT 004000000000 /* a.out not elf */ 68#define MASK_UNDERSCORES 002000000000 /* use leading _ */ 69 70#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE) 71#define TARGET_AOUT (target_flags & MASK_AOUT) 72#define TARGET_ELF ((target_flags & MASK_AOUT) == 0) 73#define TARGET_UNDERSCORES ((target_flags & MASK_UNDERSCORES) != 0) 74 75#undef SUBTARGET_SWITCHES 76#define SUBTARGET_SWITCHES \ 77 { "profiler-epilogue", MASK_PROFILER_EPILOGUE}, \ 78 { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE}, \ 79 { "aout", MASK_AOUT}, \ 80 { "no-aout", -MASK_AOUT}, \ 81 { "underscores", MASK_UNDERSCORES}, \ 82 { "no-underscores", -MASK_UNDERSCORES}, 83 84/* The svr4 ABI for the i386 says that records and unions are returned 85 in memory. */ 86/* On FreeBSD, we do not. */ 87#undef DEFAULT_PCC_STRUCT_RETURN 88#define DEFAULT_PCC_STRUCT_RETURN 0 89 90#define SUPPORTS_WEAK TARGET_ELF 91 92/* Prefix for internally generated assembler labels. If we aren't using 93 underscores, we are using prefix `.'s to identify labels that should 94 be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ 95#undef LPREFIX 96#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L") 97 98/* Override the default comment-starter of "/". */ 99#undef ASM_COMMENT_START 100#define ASM_COMMENT_START "#" 101 102#undef COMMENT_BEGIN 103#define COMMENT_BEGIN "#" 104 105#undef ASM_APP_ON 106#define ASM_APP_ON "#APP\n" 107 108#undef ASM_APP_OFF 109#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
| 1/* Definitions for Intel 386 running FreeBSD with either a.out or ELF format 2 Copyright (C) 1994, 1995 Free Software Foundation, Inc. 3 Contributed by Eric Youngdale. 4 Modified for stabs-in-ELF by H.J. Lu. 5 Adapted from Linux version by John Polstra. 6 Added support for generating "old a.out gas" on the fly by Peter Wemm. 7 8This file is part of GNU CC. 9 10GNU CC is free software; you can redistribute it and/or modify 11it under the terms of the GNU General Public License as published by 12the Free Software Foundation; either version 2, or (at your option) 13any later version. 14 15GNU CC is distributed in the hope that it will be useful, 16but WITHOUT ANY WARRANTY; without even the implied warranty of 17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18GNU General Public License for more details. 19 20You should have received a copy of the GNU General Public License 21along with GNU CC; see the file COPYING. If not, write to 22the Free Software Foundation, 59 Temple Place - Suite 330, 23Boston, MA 02111-1307, USA. */ 24 25/* A lie, I guess, but the general idea behind FreeBSD/ELF is that we are 26 supposed to be outputting something that will assemble under SVr4. 27 This gets us pretty close. */ 28#include <i386/i386.h> /* Base i386 target machine definitions */ 29#include <i386/att.h> /* Use the i386 AT&T assembler syntax */ 30#include <linux.h> /* some common stuff */ 31 32/* Don't assume anything about the header files. */ 33#define NO_IMPLICIT_EXTERN_C 34 35/* This defines which switch letters take arguments. On svr4, most of 36 the normal cases (defined in gcc.c) apply, and we also have -h* and 37 -z* options (for the linker). We have a slightly different mix. We 38 have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 39 40#undef SWITCH_TAKES_ARG 41#define SWITCH_TAKES_ARG(CHAR) \ 42 ( (CHAR) == 'D' \ 43 || (CHAR) == 'U' \ 44 || (CHAR) == 'o' \ 45 || (CHAR) == 'e' \ 46 || (CHAR) == 'T' \ 47 || (CHAR) == 'u' \ 48 || (CHAR) == 'I' \ 49 || (CHAR) == 'm' \ 50 || (CHAR) == 'L' \ 51 || (CHAR) == 'A' \ 52 || (CHAR) == 'h' \ 53 || (CHAR) == 'z' /* ignored by ld */ \ 54 || (CHAR) == 'R') 55 56#undef WORD_SWITCH_TAKES_ARG 57#define WORD_SWITCH_TAKES_ARG(STR) \ 58 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 59 || !strcmp (STR, "rpath") || !strcmp (STR, "rpath-link") \ 60 || !strcmp (STR, "soname") || !strcmp (STR, "defsym") \ 61 || !strcmp (STR, "assert") || !strcmp (STR, "dynamic-linker")) 62 63#undef TARGET_VERSION 64#define TARGET_VERSION fprintf (stderr, " (i386 FreeBSD)"); 65 66#define MASK_PROFILER_EPILOGUE 010000000000 67#define MASK_AOUT 004000000000 /* a.out not elf */ 68#define MASK_UNDERSCORES 002000000000 /* use leading _ */ 69 70#define TARGET_PROFILER_EPILOGUE (target_flags & MASK_PROFILER_EPILOGUE) 71#define TARGET_AOUT (target_flags & MASK_AOUT) 72#define TARGET_ELF ((target_flags & MASK_AOUT) == 0) 73#define TARGET_UNDERSCORES ((target_flags & MASK_UNDERSCORES) != 0) 74 75#undef SUBTARGET_SWITCHES 76#define SUBTARGET_SWITCHES \ 77 { "profiler-epilogue", MASK_PROFILER_EPILOGUE}, \ 78 { "no-profiler-epilogue", -MASK_PROFILER_EPILOGUE}, \ 79 { "aout", MASK_AOUT}, \ 80 { "no-aout", -MASK_AOUT}, \ 81 { "underscores", MASK_UNDERSCORES}, \ 82 { "no-underscores", -MASK_UNDERSCORES}, 83 84/* The svr4 ABI for the i386 says that records and unions are returned 85 in memory. */ 86/* On FreeBSD, we do not. */ 87#undef DEFAULT_PCC_STRUCT_RETURN 88#define DEFAULT_PCC_STRUCT_RETURN 0 89 90#define SUPPORTS_WEAK TARGET_ELF 91 92/* Prefix for internally generated assembler labels. If we aren't using 93 underscores, we are using prefix `.'s to identify labels that should 94 be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ 95#undef LPREFIX 96#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L") 97 98/* Override the default comment-starter of "/". */ 99#undef ASM_COMMENT_START 100#define ASM_COMMENT_START "#" 101 102#undef COMMENT_BEGIN 103#define COMMENT_BEGIN "#" 104 105#undef ASM_APP_ON 106#define ASM_APP_ON "#APP\n" 107 108#undef ASM_APP_OFF 109#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/* conditionalize the use of ".section rodata" on elf mode - otherwise .text */ 168#undef USE_CONST_SECTION 169#define USE_CONST_SECTION TARGET_ELF 170 171/* A C statement (sans semicolon) to output an element in the table of 172 global constructors. */ 173#undef ASM_OUTPUT_CONSTRUCTOR 174#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ 175 do { \ 176 if (TARGET_ELF) { \ 177 ctors_section (); \ 178 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ 179 assemble_name (FILE, NAME); \ 180 fprintf (FILE, "\n"); \ 181 } else { \ 182 fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,", ASM_STABS_OP, \ 183 (TARGET_UNDERSCORES) ? "_" : ""); \ 184 assemble_name (asm_out_file, name); \ 185 fputc ('\n', asm_out_file); \ 186 } \ 187 } while (0) 188 189/* A C statement (sans semicolon) to output an element in the table of 190 global destructors. */ 191#undef ASM_OUTPUT_DESTRUCTOR 192#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ 193 do { \ 194 if (TARGET_ELF) { \ 195 dtors_section (); \ 196 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ 197 assemble_name (FILE, NAME); \ 198 fprintf (FILE, "\n"); \ 199 } else { \ 200 fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,", ASM_STABS_OP, \ 201 (TARGET_UNDERSCORES) ? "_" : ""); \ 202 assemble_name (asm_out_file, name); \ 203 fputc ('\n', asm_out_file); \ 204 } \ 205 } while (0) 206 207/* This says how to output assembler code to declare an 208 uninitialized internal linkage data object. Under SVR4, 209 the linker seems to want the alignment of data objects 210 to depend on their types. We do exactly that here. */ 211 212#undef ASM_OUTPUT_ALIGNED_LOCAL 213#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 214do { \ 215 if (TARGET_ELF) { \ 216 fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \ 217 assemble_name ((FILE), (NAME)); \ 218 fprintf ((FILE), "\n"); \ 219 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ 220 } else { \ 221 int rounded = (SIZE); \ 222 if (rounded == 0) rounded = 1; \ 223 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 224 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 225 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 226 fputs (".lcomm ", (FILE)); \ 227 assemble_name ((FILE), (NAME)); \ 228 fprintf ((FILE), ",%u\n", (rounded)); \ 229 } \ 230} while (0) 231 232#undef ASM_OUTPUT_ALIGNED_COMMON 233#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 234do { \ 235 if (TARGET_ELF) { \ 236 fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \ 237 assemble_name ((FILE), (NAME)); \ 238 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ 239 } else { \ 240 int rounded = (SIZE); \ 241 if (rounded == 0) rounded = 1; \ 242 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 243 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 244 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 245 fputs (".comm ", (FILE)); \ 246 assemble_name ((FILE), (NAME)); \ 247 fprintf ((FILE), ",%u\n", (rounded)); \ 248 } \ 249} while (0) 250 251/* Turn off svr4.h version, it chokes the old gas. The old layout 252 works fine under new gas anyway. */ 253#undef ASM_OUTPUT_ASCII 254 255/* How to output some space */ 256#undef ASM_OUTPUT_SKIP 257#define ASM_OUTPUT_SKIP(FILE,SIZE) \ 258do { \ 259 if (TARGET_ELF) { \ 260 fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE)); \ 261 } else { \ 262 fprintf (FILE, "\t.space %u\n", (SIZE)); \ 263 } \ 264} while (0) 265 266#undef ASM_OUTPUT_SOURCE_LINE 267#define ASM_OUTPUT_SOURCE_LINE(file, line) \ 268do { \ 269 static int sym_lineno = 1; \ 270 if (TARGET_ELF) { \ 271 fprintf (file, ".stabn 68,0,%d,.LM%d-", line, sym_lineno); \ 272 assemble_name (file, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\ 273 fprintf (file, "\n.LM%d:\n", sym_lineno); \ 274 sym_lineno += 1; \ 275 } else { \ 276 fprintf (file, "\t%s %d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno); \ 277 } \ 278} while (0) 279 280/* in elf, the function stabs come first, before the relative offsets */ 281#undef DBX_FUNCTION_FIRST 282#define DBX_CHECK_FUNCTION_FIRST TARGET_ELF 283 284/* tag end of file in elf mode */ 285#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END 286#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ 287do { \ 288 if (TARGET_ELF) { \ 289 fprintf (FILE, "\t.text\n\t.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO); \ 290 } \ 291} while (0) 292 293/* stabs-in-elf has offsets relative to function beginning */ 294#undef DBX_OUTPUT_LBRAC 295#define DBX_OUTPUT_LBRAC(file,name) \ 296do { \ 297 fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC); \ 298 assemble_name (asmfile, buf); \ 299 if (TARGET_ELF) { \ 300 fputc ('-', asmfile); \ 301 assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ 302 } \ 303 fprintf (asmfile, "\n"); \ 304} while (0) 305 306#undef DBX_OUTPUT_RBRAC 307#define DBX_OUTPUT_RBRAC(file,name) \ 308do { \ 309 fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC); \ 310 assemble_name (asmfile, buf); \ 311 if (TARGET_ELF) { \ 312 fputc ('-', asmfile); \ 313 assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ 314 } \ 315 fprintf (asmfile, "\n"); \ 316} while (0) 317 318 319/* Define macro used to output shift-double opcodes when the shift 320 count is in %cl. Some assemblers require %cl as an argument; 321 some don't. 322 323 *OLD* GAS requires the %cl argument, so override i386/unix.h. */ 324 325#undef AS3_SHIFT_DOUBLE 326#define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d) 327 328/* Indicate that jump tables go in the text section. This is 329 necessary when compiling PIC code. */ 330#define JUMP_TABLES_IN_TEXT_SECTION 331 332/* override the exception table positioning */ 333#define EXCEPTION_SECTION_FUNCTION \ 334do { \ 335 if (TARGET_ELF) { \ 336 named_section (NULL_TREE, ".gcc_except_table"); \ 337 } else { \ 338 if (flag_pic) \ 339 data_section (); \ 340 else \ 341 readonly_data_section (); \ 342 } \ 343} while (0); 344 345/* supply our own hook for calling __main() from main() */ 346#define GEN_CALL__MAIN \ 347 do { \ 348 if (!(TARGET_ELF)) \ 349 emit_library_call (gen_rtx (SYMBOL_REF, Pmode, NAME__MAIN), 0, \ 350 VOIDmode, 0); \ 351 } while (0) 352 353/* Map i386 registers to the numbers dwarf expects. Of course this is different 354 from what stabs expects. */ 355 356#undef DWARF_DBX_REGISTER_NUMBER 357#define DWARF_DBX_REGISTER_NUMBER(n) \ 358((n) == 0 ? 0 \ 359 : (n) == 1 ? 2 \ 360 : (n) == 2 ? 1 \ 361 : (n) == 3 ? 3 \ 362 : (n) == 4 ? 6 \ 363 : (n) == 5 ? 7 \ 364 : (n) == 6 ? 5 \ 365 : (n) == 7 ? 4 \ 366 : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \ 367 : (-1)) 368 369/* Now what stabs expects in the register. */ 370#define STABS_DBX_REGISTER_NUMBER(n) \ 371((n) == 0 ? 0 : \ 372 (n) == 1 ? 2 : \ 373 (n) == 2 ? 1 : \ 374 (n) == 3 ? 3 : \ 375 (n) == 4 ? 6 : \ 376 (n) == 5 ? 7 : \ 377 (n) == 6 ? 4 : \ 378 (n) == 7 ? 5 : \ 379 (n) + 4) 380 381#undef DBX_REGISTER_NUMBER 382#define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \ 383 ? DWARF_DBX_REGISTER_NUMBER(n) \ 384 : STABS_DBX_REGISTER_NUMBER(n)) 385 386/* Tell final.c that we don't need a label passed to mcount. */ 387#define NO_PROFILE_DATA 388 389/* Output assembler code to FILE to increment profiler label # LABELNO 390 for profiling a function entry. */ 391/* Redefine this to not pass an unused label in %edx. */ 392 393#undef FUNCTION_PROFILER 394#define FUNCTION_PROFILER(FILE, LABELNO) \ 395{ \ 396 if (flag_pic) \ 397 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \ 398 else \ 399 fprintf (FILE, "\tcall mcount\n"); \ 400} 401 402#define FUNCTION_PROFILER_EPILOGUE(FILE) \ 403{ \ 404 if (TARGET_PROFILER_EPILOGUE) \ 405 { \ 406 if (flag_pic) \ 407 fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \ 408 else \ 409 fprintf (FILE, "\tcall mexitcount\n"); \ 410 } \ 411} 412 413#undef SIZE_TYPE 414#define SIZE_TYPE "unsigned int" 415 416#undef PTRDIFF_TYPE 417#define PTRDIFF_TYPE "int" 418 419#undef WCHAR_TYPE 420#define WCHAR_TYPE "int" 421 422#define WCHAR_UNSIGNED 0 423 424#undef WCHAR_TYPE_SIZE 425#define WCHAR_TYPE_SIZE BITS_PER_WORD 426 427/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD 428 source tree so it can be configured appropriately without using 429 the GNU configure/build mechanism. */ 430 431#ifdef FREEBSD_NATIVE 432 433/* Look for the include files in the system-defined places. */ 434 435#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" 436 437#define GCC_INCLUDE_DIR "/usr/include" 438 439/* FreeBSD has GCC_INCLUDE_DIR first. */ 440#define INCLUDE_DEFAULTS \ 441 { \ 442 { GCC_INCLUDE_DIR, 0, 0 }, \ 443 { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \ 444 { 0, 0, 0 } \ 445 } 446 447/* Under FreeBSD, the normal location of the compiler back ends is the 448 /usr/libexec directory. */ 449 450#define STANDARD_EXEC_PREFIX "/usr/libexec/" 451 452/* Under FreeBSD, the normal location of the various *crt*.o files is the 453 /usr/lib directory. */ 454 455#define STANDARD_STARTFILE_PREFIX "/usr/lib/" 456 457/* On FreeBSD, gcc is called 'cc' */ 458#define GCC_NAME "cc" 459 460/* FreeBSD is 4.4BSD derived */ 461#define bsd4_4 462 463#endif /* FREEBSD_NATIVE */ 464 465#undef CPP_PREDEFINES 466#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" 467 468#undef CPP_SPEC 469#if TARGET_CPU_DEFAULT == 2 470#define CPP_SPEC "\ 471%{!maout: -D__ELF__} \ 472%{munderscores: -D__UNDERSCORES__} \ 473%{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ 474%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__}" 475#else 476#define CPP_SPEC "\ 477%{!maout: -D__ELF__} \ 478%{munderscores: -D__UNDERSCORES__} \ 479%{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ 480%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{m486:-D__i486__}" 481#endif 482 483#undef CC1_SPEC 484#define CC1_SPEC "\ 485%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ 486%{maout: %{!mno-underscores: %{!munderscores: -munderscores }}}" 487 488#undef ASM_SPEC 489#define ASM_SPEC "%{v*: -v} %{maout: %{fpic:-k} %{fPIC:-k}}" 490 491/* Like the default, except no -lg, and no -p. */ 492#undef LIB_SPEC 493#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:%{!kthread:-lc}%{kthread:-lpthread -lc}}%{pthread:-lc_r}}%{pg:%{!pthread:%{!kthread:-lc_r}%{kthread:-lpthread_p -lc_p}}%{pthread:-lc_r_p}}}" 494 495/* Let gcc locate this for us according to the -m rules */ 496#undef LIBGCC_SPEC 497#define LIBGCC_SPEC "%{!shared:libgcc.a%s}" 498 499/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support 500 for the special GCC options -static and -shared, which allow us to 501 link things in one of these three modes by applying the appropriate 502 combinations of options at link-time. We like to support here for 503 as many of the other GNU linker options as possible. But I don't 504 have the time to search for those flags. I am sure how to add 505 support for -soname shared_object_name. H.J. 506 507 When the -shared link option is used a final link is not being 508 done. */ 509 510#undef LINK_SPEC 511#define LINK_SPEC "\ 512 %{p:%e`-p' not supported; use `-pg' and gprof(1)} \ 513 %{maout: %{shared:-Bshareable} \ 514 %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \ 515 %{pg:-Bstatic} %{Z}} \ 516 %{assert*} %{R*}} \ 517 %{!maout: \ 518 -m elf_i386 \ 519 %{Wl,*:%*} \ 520 %{assert*} %{R*} %{rpath*} %{defsym*} \ 521 %{shared:-Bshared %{h*} %{soname*}} \ 522 %{symbolic:-Bsymbolic} \ 523 %{!shared: \ 524 %{!static: \ 525 %{rdynamic: -export-dynamic} \ 526 %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}} \ 527 %{static:-Bstatic}}}" 528 529/* Get perform_* macros to build libgcc.a. */ 530#include "i386/perform.h" 531 532#undef STARTFILE_SPEC 533#define STARTFILE_SPEC "\ 534 %{maout: %{shared:c++rt0.o%s} \ 535 %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}} \ 536 %{!maout: %{!shared: \ 537 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ 538 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 539 540#undef ENDFILE_SPEC 541#define ENDFILE_SPEC \ 542 "%{!maout: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}" 543 544/* This goes away when the math emulator is fixed. */ 545#undef TARGET_DEFAULT 546#define TARGET_DEFAULT (MASK_NO_FANCY_MATH_387 | 0301) 547 548#define HAVE_ATEXIT 549#define HAVE_PUTENV 550 551/* to assist building libgcc2.c */ 552#ifndef __ELF__ 553#undef OBJECT_FORMAT_ELF 554#endif
| 132/* This is how to store into the string BUF 133 the symbol_ref name of an internal numbered label where 134 PREFIX is the class of label and NUM is the number within the class. 135 This is suitable for output with `assemble_name'. */ 136#undef ASM_GENERATE_INTERNAL_LABEL 137#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ 138 sprintf ((BUF), "*%s%s%d", (TARGET_UNDERSCORES) ? "" : ".", \ 139 (PREFIX), (NUMBER)) 140 141/* This is how to output an internal numbered label where 142 PREFIX is the class of label and NUM is the number within the class. */ 143#undef ASM_OUTPUT_INTERNAL_LABEL 144#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 145 fprintf (FILE, "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \ 146 PREFIX, NUM) 147 148/* This is how to output a reference to a user-level label named NAME. */ 149#undef ASM_OUTPUT_LABELREF 150#define ASM_OUTPUT_LABELREF(FILE,NAME) \ 151 fprintf (FILE, "%s%s", (TARGET_UNDERSCORES) ? "_" : "", NAME) 152 153 154/* This is how to output an element of a case-vector that is relative. 155 This is only used for PIC code. See comments by the `casesi' insn in 156 i386.md for an explanation of the expression this outputs. */ 157#undef ASM_OUTPUT_ADDR_DIFF_ELT 158#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ 159 fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE) 160 161#undef ASM_OUTPUT_ALIGN 162#define ASM_OUTPUT_ALIGN(FILE,LOG) \ 163 if ((LOG)!=0) fprintf ((FILE), "\t.p2align %d\n", (LOG)) 164 165/* Align labels, etc. at 4-byte boundaries. 166 For the 486, align to 16-byte boundary for sake of cache. */ 167#undef ASM_OUTPUT_ALIGN_CODE 168#define ASM_OUTPUT_ALIGN_CODE(FILE) \ 169 fprintf ((FILE), "\t.p2align %d,0x90\n", i386_align_jumps) 170 171/* Align start of loop at 4-byte boundary. */ 172#undef ASM_OUTPUT_LOOP_ALIGN 173#define ASM_OUTPUT_LOOP_ALIGN(FILE) \ 174 fprintf ((FILE), "\t.p2align %d,0x90\n", i386_align_loops) 175 176 177/* conditionalize the use of ".section rodata" on elf mode - otherwise .text */ 178#undef USE_CONST_SECTION 179#define USE_CONST_SECTION TARGET_ELF 180 181/* A C statement (sans semicolon) to output an element in the table of 182 global constructors. */ 183#undef ASM_OUTPUT_CONSTRUCTOR 184#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ 185 do { \ 186 if (TARGET_ELF) { \ 187 ctors_section (); \ 188 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ 189 assemble_name (FILE, NAME); \ 190 fprintf (FILE, "\n"); \ 191 } else { \ 192 fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,", ASM_STABS_OP, \ 193 (TARGET_UNDERSCORES) ? "_" : ""); \ 194 assemble_name (asm_out_file, name); \ 195 fputc ('\n', asm_out_file); \ 196 } \ 197 } while (0) 198 199/* A C statement (sans semicolon) to output an element in the table of 200 global destructors. */ 201#undef ASM_OUTPUT_DESTRUCTOR 202#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ 203 do { \ 204 if (TARGET_ELF) { \ 205 dtors_section (); \ 206 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ 207 assemble_name (FILE, NAME); \ 208 fprintf (FILE, "\n"); \ 209 } else { \ 210 fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,", ASM_STABS_OP, \ 211 (TARGET_UNDERSCORES) ? "_" : ""); \ 212 assemble_name (asm_out_file, name); \ 213 fputc ('\n', asm_out_file); \ 214 } \ 215 } while (0) 216 217/* This says how to output assembler code to declare an 218 uninitialized internal linkage data object. Under SVR4, 219 the linker seems to want the alignment of data objects 220 to depend on their types. We do exactly that here. */ 221 222#undef ASM_OUTPUT_ALIGNED_LOCAL 223#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 224do { \ 225 if (TARGET_ELF) { \ 226 fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP); \ 227 assemble_name ((FILE), (NAME)); \ 228 fprintf ((FILE), "\n"); \ 229 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ 230 } else { \ 231 int rounded = (SIZE); \ 232 if (rounded == 0) rounded = 1; \ 233 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 234 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 235 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 236 fputs (".lcomm ", (FILE)); \ 237 assemble_name ((FILE), (NAME)); \ 238 fprintf ((FILE), ",%u\n", (rounded)); \ 239 } \ 240} while (0) 241 242#undef ASM_OUTPUT_ALIGNED_COMMON 243#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 244do { \ 245 if (TARGET_ELF) { \ 246 fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \ 247 assemble_name ((FILE), (NAME)); \ 248 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ 249 } else { \ 250 int rounded = (SIZE); \ 251 if (rounded == 0) rounded = 1; \ 252 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 253 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 254 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 255 fputs (".comm ", (FILE)); \ 256 assemble_name ((FILE), (NAME)); \ 257 fprintf ((FILE), ",%u\n", (rounded)); \ 258 } \ 259} while (0) 260 261/* Turn off svr4.h version, it chokes the old gas. The old layout 262 works fine under new gas anyway. */ 263#undef ASM_OUTPUT_ASCII 264 265/* How to output some space */ 266#undef ASM_OUTPUT_SKIP 267#define ASM_OUTPUT_SKIP(FILE,SIZE) \ 268do { \ 269 if (TARGET_ELF) { \ 270 fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE)); \ 271 } else { \ 272 fprintf (FILE, "\t.space %u\n", (SIZE)); \ 273 } \ 274} while (0) 275 276#undef ASM_OUTPUT_SOURCE_LINE 277#define ASM_OUTPUT_SOURCE_LINE(file, line) \ 278do { \ 279 static int sym_lineno = 1; \ 280 if (TARGET_ELF) { \ 281 fprintf (file, ".stabn 68,0,%d,.LM%d-", line, sym_lineno); \ 282 assemble_name (file, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\ 283 fprintf (file, "\n.LM%d:\n", sym_lineno); \ 284 sym_lineno += 1; \ 285 } else { \ 286 fprintf (file, "\t%s %d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno); \ 287 } \ 288} while (0) 289 290/* in elf, the function stabs come first, before the relative offsets */ 291#undef DBX_FUNCTION_FIRST 292#define DBX_CHECK_FUNCTION_FIRST TARGET_ELF 293 294/* tag end of file in elf mode */ 295#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END 296#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ 297do { \ 298 if (TARGET_ELF) { \ 299 fprintf (FILE, "\t.text\n\t.stabs \"\",%d,0,0,.Letext\n.Letext:\n", N_SO); \ 300 } \ 301} while (0) 302 303/* stabs-in-elf has offsets relative to function beginning */ 304#undef DBX_OUTPUT_LBRAC 305#define DBX_OUTPUT_LBRAC(file,name) \ 306do { \ 307 fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_LBRAC); \ 308 assemble_name (asmfile, buf); \ 309 if (TARGET_ELF) { \ 310 fputc ('-', asmfile); \ 311 assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ 312 } \ 313 fprintf (asmfile, "\n"); \ 314} while (0) 315 316#undef DBX_OUTPUT_RBRAC 317#define DBX_OUTPUT_RBRAC(file,name) \ 318do { \ 319 fprintf (asmfile, "%s %d,0,0,", ASM_STABN_OP, N_RBRAC); \ 320 assemble_name (asmfile, buf); \ 321 if (TARGET_ELF) { \ 322 fputc ('-', asmfile); \ 323 assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \ 324 } \ 325 fprintf (asmfile, "\n"); \ 326} while (0) 327 328 329/* Define macro used to output shift-double opcodes when the shift 330 count is in %cl. Some assemblers require %cl as an argument; 331 some don't. 332 333 *OLD* GAS requires the %cl argument, so override i386/unix.h. */ 334 335#undef AS3_SHIFT_DOUBLE 336#define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d) 337 338/* Indicate that jump tables go in the text section. This is 339 necessary when compiling PIC code. */ 340#define JUMP_TABLES_IN_TEXT_SECTION 341 342/* override the exception table positioning */ 343#define EXCEPTION_SECTION_FUNCTION \ 344do { \ 345 if (TARGET_ELF) { \ 346 named_section (NULL_TREE, ".gcc_except_table"); \ 347 } else { \ 348 if (flag_pic) \ 349 data_section (); \ 350 else \ 351 readonly_data_section (); \ 352 } \ 353} while (0); 354 355/* supply our own hook for calling __main() from main() */ 356#define GEN_CALL__MAIN \ 357 do { \ 358 if (!(TARGET_ELF)) \ 359 emit_library_call (gen_rtx (SYMBOL_REF, Pmode, NAME__MAIN), 0, \ 360 VOIDmode, 0); \ 361 } while (0) 362 363/* Map i386 registers to the numbers dwarf expects. Of course this is different 364 from what stabs expects. */ 365 366#undef DWARF_DBX_REGISTER_NUMBER 367#define DWARF_DBX_REGISTER_NUMBER(n) \ 368((n) == 0 ? 0 \ 369 : (n) == 1 ? 2 \ 370 : (n) == 2 ? 1 \ 371 : (n) == 3 ? 3 \ 372 : (n) == 4 ? 6 \ 373 : (n) == 5 ? 7 \ 374 : (n) == 6 ? 5 \ 375 : (n) == 7 ? 4 \ 376 : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \ 377 : (-1)) 378 379/* Now what stabs expects in the register. */ 380#define STABS_DBX_REGISTER_NUMBER(n) \ 381((n) == 0 ? 0 : \ 382 (n) == 1 ? 2 : \ 383 (n) == 2 ? 1 : \ 384 (n) == 3 ? 3 : \ 385 (n) == 4 ? 6 : \ 386 (n) == 5 ? 7 : \ 387 (n) == 6 ? 4 : \ 388 (n) == 7 ? 5 : \ 389 (n) + 4) 390 391#undef DBX_REGISTER_NUMBER 392#define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \ 393 ? DWARF_DBX_REGISTER_NUMBER(n) \ 394 : STABS_DBX_REGISTER_NUMBER(n)) 395 396/* Tell final.c that we don't need a label passed to mcount. */ 397#define NO_PROFILE_DATA 398 399/* Output assembler code to FILE to increment profiler label # LABELNO 400 for profiling a function entry. */ 401/* Redefine this to not pass an unused label in %edx. */ 402 403#undef FUNCTION_PROFILER 404#define FUNCTION_PROFILER(FILE, LABELNO) \ 405{ \ 406 if (flag_pic) \ 407 fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \ 408 else \ 409 fprintf (FILE, "\tcall mcount\n"); \ 410} 411 412#define FUNCTION_PROFILER_EPILOGUE(FILE) \ 413{ \ 414 if (TARGET_PROFILER_EPILOGUE) \ 415 { \ 416 if (flag_pic) \ 417 fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \ 418 else \ 419 fprintf (FILE, "\tcall mexitcount\n"); \ 420 } \ 421} 422 423#undef SIZE_TYPE 424#define SIZE_TYPE "unsigned int" 425 426#undef PTRDIFF_TYPE 427#define PTRDIFF_TYPE "int" 428 429#undef WCHAR_TYPE 430#define WCHAR_TYPE "int" 431 432#define WCHAR_UNSIGNED 0 433 434#undef WCHAR_TYPE_SIZE 435#define WCHAR_TYPE_SIZE BITS_PER_WORD 436 437/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD 438 source tree so it can be configured appropriately without using 439 the GNU configure/build mechanism. */ 440 441#ifdef FREEBSD_NATIVE 442 443/* Look for the include files in the system-defined places. */ 444 445#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++" 446 447#define GCC_INCLUDE_DIR "/usr/include" 448 449/* FreeBSD has GCC_INCLUDE_DIR first. */ 450#define INCLUDE_DEFAULTS \ 451 { \ 452 { GCC_INCLUDE_DIR, 0, 0 }, \ 453 { GPLUSPLUS_INCLUDE_DIR, 1, 1 }, \ 454 { 0, 0, 0 } \ 455 } 456 457/* Under FreeBSD, the normal location of the compiler back ends is the 458 /usr/libexec directory. */ 459 460#define STANDARD_EXEC_PREFIX "/usr/libexec/" 461 462/* Under FreeBSD, the normal location of the various *crt*.o files is the 463 /usr/lib directory. */ 464 465#define STANDARD_STARTFILE_PREFIX "/usr/lib/" 466 467/* On FreeBSD, gcc is called 'cc' */ 468#define GCC_NAME "cc" 469 470/* FreeBSD is 4.4BSD derived */ 471#define bsd4_4 472 473#endif /* FREEBSD_NATIVE */ 474 475#undef CPP_PREDEFINES 476#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=3 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" 477 478#undef CPP_SPEC 479#if TARGET_CPU_DEFAULT == 2 480#define CPP_SPEC "\ 481%{!maout: -D__ELF__} \ 482%{munderscores: -D__UNDERSCORES__} \ 483%{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ 484%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__}" 485#else 486#define CPP_SPEC "\ 487%{!maout: -D__ELF__} \ 488%{munderscores: -D__UNDERSCORES__} \ 489%{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ 490%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{m486:-D__i486__}" 491#endif 492 493#undef CC1_SPEC 494#define CC1_SPEC "\ 495%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ 496%{maout: %{!mno-underscores: %{!munderscores: -munderscores }}}" 497 498#undef ASM_SPEC 499#define ASM_SPEC "%{v*: -v} %{maout: %{fpic:-k} %{fPIC:-k}}" 500 501/* Like the default, except no -lg, and no -p. */ 502#undef LIB_SPEC 503#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:%{!kthread:-lc}%{kthread:-lpthread -lc}}%{pthread:-lc_r}}%{pg:%{!pthread:%{!kthread:-lc_r}%{kthread:-lpthread_p -lc_p}}%{pthread:-lc_r_p}}}" 504 505/* Let gcc locate this for us according to the -m rules */ 506#undef LIBGCC_SPEC 507#define LIBGCC_SPEC "%{!shared:libgcc.a%s}" 508 509/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support 510 for the special GCC options -static and -shared, which allow us to 511 link things in one of these three modes by applying the appropriate 512 combinations of options at link-time. We like to support here for 513 as many of the other GNU linker options as possible. But I don't 514 have the time to search for those flags. I am sure how to add 515 support for -soname shared_object_name. H.J. 516 517 When the -shared link option is used a final link is not being 518 done. */ 519 520#undef LINK_SPEC 521#define LINK_SPEC "\ 522 %{p:%e`-p' not supported; use `-pg' and gprof(1)} \ 523 %{maout: %{shared:-Bshareable} \ 524 %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \ 525 %{pg:-Bstatic} %{Z}} \ 526 %{assert*} %{R*}} \ 527 %{!maout: \ 528 -m elf_i386 \ 529 %{Wl,*:%*} \ 530 %{assert*} %{R*} %{rpath*} %{defsym*} \ 531 %{shared:-Bshared %{h*} %{soname*}} \ 532 %{symbolic:-Bsymbolic} \ 533 %{!shared: \ 534 %{!static: \ 535 %{rdynamic: -export-dynamic} \ 536 %{!dynamic-linker: -dynamic-linker /usr/libexec/ld-elf.so.1}} \ 537 %{static:-Bstatic}}}" 538 539/* Get perform_* macros to build libgcc.a. */ 540#include "i386/perform.h" 541 542#undef STARTFILE_SPEC 543#define STARTFILE_SPEC "\ 544 %{maout: %{shared:c++rt0.o%s} \ 545 %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}} \ 546 %{!maout: %{!shared: \ 547 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ 548 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 549 550#undef ENDFILE_SPEC 551#define ENDFILE_SPEC \ 552 "%{!maout: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}" 553 554/* This goes away when the math emulator is fixed. */ 555#undef TARGET_DEFAULT 556#define TARGET_DEFAULT (MASK_NO_FANCY_MATH_387 | 0301) 557 558#define HAVE_ATEXIT 559#define HAVE_PUTENV 560 561/* to assist building libgcc2.c */ 562#ifndef __ELF__ 563#undef OBJECT_FORMAT_ELF 564#endif
|