|
|
1.1 ! root 1: /* nextstep.h -- operating system specific defines to be used when ! 2: targeting GCC for NeXTSTEP. ! 3: Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. ! 4: ! 5: This file is part of GNU CC. ! 6: ! 7: GNU CC is free software; you can redistribute it and/or modify ! 8: it under the terms of the GNU General Public License as published by ! 9: the Free Software Foundation; either version 2, or (at your option) ! 10: any later version. ! 11: ! 12: GNU CC is distributed in the hope that it will be useful, ! 13: but WITHOUT ANY WARRANTY; without even the implied warranty of ! 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! 15: GNU General Public License for more details. ! 16: ! 17: You should have received a copy of the GNU General Public License ! 18: along with GNU CC; see the file COPYING. If not, write to ! 19: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ! 20: ! 21: /* Use new NeXT include file search path. ! 22: In a cross compiler with NeXT as target, don't expect ! 23: the host to use Next's directory scheme. */ ! 24: ! 25: #if NeXT || !defined(CROSS_COMPILE) ! 26: #undef INCLUDE_DEFAULTS ! 27: #define INCLUDE_DEFAULTS \ ! 28: { \ ! 29: { "/NextDeveloper/Headers/g++", 1}, \ ! 30: { "/NextDeveloper/Headers", 0}, \ ! 31: { "/NextDeveloper/Headers/ansi", 0}, \ ! 32: { "/NextDeveloper/Headers/bsd", 0}, \ ! 33: { "/LocalDeveloper/Headers", 2}, \ ! 34: { "/LocalDeveloper/Headers/ansi", 0}, \ ! 35: { "/LocalDeveloper/Headers/bsd", 0}, \ ! 36: { "/NextDeveloper/2.0CompatibleHeaders", 0}, \ ! 37: { STANDARD_INCLUDE_DIR, 0}, \ ! 38: { "/usr/include/bsd", 0}, \ ! 39: { "FakeSystemHeaders", 0}, \ ! 40: { 0, 0} \ ! 41: } ! 42: #endif /* CROSS_COMPILE */ ! 43: ! 44: /* Report errors to make application. */ ! 45: ! 46: #define REPORT_EVENT(TYPE, NAME, FILE, LINE, MSG, ARG1, ARG2, ARG3) \ ! 47: make_support (TYPE, NAME, FILE, LINE, MSG, ARG1, ARG2, ARG3) ! 48: ! 49: #undef EXTRA_FORMAT_FUNCTIONS ! 50: #define EXTRA_FORMAT_FUNCTIONS \ ! 51: "NXPrintf", FALSE, 2, FALSE, \ ! 52: "NXScanf", TRUE, 2, FALSE, \ ! 53: "NXVPrintf", FALSE, 2, TRUE, \ ! 54: "NXVScanf", TRUE, 2, TRUE, \ ! 55: "DPSPrintf", FALSE, 2, FALSE, \ ! 56: "bsd_sprintf", FALSE, 2, FALSE, \ ! 57: "bsd_vsprintf", FALSE, 2, TRUE, ! 58: ! 59: /* Make the compiler look here for standard stuff */ ! 60: ! 61: #ifdef STANDARD_EXEC_PREFIX ! 62: #undef STANDARD_EXEC_PREFIX ! 63: #endif ! 64: #define STANDARD_EXEC_PREFIX "/lib/" ! 65: ! 66: /* Make -fnext-runtime the default. */ ! 67: ! 68: #define NEXT_OBJC_RUNTIME ! 69: ! 70: /* Support -arch xx flags */ ! 71: ! 72: #define NEXT_FAT_OUTPUT ! 73: ! 74: /* support the precompiled header cpp */ ! 75: ! 76: #define NEXT_CPP_PRECOMP ! 77: ! 78: /* Don't make the compiler think it knows which headerfiles are ! 79: c++ and which are not. */ ! 80: /* #define NO_IMPLICIT_EXTERN_C */ ! 81: ! 82: /* change semantics of things around the compiler... */ ! 83: ! 84: #define NEXT_SEMANTICS ! 85: ! 86: /* make the library functions in libgcc have only one underbar ! 87: in front of them. */ ! 88: #define NEXT_LIBGCC_NAMES ! 89: ! 90: /* We have atexit. */ ! 91: ! 92: #define HAVE_ATEXIT ! 93: ! 94: /* Enable recent gcc to compile under the old gcc in Next release 1.0. */ ! 95: ! 96: #define __inline inline ! 97: ! 98: /* wchar_t is unsigned short */ ! 99: ! 100: #undef WCHAR_TYPE ! 101: #define WCHAR_TYPE "short unsigned int" ! 102: #undef WCHAR_TYPE_SIZE ! 103: #define WCHAR_TYPE_SIZE (BITS_PER_WORD / 2) ! 104: ! 105: /* Don't default to pcc-struct-return, because gcc is the only compiler, and ! 106: we want to retain compatibility with older gcc versions. */ ! 107: ! 108: #undef DEFAULT_PCC_STRUCT_RETURN ! 109: #define DEFAULT_PCC_STRUCT_RETURN 0 ! 110: ! 111: /* These compiler options take n arguments. */ ! 112: ! 113: #undef WORD_SWITCH_TAKES_ARG ! 114: #define WORD_SWITCH_TAKES_ARG(STR) \ ! 115: (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) ? 1 : \ ! 116: !strcmp (STR, "segalign") ? 1 : \ ! 117: !strcmp (STR, "seg1addr") ? 1 : \ ! 118: !strcmp (STR, "segaddr") ? 2 : \ ! 119: !strcmp (STR, "sectobjectsymbols") ? 2 : \ ! 120: !strcmp (STR, "segprot") ? 3 : \ ! 121: !strcmp (STR, "sectcreate") ? 3 : \ ! 122: !strcmp (STR, "sectalign") ? 3 : \ ! 123: !strcmp (STR, "segcreate") ? 3 : \ ! 124: !strcmp (STR, "sectorder") ? 3 : \ ! 125: !strcmp (STR, "siff-mask") ? 1 : \ ! 126: !strcmp (STR, "siff-filter") ? 1 : \ ! 127: !strcmp (STR, "siff-warning") ? 1 : \ ! 128: !strcmp (STR, "arch") ? 1 : \ ! 129: !strcmp (STR, "NEXTSTEP-deployment-target") ? 1 : \ ! 130: !strcmp (STR, "pagezero_size") ? 1 : \ ! 131: !strcmp (STR, "dylinker_install_name") ? 1 : \ ! 132: 0) ! 133: ! 134: #undef WORD_SWITCH ! 135: #define WORD_SWITCH(STR) \ ! 136: (WORD_SWITCH_TAKES_ARG (STR) \ ! 137: || !strcmp (STR, "bsd") \ ! 138: || !strcmp (STR, "object") \ ! 139: || !strcmp (STR, "ObjC") \ ! 140: || !strcmp (STR, "dylinker") \ ! 141: || !strcmp (STR, "output_for_dyld") \ ! 142: || !strcmp (STR, "keep_private_externs") \ ! 143: || !strcmp (STR, "all_load")) ! 144: ! 145: /* Machine dependent ccp options. */ ! 146: ! 147: #ifndef NX_RELEASE ! 148: #if defined (RC_RELEASE_3_3) ! 149: #define NX_RELEASE "330" ! 150: #else ! 151: #if defined (RC_RELEASE_3_2hp) || defined (RC_RELEASE_3_2) ! 152: #define NX_RELEASE "320" ! 153: #else ! 154: #define NX_RELEASE "330" ! 155: #endif ! 156: #endif ! 157: #endif ! 158: ! 159: #undef CPP_SPEC ! 160: #define CPP_SPEC "%{!traditional: -D__STDC__} \ ! 161: %{posixstrict:-D_POSIX_SOURCE} \ ! 162: %{!posixstrict:%{bsd:-D__STRICT_BSD__} \ ! 163: %{posix:-D_POSIX_SOURCE} \ ! 164: %{!ansi:-D_NEXT_SOURCE}} \ ! 165: %{mdisable-fpregs:-D__NO_FP__} \ ! 166: -DNX_COMPILER_RELEASE_3_0=300 \ ! 167: -DNX_COMPILER_RELEASE_3_1=310 \ ! 168: -DNX_COMPILER_RELEASE_3_2=320 \ ! 169: -DNX_COMPILER_RELEASE_3_3=330 \ ! 170: -DNX_CURRENT_COMPILER_RELEASE=" NX_RELEASE " \ ! 171: -DNS_TARGET_MINOR=%{k:3}%:{2} \ ! 172: -DNS_TARGET_MAJOR=3 \ ! 173: -DNS_TARGET=3%{k:3}%:{2} \ ! 174: %{MD:-MD %M} %{MMD:-MMD %M}" ! 175: ! 176: /* Machine dependent ld options. */ ! 177: ! 178: #undef LINK_SPEC ! 179: #define LINK_SPEC "%{Z} %{M} \ ! 180: %{execute*} %{preload*} %{fvmlib*} \ ! 181: %{segalign*} %{seg1addr*} %{segaddr*} %{segprot*} \ ! 182: %{pagezero_size*} \ ! 183: %{seglinkedit*} %{noseglinkedit*} \ ! 184: %{sectcreate*} %{sectalign*} %{sectobjectsymbols}\ ! 185: %{segcreate*} %{Mach*} %{whyload} %{w} \ ! 186: %{sectorder*} %{whatsloaded} %{ObjC} %{all_load} %{object} \ ! 187: %{dylinker} %{dylinker_install_name*} %{output_for_dyld} %{keep_private_externs} " ! 188: ! 189: /* Machine dependent libraries. */ ! 190: ! 191: #undef LIB_SPEC ! 192: #define LIB_SPEC "%{!posix*:-lsys_s} %{posix*:-lposix}" ! 193: ! 194: /* We specify crt0.o as -lcrt0.o so that ld will search the library path. */ ! 195: ! 196: #undef STARTFILE_SPEC ! 197: #define STARTFILE_SPEC \ ! 198: "%{!posix*:%{pg:%{!k|object|preload:-lgcrt0.o}%:{-lgcrt1.o}}%{!pg: \ ! 199: %{p:%e-p profiling is no longer supported. Use -pg instead.} \ ! 200: %{!p:%{!k|object|preload:-lcrt0.o}%:{-lcrt1.o}}}}\ ! 201: %{posix*:%{pg:%{!k|object|preload:-lgposixcrt0.o}%:{-lgposixcrt1.o}}%{!pg: \ ! 202: %{p:%e-p profiling is no longer supported. Use -pg instead.} \ ! 203: %{!p:%{!k|object|preload:-lposixcrt0.o}%:{-lposixcrt1.o}}}}" ! 204: ! 205: /* Why not? */ ! 206: ! 207: #undef DOLLARS_IN_IDENTIFIERS ! 208: #define DOLLARS_IN_IDENTIFIERS 2 ! 209: ! 210: /* Allow #sscs (but don't do anything). */ ! 211: ! 212: #define SCCS_DIRECTIVE ! 213: ! 214: /* We use Dbx symbol format. */ ! 215: ! 216: #undef SDB_DEBUGGING_INFO ! 217: #undef XCOFF_DEBUGGING_INFO ! 218: #define DBX_DEBUGGING_INFO ! 219: ! 220: /* This saves a fair amount of space. */ ! 221: ! 222: #undef DBX_CONTIN_LENGTH ! 223: #define DBX_CONTIN_LENGTH 0 ! 224: ! 225: /* These screw up NeXT's gdb at the moment, so don't use them. */ ! 226: ! 227: #undef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY ! 228: #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(FILE, FILENAME) ! 229: ! 230: /* These come from bsd386.h, but are specific to sequent, so make sure ! 231: they don't bite us. */ ! 232: ! 233: #undef DBX_NO_XREFS ! 234: #undef DBX_CONTIN_LENGTH ! 235: ! 236: /* gdb needs a null N_SO at the end of each file for scattered loading. */ ! 237: ! 238: #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END ! 239: #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ ! 240: fprintf (FILE, \ ! 241: "\t.text\n\t.stabs \"%s\",%d,0,0,Letext\nLetext:\n", \ ! 242: "" , N_SO) ! 243: ! 244: /* Don't use .gcc_compiled symbols to communicate with GDB; ! 245: They interfere with numerically sorted symbol lists. */ ! 246: ! 247: #undef ASM_IDENTIFY_GCC ! 248: #define ASM_IDENTIFY_GCC(asm_out_file) ! 249: #undef INIT_SECTION_ASM_OP ! 250: #define INIT_SECTION_ASM_OP ! 251: #undef INVOKE__main ! 252: ! 253: #undef ASM_OUTPUT_CONSTRUCTOR ! 254: #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ ! 255: do { constructor_section (); \ ! 256: ASM_OUTPUT_ALIGN (FILE, 1); \ ! 257: fprintf (FILE, "\t.long "); \ ! 258: assemble_name (FILE, NAME); \ ! 259: fprintf (FILE, "\n"); \ ! 260: fprintf (FILE, ".reference .constructors_used\n"); \ ! 261: } while (0) ! 262: ! 263: #undef ASM_OUTPUT_DESTRUCTOR ! 264: #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ ! 265: do { destructor_section (); \ ! 266: ASM_OUTPUT_ALIGN (FILE, 1); \ ! 267: fprintf (FILE, "\t.long "); \ ! 268: assemble_name (FILE, NAME); \ ! 269: fprintf (FILE, "\n"); \ ! 270: fprintf (FILE, ".reference .destructors_used\n"); \ ! 271: } while (0) ! 272: ! 273: /* Don't output a .file directive. That is only used by the assembler for ! 274: error reporting. */ ! 275: #undef ASM_FILE_START ! 276: #define ASM_FILE_START(FILE) ! 277: ! 278: #undef ASM_FILE_END ! 279: #define ASM_FILE_END(FILE) \ ! 280: do { \ ! 281: extern char *language_string; \ ! 282: if (strcmp (language_string, "GNU C++") == 0) \ ! 283: { \ ! 284: constructor_section (); \ ! 285: destructor_section (); \ ! 286: ASM_OUTPUT_ALIGN (FILE, 1); \ ! 287: } \ ! 288: } while (0) ! 289: ! 290: /* How to parse #pragma's */ ! 291: ! 292: #undef HANDLE_PRAGMA ! 293: #define HANDLE_PRAGMA(finput) handle_pragma (finput, &get_directive_line) ! 294: ! 295: /* Give methods pretty symbol names on NeXT. */ ! 296: ! 297: #undef OBJC_GEN_METHOD_LABEL ! 298: #define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \ ! 299: do { if (CAT_NAME) \ ! 300: sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+', \ ! 301: (CLASS_NAME), (CAT_NAME), (SEL_NAME)); \ ! 302: else \ ! 303: sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+', \ ! 304: (CLASS_NAME), (SEL_NAME)); \ ! 305: } while (0) ! 306: ! 307: /* Wrap new method names in quotes so the assembler doesn't gag. ! 308: Make Objective-C internal symbols local. */ ! 309: ! 310: #undef ASM_OUTPUT_LABELREF ! 311: #define ASM_OUTPUT_LABELREF(FILE,NAME) \ ! 312: do { if (NAME[0] == '+' || NAME[0] == '-') fprintf (FILE, "\"%s\"", NAME); \ ! 313: else if (!strncmp (NAME, "_OBJC_", 6)) fprintf (FILE, "L%s", NAME); \ ! 314: else if (!strncmp (NAME, ".objc_class_name_", 17)) \ ! 315: fprintf (FILE, "%s", NAME); \ ! 316: else fprintf (FILE, "_%s", NAME); } while (0) ! 317: ! 318: #undef ALIGN_ASM_OP ! 319: #define ALIGN_ASM_OP ".align" ! 320: ! 321: #undef ASM_OUTPUT_ALIGN ! 322: #define ASM_OUTPUT_ALIGN(FILE,LOG) \ ! 323: if ((LOG) != 0) \ ! 324: fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)) ! 325: ! 326: /* Ensure correct alignment of bss data. */ ! 327: ! 328: #undef ASM_OUTPUT_ALIGNED_LOCAL ! 329: #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ ! 330: ( fputs (".lcomm ", (FILE)), \ ! 331: assemble_name ((FILE), (NAME)), \ ! 332: fprintf ((FILE), ",%u,%u\n", (SIZE), floor_log2 ((ALIGN) / BITS_PER_UNIT))) ! 333: ! 334: /* Output #ident as a .ident. */ ! 335: ! 336: #undef ASM_OUTPUT_IDENT ! 337: #define ASM_OUTPUT_IDENT(FILE, NAME) ! 338: ! 339: /* The maximum alignment which the object file format can support. ! 340: For NeXT's Mach-O format, this is 2^15. */ ! 341: ! 342: #undef MAX_OFILE_ALIGNMENT ! 343: #define MAX_OFILE_ALIGNMENT 0x8000 ! 344: ! 345: /* Create new Mach-O sections. */ ! 346: ! 347: #undef SECTION_FUNCTION ! 348: #define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, WAS_TEXT, OBJC) \ ! 349: void \ ! 350: FUNCTION () \ ! 351: { \ ! 352: extern void text_section (); \ ! 353: extern void objc_section_init (); \ ! 354: extern int flag_no_mach_text_sections; \ ! 355: \ ! 356: if (WAS_TEXT && flag_no_mach_text_sections) \ ! 357: text_section (); \ ! 358: else if (in_section != SECTION) \ ! 359: { \ ! 360: if (OBJC) \ ! 361: objc_section_init (); \ ! 362: fprintf (asm_out_file, "%s\n", DIRECTIVE); \ ! 363: in_section = SECTION; \ ! 364: } \ ! 365: } \ ! 366: ! 367: #undef EXTRA_SECTIONS ! 368: #define EXTRA_SECTIONS \ ! 369: in_const, in_cstring, in_literal4, in_literal8, \ ! 370: in_constructor, in_destructor, \ ! 371: in_objc_class, in_objc_meta_class, in_objc_category, \ ! 372: in_objc_class_vars, in_objc_instance_vars, \ ! 373: in_objc_cls_meth, in_objc_inst_meth, \ ! 374: in_objc_cat_cls_meth, in_objc_cat_inst_meth, \ ! 375: in_objc_selector_refs, \ ! 376: in_objc_symbols, in_objc_module_info, \ ! 377: in_objc_protocol, in_objc_string_object, \ ! 378: in_objc_class_names, in_objc_meth_var_names, \ ! 379: in_objc_meth_var_types, in_objc_cls_refs, \ ! 380: in_machopic_nl_symbol_ptr, \ ! 381: in_machopic_lazy_symbol_ptr, \ ! 382: in_machopic_symbol_stub, \ ! 383: in_machopic_picsymbol_stub ! 384: ! 385: #undef EXTRA_SECTION_FUNCTIONS ! 386: #define EXTRA_SECTION_FUNCTIONS \ ! 387: SECTION_FUNCTION (const_section, \ ! 388: in_const, \ ! 389: ".const", 1, 0) \ ! 390: SECTION_FUNCTION (cstring_section, \ ! 391: in_cstring, \ ! 392: ".cstring", 1, 0) \ ! 393: SECTION_FUNCTION (literal4_section, \ ! 394: in_literal4, \ ! 395: ".literal4", 1, 0) \ ! 396: SECTION_FUNCTION (literal8_section, \ ! 397: in_literal8, \ ! 398: ".literal8", 1, 0) \ ! 399: SECTION_FUNCTION (constructor_section, \ ! 400: in_constructor, \ ! 401: ".constructor", 0, 0) \ ! 402: SECTION_FUNCTION (destructor_section, \ ! 403: in_destructor, \ ! 404: ".destructor", 0, 0) \ ! 405: SECTION_FUNCTION (objc_class_section, \ ! 406: in_objc_class, \ ! 407: ".objc_class", 0, 1) \ ! 408: SECTION_FUNCTION (objc_meta_class_section, \ ! 409: in_objc_meta_class, \ ! 410: ".objc_meta_class", 0, 1) \ ! 411: SECTION_FUNCTION (objc_category_section, \ ! 412: in_objc_category, \ ! 413: ".objc_category", 0, 1) \ ! 414: SECTION_FUNCTION (objc_class_vars_section, \ ! 415: in_objc_class_vars, \ ! 416: ".objc_class_vars", 0, 1) \ ! 417: SECTION_FUNCTION (objc_instance_vars_section, \ ! 418: in_objc_instance_vars, \ ! 419: ".objc_instance_vars", 0, 1) \ ! 420: SECTION_FUNCTION (objc_cls_meth_section, \ ! 421: in_objc_cls_meth, \ ! 422: ".objc_cls_meth", 0, 1) \ ! 423: SECTION_FUNCTION (objc_inst_meth_section, \ ! 424: in_objc_inst_meth, \ ! 425: ".objc_inst_meth", 0, 1) \ ! 426: SECTION_FUNCTION (objc_cat_cls_meth_section, \ ! 427: in_objc_cat_cls_meth, \ ! 428: ".objc_cat_cls_meth", 0, 1) \ ! 429: SECTION_FUNCTION (objc_cat_inst_meth_section, \ ! 430: in_objc_cat_inst_meth, \ ! 431: ".objc_cat_inst_meth", 0, 1) \ ! 432: SECTION_FUNCTION (objc_selector_refs_section, \ ! 433: in_objc_selector_refs, \ ! 434: ".objc_message_refs", 0, 1) \ ! 435: SECTION_FUNCTION (objc_symbols_section, \ ! 436: in_objc_symbols, \ ! 437: ".objc_symbols", 0, 1) \ ! 438: SECTION_FUNCTION (objc_module_info_section, \ ! 439: in_objc_module_info, \ ! 440: ".objc_module_info", 0, 1) \ ! 441: SECTION_FUNCTION (objc_protocol_section, \ ! 442: in_objc_protocol, \ ! 443: ".objc_protocol", 0, 1) \ ! 444: SECTION_FUNCTION (objc_string_object_section, \ ! 445: in_objc_string_object, \ ! 446: ".objc_string_object", 0, 1) \ ! 447: SECTION_FUNCTION (objc_class_names_section, \ ! 448: in_objc_class_names, \ ! 449: ".objc_class_names", 0, 1) \ ! 450: SECTION_FUNCTION (objc_meth_var_names_section, \ ! 451: in_objc_meth_var_names, \ ! 452: ".objc_meth_var_names", 0, 1) \ ! 453: SECTION_FUNCTION (objc_meth_var_types_section, \ ! 454: in_objc_meth_var_types, \ ! 455: ".objc_meth_var_types", 0, 1) \ ! 456: SECTION_FUNCTION (objc_cls_refs_section, \ ! 457: in_objc_cls_refs, \ ! 458: ".objc_cls_refs", 0, 1) \ ! 459: \ ! 460: SECTION_FUNCTION (machopic_lazy_symbol_ptr_section, \ ! 461: in_machopic_lazy_symbol_ptr, \ ! 462: ".lazy_symbol_pointer", 0, 0) \ ! 463: SECTION_FUNCTION (machopic_nl_symbol_ptr_section, \ ! 464: in_machopic_nl_symbol_ptr, \ ! 465: ".non_lazy_symbol_pointer", 0, 0) \ ! 466: SECTION_FUNCTION (machopic_symbol_stub_section, \ ! 467: in_machopic_symbol_stub, \ ! 468: ".symbol_stub", 0, 0) \ ! 469: SECTION_FUNCTION (machopic_picsymbol_stub_section, \ ! 470: in_machopic_picsymbol_stub, \ ! 471: ".picsymbol_stub", 0, 0) \ ! 472: \ ! 473: void \ ! 474: objc_section_init () \ ! 475: { \ ! 476: static int been_here = 0; \ ! 477: \ ! 478: if (been_here == 0) \ ! 479: { \ ! 480: been_here = 1; \ ! 481: objc_class_section (); \ ! 482: objc_meta_class_section (); \ ! 483: objc_cat_cls_meth_section (); \ ! 484: objc_cat_inst_meth_section (); \ ! 485: objc_cls_meth_section (); \ ! 486: objc_inst_meth_section (); \ ! 487: objc_selector_refs_section (); \ ! 488: objc_symbols_section (); \ ! 489: objc_category_section (); \ ! 490: objc_protocol_section (); \ ! 491: objc_class_vars_section (); \ ! 492: objc_instance_vars_section (); \ ! 493: objc_module_info_section (); \ ! 494: objc_string_object_section (); \ ! 495: objc_class_names_section (); \ ! 496: objc_meth_var_names_section (); \ ! 497: objc_meth_var_types_section (); \ ! 498: objc_cls_refs_section (); \ ! 499: } \ ! 500: } ! 501: ! 502: #undef READONLY_DATA_SECTION ! 503: #define READONLY_DATA_SECTION const_section ! 504: ! 505: #undef SELECT_SECTION ! 506: #define SELECT_SECTION(exp,reloc) \ ! 507: do \ ! 508: { \ ! 509: if (TREE_CODE (exp) == STRING_CST) \ ! 510: { \ ! 511: if (flag_writable_strings) \ ! 512: data_section (); \ ! 513: else if (TREE_STRING_LENGTH (exp) != \ ! 514: strlen (TREE_STRING_POINTER (exp)) + 1) \ ! 515: readonly_data_section (); \ ! 516: else \ ! 517: cstring_section (); \ ! 518: } \ ! 519: else if (TREE_CODE (exp) == INTEGER_CST \ ! 520: || TREE_CODE (exp) == REAL_CST) \ ! 521: { \ ! 522: tree size = TYPE_SIZE (TREE_TYPE (exp)); \ ! 523: \ ! 524: if (TREE_CODE (size) == INTEGER_CST && \ ! 525: TREE_INT_CST_LOW (size) == 4 && \ ! 526: TREE_INT_CST_HIGH (size) == 0) \ ! 527: literal4_section (); \ ! 528: else if (TREE_CODE (size) == INTEGER_CST && \ ! 529: TREE_INT_CST_LOW (size) == 8 && \ ! 530: TREE_INT_CST_HIGH (size) == 0) \ ! 531: literal8_section (); \ ! 532: else \ ! 533: readonly_data_section (); \ ! 534: } \ ! 535: else if (TREE_CODE (exp) == CONSTRUCTOR \ ! 536: && TREE_TYPE (exp) \ ! 537: && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE \ ! 538: && TYPE_NAME (TREE_TYPE (exp))) \ ! 539: { \ ! 540: tree name = TYPE_NAME (TREE_TYPE (exp)); \ ! 541: if (TREE_CODE (name) == TYPE_DECL) \ ! 542: name = DECL_NAME (name); \ ! 543: if (!strcmp (IDENTIFIER_POINTER (name), "NXConstantString")) \ ! 544: objc_string_object_section (); \ ! 545: else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \ ! 546: && !TREE_SIDE_EFFECTS (exp)) \ ! 547: readonly_data_section (); \ ! 548: else \ ! 549: data_section (); \ ! 550: } \ ! 551: else if (TREE_CODE (exp) == VAR_DECL && \ ! 552: DECL_NAME (exp) && \ ! 553: TREE_CODE (DECL_NAME (exp)) == IDENTIFIER_NODE && \ ! 554: IDENTIFIER_POINTER (DECL_NAME (exp)) && \ ! 555: !strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "_OBJC_", 6)) \ ! 556: { \ ! 557: const char *name = IDENTIFIER_POINTER (DECL_NAME (exp)); \ ! 558: \ ! 559: if (!strncmp (name, "_OBJC_CLASS_METHODS_", 20)) \ ! 560: objc_cls_meth_section (); \ ! 561: else if (!strncmp (name, "_OBJC_INSTANCE_METHODS_", 23)) \ ! 562: objc_inst_meth_section (); \ ! 563: else if (!strncmp (name, "_OBJC_CATEGORY_CLASS_METHODS_", 20)) \ ! 564: objc_cat_cls_meth_section (); \ ! 565: else if (!strncmp (name, "_OBJC_CATEGORY_INSTANCE_METHODS_", 23)) \ ! 566: objc_cat_inst_meth_section (); \ ! 567: else if (!strncmp (name, "_OBJC_CLASS_VARIABLES_", 22)) \ ! 568: objc_class_vars_section (); \ ! 569: else if (!strncmp (name, "_OBJC_INSTANCE_VARIABLES_", 25)) \ ! 570: objc_instance_vars_section (); \ ! 571: else if (!strncmp (name, "_OBJC_CLASS_PROTOCOLS_", 22)) \ ! 572: objc_cat_cls_meth_section (); \ ! 573: else if (!strncmp (name, "_OBJC_CLASS_NAME_", 17)) \ ! 574: objc_class_names_section (); \ ! 575: else if (!strncmp (name, "_OBJC_METH_VAR_NAME_", 20)) \ ! 576: objc_meth_var_names_section (); \ ! 577: else if (!strncmp (name, "_OBJC_METH_VAR_TYPE_", 20)) \ ! 578: objc_meth_var_types_section (); \ ! 579: else if (!strncmp (name, "_OBJC_CLASS_REFERENCES", 22)) \ ! 580: objc_cls_refs_section (); \ ! 581: else if (!strncmp (name, "_OBJC_CLASS_", 12)) \ ! 582: objc_class_section (); \ ! 583: else if (!strncmp (name, "_OBJC_METACLASS_", 16)) \ ! 584: objc_meta_class_section (); \ ! 585: else if (!strncmp (name, "_OBJC_CATEGORY_", 15)) \ ! 586: objc_category_section (); \ ! 587: else if (!strncmp (name, "_OBJC_SELECTOR_REFERENCES", 25)) \ ! 588: objc_selector_refs_section (); \ ! 589: else if (!strncmp (name, "_OBJC_SYMBOLS", 13)) \ ! 590: objc_symbols_section (); \ ! 591: else if (!strncmp (name, "_OBJC_MODULES", 13)) \ ! 592: objc_module_info_section (); \ ! 593: else if (!strncmp (name, "_OBJC_PROTOCOL_INSTANCE_METHODS_", 32)) \ ! 594: objc_cat_inst_meth_section (); \ ! 595: else if (!strncmp (name, "_OBJC_PROTOCOL_CLASS_METHODS_", 29)) \ ! 596: objc_cat_cls_meth_section (); \ ! 597: else if (!strncmp (name, "_OBJC_PROTOCOL_REFS_", 20)) \ ! 598: objc_cat_cls_meth_section (); \ ! 599: else if (!strncmp (name, "_OBJC_PROTOCOL_", 15)) \ ! 600: objc_protocol_section (); \ ! 601: else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \ ! 602: && !TREE_SIDE_EFFECTS (exp)) \ ! 603: readonly_data_section (); \ ! 604: else \ ! 605: data_section (); \ ! 606: } \ ! 607: else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \ ! 608: && !TREE_SIDE_EFFECTS (exp)) \ ! 609: readonly_data_section (); \ ! 610: else \ ! 611: data_section (); \ ! 612: } \ ! 613: while (0) ! 614: ! 615: #undef SELECT_RTX_SECTION ! 616: #define SELECT_RTX_SECTION(mode, rtx) \ ! 617: do \ ! 618: { \ ! 619: if (GET_MODE_SIZE(mode) == 8) \ ! 620: literal8_section(); \ ! 621: else if (GET_MODE_SIZE(mode) == 4) \ ! 622: literal4_section(); \ ! 623: else \ ! 624: const_section (); \ ! 625: } \ ! 626: while (0) ! 627: ! 628: ! 629: #define LINK_COMMAND_SPEC "\ ! 630: %{!fsyntax-only: \ ! 631: %{!c:%{!M:%{!MM:%{!E:%{!precomp:%{!S:%{ObjC++|.C|.M|.cc:ld++}%:{ld} %l %X \ ! 632: -arch %T %{@:-arch_multiple} \ ! 633: %{force_cpusubtype_ALL}\ ! 634: %{@:-o %f%g-%T.out}%{!@:%{o}} \ ! 635: -NEXTSTEP-deployment-target 3.%{k:3}%:{2} \ ! 636: %{A} %{d} %{e*} \ ! 637: %{m} %{N} %{n} \ ! 638: %{p} \ ! 639: %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z} %{y*} \ ! 640: %{!A:%{!nostartfiles:%{!nostdlib:%S}}} %{static:}\ ! 641: %{L*} %D %o \ ! 642: %{!nostdlib: %L %{!A:%E}}\n }}}}}}}" ! 643: ! 644: ! 645: #define DECLARE_UNRESOLVED_REFERENCE(NAME) \ ! 646: do { extern FILE* asm_out_file; \ ! 647: if (flag_pic) fprintf (asm_out_file, "\t.lazy_reference "); \ ! 648: else fprintf (asm_out_file, "\t.reference "); \ ! 649: assemble_name (asm_out_file, NAME); \ ! 650: fprintf (asm_out_file, "\n"); \ ! 651: } while (0) ! 652: ! 653: ! 654: #define DECLARE_CLASS_REFERENCE(NAME) \ ! 655: do { extern FILE* asm_out_file; fprintf (asm_out_file, "\t"); \ ! 656: assemble_name (asm_out_file, NAME); \ ! 657: fprintf (asm_out_file, "=0\n"); \ ! 658: assemble_global (NAME); \ ! 659: } while (0) ! 660: ! 661: #define GO_IF_CPLUSPLUS_INCLUDE_NAME(NAME,LABEL) \ ! 662: do { char *_p = (NAME); \ ! 663: _next: switch (*_p) { case 0: break; \ ! 664: case 'c': case 'C': case 'G': case 'g': \ ! 665: if (_p[1] == '+' && _p[2] == '+') goto LABEL; break; \ ! 666: default: _p += 1; goto _next; }} while (0) ! 667: ! 668: #undef ASM_GLOBALIZE_LABEL ! 669: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \ ! 670: do { const char* _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \ ! 671: (fputs (".globl ", FILE), assemble_name (FILE, _x), fputs ("\n", FILE)); \ ! 672: }} while (0) ! 673: ! 674: #ifdef NEXT_LIBGCC_NAMES ! 675: #include "nextstep.def" ! 676: #endif ! 677: ! 678: #ifndef JUMP_TABLES_IN_TEXT_SECTION ! 679: #define JUMP_TABLES_IN_TEXT_SECTION 1 ! 680: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.