freebsd.h revision 73243
1/* Base configuration file for all FreeBSD targets. 2 Copyright (C) 1999, 2000 Free Software Foundation, Inc. 3 4This file is part of GNU CC. 5 6GNU CC is free software; you can redistribute it and/or modify 7it under the terms of the GNU General Public License as published by 8the Free Software Foundation; either version 2, or (at your option) 9any later version. 10 11GNU CC is distributed in the hope that it will be useful, 12but WITHOUT ANY WARRANTY; without even the implied warranty of 13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14GNU General Public License for more details. 15 16You should have received a copy of the GNU General Public License 17along with GNU CC; see the file COPYING. If not, write to 18the Free Software Foundation, 59 Temple Place - Suite 330, 19Boston, MA 02111-1307, USA. */ 20 21/* Common FreeBSD configuration. 22 All FreeBSD architectures should include this file, which will specify 23 their commonalities. 24 Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h, 25 /usr/src/contrib/gcc/config/svr4.h & 26 egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien */ 27 28/* $FreeBSD: head/contrib/gcc/config/freebsd.h 73243 2001-02-28 22:37:32Z obrien $ */ 29 30 31/* Cpp, assembler, linker, library, and startfile spec's. */ 32 33/* This defines which switch letters take arguments. On FreeBSD, most of 34 the normal cases (defined in gcc.c) apply, and we also have -h* and 35 -z* options (for the linker) (coming from SVR4). 36 We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 37 38#define FBSD_SWITCH_TAKES_ARG(CHAR) \ 39 (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ 40 || (CHAR) == 'h' \ 41 || (CHAR) == 'z' /* ignored by ld */ \ 42 || (CHAR) == 'R') 43 44#undef SWITCH_TAKES_ARG 45#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR)) 46 47/* This defines which multi-letter switches take arguments. */ 48 49#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \ 50 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 51 || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ 52 || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ 53 || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) 54 55#undef WORD_SWITCH_TAKES_ARG 56#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR)) 57 58/* Place spaces around this string. We depend on string splicing to produce 59 the final CPP_PREDEFINES value. */ 60#define FBSD_CPP_PREDEFINES " -Dunix -D__FreeBSD__=5 -D__FreeBSD_cc_version=500002 -Asystem(unix) -Asystem(FreeBSD) " 61 62#define FBSD_CPP_SPEC " \ 63 %(cpp_cpu) \ 64 %{!maout: -D__ELF__} \ 65 %{munderscores: -D__UNDERSCORES__} \ 66 %{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ 67 %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \ 68 %{posix:-D_POSIX_SOURCE}" 69 70#undef CPP_SPEC 71#define CPP_SPEC FBSD_CPP_SPEC 72 73/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate 74 libc, depending on whether we're doing profiling. Add the appropriate 75 libc_r if supporting threads. 76 (like the default, except no -lg, and no -p). */ 77#undef LIB_SPEC 78#define LIB_SPEC " \ 79 %{!shared: \ 80 %{!pg: %{pthread:-lc_r} -lc} \ 81 %{pg: %{pthread:-lc_r_p} -lc_p} \ 82 }" 83 84 85/************************[ Target stuff ]***********************************/ 86 87/* All FreeBSD Architectures support the ELF object file format. */ 88#undef OBJECT_FORMAT_ELF 89#define OBJECT_FORMAT_ELF 90 91/* Don't assume anything about the header files. */ 92#undef NO_IMPLICIT_EXTERN_C 93#define NO_IMPLICIT_EXTERN_C 94 95/* Implicit library calls should use memcpy, not bcopy, etc. */ 96#undef TARGET_MEM_FUNCTIONS 97#define TARGET_MEM_FUNCTIONS 98 99/* Allow #sccs in preprocessor. */ 100#undef SCCS_DIRECTIVE 101#define SCCS_DIRECTIVE 102 103#undef HAVE_ATEXIT 104#define HAVE_ATEXIT 105 106/* Code generation parameters. */ 107 108/* Don't default to pcc-struct-return, because gcc is the only compiler, and 109 we want to retain compatibility with older gcc versions 110 (even though the SVR4 ABI for the i386 says that records and unions are 111 returned in memory). */ 112#undef DEFAULT_PCC_STRUCT_RETURN 113#define DEFAULT_PCC_STRUCT_RETURN 0 114 115/* Writing `int' for a bitfield forces int alignment for the structure. */ 116/* XXX: ok for Alpha?? */ 117#undef PCC_BITFIELD_TYPE_MATTERS 118#define PCC_BITFIELD_TYPE_MATTERS 1 119 120/* Use periods rather than dollar signs in special g++ assembler names. 121 This ensures the configuration knows our system correctly so we can link 122 with libraries compiled with the native cc. */ 123#undef NO_DOLLAR_IN_LABEL 124 125/* The prefix to add to user-visible assembler symbols. 126 For System V Release 4 & ELF the convention is *not* to prepend a leading 127 underscore onto user-level symbol names. */ 128 129#undef USER_LABEL_PREFIX 130#define USER_LABEL_PREFIX "" 131 132/* Handle #pragma weak and #pragma pack. */ 133#undef HANDLE_SYSV_PRAGMA 134#define HANDLE_SYSV_PRAGMA 135 136/* FreeBSD ELF using our home-grown crtbegin.o/crtend.o does not support the 137 DWARF2 unwinding mechanisms. Once `make world' bootstraping problems with 138 the EGCS crtstuff.c is overcome, we will switch to the non-sjlj-exceptions 139 type exception machanism. */ 140#define DWARF2_UNWIND_INFO 0 141 142/* Do not use ``thunks'' to implement C++ vtables. This method still has 143 fatal bugs. Also, GCC 3.0 will have a new C++ ABI that may not even 144 support `thunks'. */ 145#undef DEFAULT_VTABLE_THUNKS 146 147 148/************************[ Assembler stuff ]********************************/ 149 150/* Override the default comment-starter of "/". */ 151#undef ASM_COMMENT_START 152#define ASM_COMMENT_START "#" 153 154/* Attach a special .ident directive to the end of the file to identify 155 the version of GCC which compiled this code. The format of the 156 .ident string is patterned after the ones produced by native SVR4 157 C compilers. */ 158 159#undef IDENT_ASM_OP 160#define IDENT_ASM_OP "\t.ident\t" 161 162/* Output #ident as a .ident. */ 163 164#undef ASM_OUTPUT_IDENT 165#define ASM_OUTPUT_IDENT(FILE, NAME) \ 166 fprintf ((FILE), "%s\"%s\"\n", IDENT_ASM_OP, (NAME)); 167 168/* Identify the front-end which produced this file. To keep symbol 169 space down, and not confuse kdb, only do this if the language is 170 not C. (svr4.h defines ASM_IDENTIFY_GCC but neglects this) */ 171 172#undef ASM_IDENTIFY_LANGUAGE 173#define ASM_IDENTIFY_LANGUAGE(FILE) \ 174 { \ 175 if (strcmp (lang_identify (), "c") != 0) \ 176 output_lang_identify (FILE); \ 177 } 178 179#undef ASM_FILE_END 180#define ASM_FILE_END(FILE) \ 181 do { \ 182 if (!flag_no_ident) \ 183 fprintf ((FILE), "%s\"[ASM_FILE_END]GCC: (%s) %s\"\n", \ 184 IDENT_ASM_OP, lang_identify(), version_string); \ 185 } while (0) 186 187/* This is the pseudo-op used to generate a contiguous sequence of byte 188 values from a double-quoted string WITHOUT HAVING A TERMINATING NUL 189 AUTOMATICALLY APPENDED. This is the same for most SVR4 assemblers. */ 190 191#undef ASCII_DATA_ASM_OP 192#define ASCII_DATA_ASM_OP "\t.ascii\t" 193 194#undef ASM_BYTE_OP 195#define ASM_BYTE_OP "\t.byte\t" 196 197/* This is how to allocate empty space in some section. The .zero 198 pseudo-op is used for this on most ELF assemblers. */ 199 200#undef SKIP_ASM_OP 201#define SKIP_ASM_OP "\t.zero\t" 202 203/* How to output some space. The rules are different depending on the 204 object format. */ 205#undef ASM_OUTPUT_SKIP 206#define ASM_OUTPUT_SKIP(FILE, SIZE) \ 207 do { \ 208 if (TARGET_ELF) \ 209 { \ 210 fprintf ((FILE), "%s%u\n", SKIP_ASM_OP, (SIZE)); \ 211 } \ 212 else \ 213 { \ 214 fprintf ((FILE), "\t.space\t%u\n", (SIZE)); \ 215 } \ 216 } while (0) 217 218/* A table of bytes codes used by the ASM_OUTPUT_ASCII and 219 ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table 220 corresponds to a particular byte value [0..255]. For any 221 given byte value, if the value in the corresponding table 222 position is zero, the given character can be output directly. 223 If the table value is 1, the byte must be output as a \ooo 224 octal escape. If the tables value is anything else, then the 225 byte value should be output as a \ followed by the value 226 in the table. Note that we can use standard UN*X escape 227 sequences for many control characters, but we don't use 228 \a to represent BEL because some SVR4 assemblers (e.g. on 229 the i386) don't know about that. Also, we don't use \v 230 since some versions of gas, such as 2.2 did not accept it. */ 231 232#define ESCAPES \ 233"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 234\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 235\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\ 236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\ 237\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 238\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 239\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\ 240\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1" 241 242/* Some SVR4 assemblers have a limit on the number of characters which 243 can appear in the operand of a .string directive. If your assembler 244 has such a limitation, you should define STRING_LIMIT to reflect that 245 limit. Note that at least some SVR4 assemblers have a limit on the 246 actual number of bytes in the double-quoted string, and that they 247 count each character in an escape sequence as one byte. Thus, an 248 escape sequence like \377 would count as four bytes. 249 250 If your target assembler doesn't support the .string directive, you 251 should define this to zero. 252*/ 253 254#undef STRING_LIMIT 255#define STRING_LIMIT ((unsigned) 256) 256 257#undef STRING_ASM_OP 258#define STRING_ASM_OP "\t.string\t" 259 260/* Output the label which precedes a jumptable. Note that for all svr4/ELF 261 systems where we actually generate jumptables (which is to say every 262 SVR4 target except i386, where we use casesi instead) we put the jump- 263 tables into the .rodata section and since other stuff could have been 264 put into the .rodata section prior to any given jumptable, we have to 265 make sure that the location counter for the .rodata section gets pro- 266 perly re-aligned prior to the actual beginning of the jump table. */ 267 268#undef ALIGN_ASM_OP 269#define ALIGN_ASM_OP "\t.align\t" 270 271/* This says how to output assembler code to declare an 272 uninitialized external linkage data object. Under SVR4/ELF, 273 the linker seems to want the alignment of data objects 274 to depend on their types. We do exactly that here. */ 275 276#undef COMMON_ASM_OP 277#define COMMON_ASM_OP "\t.comm\t" 278 279#undef ASM_OUTPUT_ALIGNED_COMMON 280#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \ 281 do { \ 282 if (TARGET_ELF) \ 283 { \ 284 fprintf ((FILE), "%s", COMMON_ASM_OP); \ 285 assemble_name ((FILE), (NAME)); \ 286 fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ 287 } \ 288 else \ 289 { \ 290 int rounded = (SIZE); \ 291 if (rounded == 0) rounded = 1; \ 292 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 293 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 294 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 295 fprintf ((FILE), "%s ", COMMON_ASM_OP); \ 296 assemble_name ((FILE), (NAME)); \ 297 fprintf ((FILE), ",%u\n", (rounded)); \ 298 } \ 299 } while (0) 300 301/* This says how to output assembler code to declare an 302 uninitialized internal linkage data object. Under SVR4/ELF, 303 the linker seems to want the alignment of data objects 304 to depend on their types. We do exactly that here. */ 305 306#undef LOCAL_ASM_OP 307#define LOCAL_ASM_OP "\t.local\t" 308 309/* This says how to output assembler code to declare an 310 uninitialized internal linkage data object. Under SVR4, 311 the linker seems to want the alignment of data objects 312 to depend on their types. We do exactly that here. */ 313 314#undef ASM_OUTPUT_ALIGNED_LOCAL 315#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ 316 do { \ 317 if (TARGET_ELF) \ 318 { \ 319 fprintf ((FILE), "%s", LOCAL_ASM_OP); \ 320 assemble_name ((FILE), (NAME)); \ 321 fprintf ((FILE), "\n"); \ 322 ASM_OUTPUT_ALIGNED_COMMON ((FILE), (NAME), (SIZE), (ALIGN)); \ 323 } \ 324 else \ 325 { \ 326 int rounded = (SIZE); \ 327 if (rounded == 0) rounded = 1; \ 328 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; \ 329 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) \ 330 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); \ 331 fputs ("\t.lcomm\t", (FILE)); \ 332 assemble_name ((FILE), (NAME)); \ 333 fprintf ((FILE), ",%u\n", (rounded)); \ 334 } \ 335 } while (0) 336 337#undef ASM_OUTPUT_BEFORE_CASE_LABEL 338#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \ 339 ASM_OUTPUT_ALIGN ((FILE), 2); 340 341#undef ASM_OUTPUT_CASE_LABEL 342#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \ 343 do { \ 344 ASM_OUTPUT_BEFORE_CASE_LABEL ((FILE), (PREFIX), (NUM), (JUMPTABLE)) \ 345 ASM_OUTPUT_INTERNAL_LABEL ((FILE), (PREFIX), (NUM)); \ 346 } while (0) 347 348/* The standard SVR4/ELF assembler seems to require that certain builtin 349 library routines (e.g. .udiv) be explicitly declared as .globl 350 in each assembly file where they are referenced. */ 351 352#undef ASM_OUTPUT_EXTERNAL_LIBCALL 353#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \ 354 ASM_GLOBALIZE_LABEL ((FILE), XSTR ((FUN), 0)) 355 356/* Support const sections and the ctors and dtors sections for g++. 357 Note that there appears to be two different ways to support const 358 sections at the moment. You can either #define the symbol 359 READONLY_DATA_SECTION (giving it some code which switches to the 360 readonly data section) or else you can #define the symbols 361 EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and 362 SELECT_RTX_SECTION. We do both here just to be on the safe side. 363 FreeBSD conditionalizes the use of ".section rodata" depending on 364 ELF mode - otherwise .text. */ 365 366#undef USE_CONST_SECTION 367#define USE_CONST_SECTION TARGET_ELF 368 369#undef CONST_SECTION_ASM_OP 370#define CONST_SECTION_ASM_OP "\t.section\t.rodata" 371 372/* Define the pseudo-ops used to switch to the .ctors and .dtors sections. 373 374 Note that we want to give these sections the SHF_WRITE attribute 375 because these sections will actually contain data (i.e. tables of 376 addresses of functions in the current root executable or shared library 377 file) and, in the case of a shared library, the relocatable addresses 378 will have to be properly resolved/relocated (and then written into) by 379 the dynamic linker when it actually attaches the given shared library 380 to the executing process. (Note that on SVR4, you may wish to use the 381 `-z text' option to the ELF linker, when building a shared library, as 382 an additional check that you are doing everything right. But if you do 383 use the `-z text' option when building a shared library, you will get 384 errors unless the .ctors and .dtors sections are marked as writable 385 via the SHF_WRITE attribute.) */ 386 387#undef CTORS_SECTION_ASM_OP 388#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\"" 389#undef DTORS_SECTION_ASM_OP 390#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\"" 391 392/* On SVR4, we *do* have support for the .init and .fini sections, and we 393 can put stuff in there to be executed before and after `main'. We let 394 crtstuff.c and other files know this by defining the following symbols. 395 The definitions say how to change sections to the .init and .fini 396 sections. This is the same for all known SVR4 assemblers. */ 397 398#undef INIT_SECTION_ASM_OP 399#define INIT_SECTION_ASM_OP "\t.section\t.init" 400#undef FINI_SECTION_ASM_OP 401#define FINI_SECTION_ASM_OP "\t.section\t.fini" 402 403/* A default list of other sections which we might be "in" at any given 404 time. For targets that use additional sections (e.g. .tdesc) you 405 should override this definition in the target-specific file which 406 includes this file. */ 407 408#undef EXTRA_SECTIONS 409#define EXTRA_SECTIONS in_const, in_ctors, in_dtors 410 411/* A default list of extra section function definitions. For targets 412 that use additional sections (e.g. .tdesc) you should override this 413 definition in the target-specific file which includes this file. */ 414 415#undef EXTRA_SECTION_FUNCTIONS 416#define EXTRA_SECTION_FUNCTIONS \ 417 CONST_SECTION_FUNCTION \ 418 CTORS_SECTION_FUNCTION \ 419 DTORS_SECTION_FUNCTION 420 421#undef READONLY_DATA_SECTION 422#define READONLY_DATA_SECTION() const_section () 423 424extern void text_section (); 425 426#undef CONST_SECTION_FUNCTION 427#define CONST_SECTION_FUNCTION \ 428 void \ 429 const_section () \ 430 { \ 431 if (!USE_CONST_SECTION) \ 432 text_section(); \ 433 else if (in_section != in_const) \ 434 { \ 435 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \ 436 in_section = in_const; \ 437 } \ 438 } 439 440#undef CTORS_SECTION_FUNCTION 441#define CTORS_SECTION_FUNCTION \ 442 void \ 443 ctors_section () \ 444 { \ 445 if (in_section != in_ctors) \ 446 { \ 447 fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ 448 in_section = in_ctors; \ 449 } \ 450 } 451 452#undef DTORS_SECTION_FUNCTION 453#define DTORS_SECTION_FUNCTION \ 454 void \ 455 dtors_section () \ 456 { \ 457 if (in_section != in_dtors) \ 458 { \ 459 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ 460 in_section = in_dtors; \ 461 } \ 462 } 463 464/* A C statement (sans semicolon) to output an element in the table of 465 global constructors. */ 466#undef ASM_OUTPUT_CONSTRUCTOR 467#define ASM_OUTPUT_CONSTRUCTOR(FILE, NAME) \ 468 do { \ 469 if (TARGET_ELF) \ 470 { \ 471 ctors_section (); \ 472 fprintf ((FILE), "%s ", INT_ASM_OP); \ 473 assemble_name ((FILE), (NAME)); \ 474 fprintf ((FILE), "\n"); \ 475 } \ 476 else \ 477 { \ 478 fprintf (asm_out_file, "%s \"%s__CTOR_LIST__\",22,0,0,", \ 479 ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \ 480 assemble_name (asm_out_file, name); \ 481 fputc ('\n', asm_out_file); \ 482 } \ 483 } while (0) 484 485/* A C statement (sans semicolon) to output an element in the table of 486 global destructors. */ 487#undef ASM_OUTPUT_DESTRUCTOR 488#define ASM_OUTPUT_DESTRUCTOR(FILE, NAME) \ 489 do { \ 490 if (TARGET_ELF) \ 491 { \ 492 dtors_section (); \ 493 fprintf ((FILE), "%s ", INT_ASM_OP); \ 494 assemble_name ((FILE), (NAME)); \ 495 fprintf ((FILE), "\n"); \ 496 } \ 497 else \ 498 { \ 499 fprintf (asm_out_file, "%s \"%s__DTOR_LIST__\",22,0,0,", \ 500 ASM_STABS_OP, (TARGET_UNDERSCORES) ? "_" : ""); \ 501 assemble_name (asm_out_file, name); \ 502 fputc ('\n', asm_out_file); \ 503 } \ 504 } while (0) 505 506/* A C statement or statements to switch to the appropriate 507 section for output of RTX in mode MODE. RTX is some kind 508 of constant in RTL. The argument MODE is redundant except 509 in the case of a `const_int' rtx. Currently, these always 510 go into the const section. */ 511 512#undef SELECT_RTX_SECTION 513#define SELECT_RTX_SECTION(MODE, RTX) const_section() 514 515/* Define the strings used for the special svr4/ELF .type and .size 516 directives. These strings generally do not vary from one svr4/ELF 517 system to another. */ 518 519#undef TYPE_ASM_OP 520#define TYPE_ASM_OP "\t.type\t" 521#undef SIZE_ASM_OP 522#define SIZE_ASM_OP "\t.size\t" 523 524/* This is how we tell the assembler that a symbol is weak. */ 525 526#undef ASM_WEAKEN_LABEL 527#define ASM_WEAKEN_LABEL(FILE, NAME) \ 528 do { \ 529 fputs ("\t.globl\t", (FILE)); assemble_name ((FILE), (NAME)); \ 530 fputc ('\n', (FILE)); \ 531 fputs ("\t.weak\t", (FILE)); assemble_name ((FILE), (NAME)); \ 532 fputc ('\n', (FILE)); \ 533 } while (0) 534 535/* The following macro defines the [default] format used with ELF to output 536 the second operand of the .type assembler directive. */ 537 538#undef TYPE_OPERAND_FMT 539#define TYPE_OPERAND_FMT "@%s" 540 541/* Write the extra assembler code needed to declare a function's result. 542 Most svr4/ELF assemblers don't require any special declaration of the 543 result value. */ 544 545#undef ASM_DECLARE_RESULT 546#define ASM_DECLARE_RESULT(FILE, RESULT) 547 548/* These macros generate the special .type and .size directives which 549 are used to set the corresponding fields of the linker symbol table 550 entries in an ELF object file under SVR4/ELF. These macros also output 551 the starting labels for the relevant functions/objects. */ 552 553/* Write the extra assembler code needed to declare an object properly. */ 554 555#undef ASM_DECLARE_OBJECT_NAME 556#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ 557 do { \ 558 fprintf (FILE, "%s ", TYPE_ASM_OP); \ 559 assemble_name (FILE, NAME); \ 560 putc (',', FILE); \ 561 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ 562 putc ('\n', FILE); \ 563 size_directive_output = 0; \ 564 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ 565 { \ 566 size_directive_output = 1; \ 567 fprintf (FILE, "%s ", SIZE_ASM_OP); \ 568 assemble_name (FILE, NAME); \ 569 putc (',', FILE); \ 570 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \ 571 int_size_in_bytes (TREE_TYPE (DECL))); \ 572 fputc ('\n', FILE); \ 573 } \ 574 ASM_OUTPUT_LABEL(FILE, NAME); \ 575 } while (0) 576 577/* Output the size directive for a decl in rest_of_decl_compilation 578 in the case where we did not do so before the initializer. 579 Once we find the error_mark_node, we know that the value of 580 size_directive_output was set 581 by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ 582 583#undef ASM_FINISH_DECLARE_OBJECT 584#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ 585 do { \ 586 char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ 587 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ 588 && ! AT_END && TOP_LEVEL \ 589 && DECL_INITIAL (DECL) == error_mark_node \ 590 && !size_directive_output) \ 591 { \ 592 size_directive_output = 1; \ 593 fprintf (FILE, "%s ", SIZE_ASM_OP); \ 594 assemble_name (FILE, name); \ 595 putc (',', FILE); \ 596 fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \ 597 int_size_in_bytes (TREE_TYPE (DECL))); \ 598 fputc ('\n', FILE); \ 599 } \ 600 } while (0) 601 602 603/************************[ Debugger stuff ]*********************************/ 604 605/* All ELF targets can support DWARF-2. */ 606#undef DWARF2_DEBUGGING_INFO 607#define DWARF2_DEBUGGING_INFO 608 609/* This is BSD, so we want the DBX format. */ 610#undef DBX_DEBUGGING_INFO 611#define DBX_DEBUGGING_INFO 612 613/* Use stabs instead of DWARF debug format. */ 614#undef PREFERRED_DEBUGGING_TYPE 615#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 616 617/* But allow STABS to be supported as well. 618 Note that we want to override some definition settings done for some 619 architecture's native OS's tools that don't apply to us. */ 620#undef ASM_IDENTIFY_GCC 621#undef ASM_IDENTIFY_LANGUAGE 622 623#include "dbxelf.h" 624