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