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