2000-05-02 Jeff Sturm <jsturm@one-point.com>
[official-gcc.git] / gcc / config / nextstep.h
blob76e1a3505a6ef0da2f20b6af0541495ee6cecbb6
1 /* Operating system specific defines to be used when targeting GCC
2 for NeXTSTEP.
3 Copyright (C) 1989, 1990, 1991, 1992, 1993, 1996, 1997,
4 1999 Free Software Foundation, Inc.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* Use new NeXT include file search path.
24 In a cross compiler with NeXT as target, don't expect
25 the host to use Next's directory scheme. */
27 #ifndef CROSS_COMPILE
28 #undef INCLUDE_DEFAULTS
29 #define INCLUDE_DEFAULTS \
30 { \
31 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
32 { LOCAL_INCLUDE_DIR, 0, 0, 1 }, \
33 { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \
34 { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
35 /* These are for fixincludes-fixed ansi/bsd headers \
36 which wouldn't be found otherwise. \
37 (The use of string catenation here is OK since \
38 NeXT's native compiler is derived from GCC.) */ \
39 { GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
40 { GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
41 { "/NextDeveloper/Headers", 0, 0, 0 }, \
42 { "/NextDeveloper/Headers/ansi", 0, 0, 0 }, \
43 { "/NextDeveloper/Headers/bsd", 0, 0, 0 }, \
44 { "/LocalDeveloper/Headers", 0, 0, 0 }, \
45 { "/LocalDeveloper/Headers/ansi", 0, 0, 0 }, \
46 { "/LocalDeveloper/Headers/bsd", 0, 0, 0 }, \
47 { "/NextDeveloper/2.0CompatibleHeaders", 0, 0, 0 }, \
48 { STANDARD_INCLUDE_DIR, 0, 0, 0 }, \
49 { "/usr/include/bsd", 0, 0, 0 }, \
50 { 0, 0, 0, 0 } \
52 #else /* CROSS_COMPILE */
53 #undef INCLUDE_DEFAULTS
54 #define INCLUDE_DEFAULTS \
55 { \
56 { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
57 { GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 }, \
58 { LOCAL_INCLUDE_DIR, 0, 0, 1 }, \
59 { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
60 { GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
61 { GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
62 { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \
63 { TOOL_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
64 { TOOL_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
65 { STANDARD_INCLUDE_DIR, 0, 0, 0 }, \
66 { "/usr/include/bsd", 0, 0, 0 }, \
67 { 0, 0, 0, 0 } \
69 #endif /* CROSS_COMPILE */
71 #undef EXTRA_FORMAT_FUNCTIONS
72 #define EXTRA_FORMAT_FUNCTIONS \
73 "NXPrintf", FALSE, 2, FALSE, \
74 "NXScanf", TRUE, 2, FALSE, \
75 "NXVPrintf", FALSE, 2, TRUE, \
76 "NXVScanf", TRUE, 2, TRUE, \
77 "DPSPrintf", FALSE, 2, FALSE, \
78 "bsd_sprintf", FALSE, 2, FALSE, \
79 "bsd_vsprintf", FALSE, 2, TRUE,
81 /* Make -fnext-runtime the default. */
83 #define NEXT_OBJC_RUNTIME
85 /* Enable recent gcc to compile under the old gcc in Next release 1.0. */
87 #define __inline inline
89 /* wchar_t is unsigned short */
91 #undef WCHAR_TYPE
92 #define WCHAR_TYPE "short unsigned int"
93 #undef WCHAR_TYPE_SIZE
94 #define WCHAR_TYPE_SIZE (BITS_PER_WORD / 2)
96 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
97 we want to retain compatibility with older gcc versions. */
99 #undef DEFAULT_PCC_STRUCT_RETURN
100 #define DEFAULT_PCC_STRUCT_RETURN 0
102 /* These compiler options take n arguments. */
104 #undef WORD_SWITCH_TAKES_ARG
105 #define WORD_SWITCH_TAKES_ARG(STR) \
106 (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) ? 1 : \
107 !strcmp (STR, "segalign") ? 1 : \
108 !strcmp (STR, "seg1addr") ? 1 : \
109 !strcmp (STR, "segaddr") ? 2 : \
110 !strcmp (STR, "sectobjectsymbols") ? 2 : \
111 !strcmp (STR, "segprot") ? 3 : \
112 !strcmp (STR, "sectcreate") ? 3 : \
113 !strcmp (STR, "sectalign") ? 3 : \
114 !strcmp (STR, "segcreate") ? 3 : \
115 !strcmp (STR, "sectorder") ? 3 : \
116 !strcmp (STR, "siff-mask") ? 1 : \
117 !strcmp (STR, "siff-filter") ? 1 : \
118 !strcmp (STR, "siff-warning") ? 1 : \
119 !strcmp (STR, "arch") ? 1 : \
120 !strcmp (STR, "pagezero_size") ? 1 : \
123 #undef WORD_SWITCH
124 #define WORD_SWITCH(STR) \
125 (WORD_SWITCH_TAKES_ARG (STR) \
126 || !strcmp (STR, "bsd") \
127 || !strcmp (STR, "object") \
128 || !strcmp (STR, "ObjC") \
129 || !strcmp (STR, "all_load"))
131 /* Machine dependent ccp options. */
133 #undef CPP_SPEC
134 #define CPP_SPEC "%{!traditional: -D__STDC__} \
135 %{posixstrict:-D_POSIX_SOURCE} \
136 %{!posixstrict:%{bsd:-D__STRICT_BSD__} \
137 %{posix:-D_POSIX_SOURCE} \
138 %{!ansi:-D_NEXT_SOURCE}} \
139 %{MD:-MD %M} %{MMD:-MMD %M}"
141 /* Machine dependent ld options. */
143 #undef LINK_SPEC
144 #define LINK_SPEC "%{Z} %{M} \
145 %{execute*} %{preload*} %{fvmlib*} \
146 %{segalign*} %{seg1addr*} %{segaddr*} %{segprot*} \
147 %{pagezero_size*} \
148 %{seglinkedit*} %{noseglinkedit*} \
149 %{sectcreate*} %{sectalign*} %{sectobjectsymbols}\
150 %{segcreate*} %{Mach*} %{whyload} %{w} \
151 %{sectorder*} %{whatsloaded} %{ObjC} %{all_load} %{object}"
153 /* Machine dependent libraries. */
155 #undef LIB_SPEC
156 #define LIB_SPEC "%{!posix*:-lsys_s} %{posix*:-lposix}"
158 /* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
160 #undef STARTFILE_SPEC
161 #define STARTFILE_SPEC \
162 "%{!posix*:%{pg:-lgcrt0.o}%{!pg: \
163 %{p:%e-p profiling is no longer supported. Use -pg instead.} \
164 %{!p:-lcrt0.o}}}\
165 %{posix*:%{pg:-lgposixcrt0.o}%{!pg: \
166 %{p:%e-p profiling is no longer supported. Use -pg instead.} \
167 %{!p:-lposixcrt0.o}}} \
168 -lcrtbegin.o"
170 #undef ENDFILE_SPEC
171 #define ENDFILE_SPEC \
172 "-lcrtend.o"
174 /* Allow #sscs (but don't do anything). */
176 #define SCCS_DIRECTIVE
178 /* We use Dbx symbol format. */
180 #undef SDB_DEBUGGING_INFO
181 #undef XCOFF_DEBUGGING_INFO
182 #define DBX_DEBUGGING_INFO
184 /* This saves a fair amount of space. */
186 #undef DBX_CONTIN_LENGTH
187 #define DBX_CONTIN_LENGTH 0
189 /* These screw up NeXT's gdb at the moment, so don't use them. */
191 #undef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY
192 #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(FILE, FILENAME)
194 /* These come from bsd386.h, but are specific to sequent, so make sure
195 they don't bite us. */
197 #undef DBX_NO_XREFS
198 #undef DBX_CONTIN_LENGTH
200 /* gdb needs a null N_SO at the end of each file for scattered loading. */
202 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
203 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
204 fprintf (FILE, \
205 "\t.text\n\t.stabs \"%s\",%d,0,0,Letext\nLetext:\n", \
206 "" , N_SO)
208 /* Define our object format type for crtstuff.c */
209 #define OBJECT_FORMAT_MACHO
211 #undef INIT_SECTION_ASM_OP
212 #define INIT_SECTION_ASM_OP
213 #undef INVOKE__main
215 #undef ASM_OUTPUT_CONSTRUCTOR
216 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
217 do { constructor_section (); \
218 ASM_OUTPUT_ALIGN (FILE, 1); \
219 fprintf (FILE, "\t.long "); \
220 assemble_name (FILE, NAME); \
221 fprintf (FILE, "\n"); \
222 fprintf (FILE, ".reference .constructors_used\n"); \
223 } while (0)
225 #undef ASM_OUTPUT_DESTRUCTOR
226 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
227 do { destructor_section (); \
228 ASM_OUTPUT_ALIGN (FILE, 1); \
229 fprintf (FILE, "\t.long "); \
230 assemble_name (FILE, NAME); \
231 fprintf (FILE, "\n"); \
232 fprintf (FILE, ".reference .destructors_used\n"); \
233 } while (0)
235 #define EH_FRAME_SECTION_ASM_OP "\t.section __TEXT,__eh_frame,regular"
237 /* Don't output a .file directive. That is only used by the assembler for
238 error reporting. */
239 #undef ASM_FILE_START
240 #define ASM_FILE_START(FILE)
242 #undef ASM_FILE_END
243 #define ASM_FILE_END(FILE) \
244 do { \
245 if (strcmp (language_string, "GNU C++") == 0) \
247 constructor_section (); \
248 destructor_section (); \
249 ASM_OUTPUT_ALIGN (FILE, 1); \
251 } while (0)
253 /* How to parse #pragma's */
255 #undef HANDLE_PRAGMA
256 #define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
257 extern int handle_pragma PARAMS ((int(*)(void), void (*)(int), const char *));
259 /* Give methods pretty symbol names on NeXT. */
261 #undef OBJC_GEN_METHOD_LABEL
262 #define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \
263 do { if (CAT_NAME) \
264 sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+', \
265 (CLASS_NAME), (CAT_NAME), (SEL_NAME)); \
266 else \
267 sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+', \
268 (CLASS_NAME), (SEL_NAME)); \
269 } while (0)
271 /* The prefix to add to user-visible assembler symbols. */
273 #undef USER_LABEL_PREFIX
274 #define USER_LABEL_PREFIX "_"
276 /* Wrap new method names in quotes so the assembler doesn't gag.
277 Make Objective-C internal symbols local. */
279 #undef ASM_OUTPUT_LABELREF
280 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
281 do { if (NAME[0] == '+' || NAME[0] == '-') fprintf (FILE, "\"%s\"", NAME); \
282 else if (!strncmp (NAME, "_OBJC_", 6)) fprintf (FILE, "L%s", NAME); \
283 else if (!strncmp (NAME, ".objc_class_name_", 17)) \
284 fprintf (FILE, "%s", NAME); \
285 else asm_fprintf (FILE, "%U%s", NAME); } while (0)
287 #undef ALIGN_ASM_OP
288 #define ALIGN_ASM_OP "\t.align\t"
290 #undef ASM_OUTPUT_ALIGN
291 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
292 if ((LOG) != 0) \
293 fprintf (FILE, "%s%d\n", ALIGN_ASM_OP, (LOG))
295 /* Ensure correct alignment of bss data. */
297 #undef ASM_OUTPUT_ALIGNED_LOCAL
298 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
299 ( fputs (".lcomm ", (FILE)), \
300 assemble_name ((FILE), (NAME)), \
301 fprintf ((FILE), ",%u,%u\n", (SIZE), floor_log2 ((ALIGN) / BITS_PER_UNIT)))
303 /* Output #ident as a .ident. */
305 #undef ASM_OUTPUT_IDENT
306 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
308 /* The maximum alignment which the object file format can support.
309 For NeXT's Mach-O format, this is 2^15. */
311 #undef MAX_OFILE_ALIGNMENT
312 #define MAX_OFILE_ALIGNMENT 0x8000
314 /* Create new Mach-O sections. */
316 #undef SECTION_FUNCTION
317 #define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, WAS_TEXT, OBJC) \
318 extern void FUNCTION PARAMS ((void)); \
319 void \
320 FUNCTION () \
322 extern int flag_no_mach_text_sections; \
324 if (WAS_TEXT && flag_no_mach_text_sections) \
325 text_section (); \
326 else if (in_section != SECTION) \
328 if (OBJC) \
329 objc_section_init (); \
330 fprintf (asm_out_file, "%s\n", DIRECTIVE); \
331 in_section = SECTION; \
335 #undef EXTRA_SECTIONS
336 #define EXTRA_SECTIONS \
337 in_const, in_cstring, in_literal4, in_literal8, \
338 in_constructor, in_destructor, \
339 in_objc_class, in_objc_meta_class, in_objc_category, \
340 in_objc_class_vars, in_objc_instance_vars, \
341 in_objc_cls_meth, in_objc_inst_meth, \
342 in_objc_cat_cls_meth, in_objc_cat_inst_meth, \
343 in_objc_selector_refs, \
344 in_objc_symbols, in_objc_module_info, \
345 in_objc_protocol, in_objc_string_object, \
346 in_objc_class_names, in_objc_meth_var_names, \
347 in_objc_meth_var_types, in_objc_cls_refs
349 #undef EXTRA_SECTION_FUNCTIONS
350 #define EXTRA_SECTION_FUNCTIONS \
351 extern void objc_section_init PARAMS ((void)); \
352 SECTION_FUNCTION (const_section, \
353 in_const, \
354 ".const", 1, 0) \
355 SECTION_FUNCTION (cstring_section, \
356 in_cstring, \
357 ".cstring", 1, 0) \
358 SECTION_FUNCTION (literal4_section, \
359 in_literal4, \
360 ".literal4", 1, 0) \
361 SECTION_FUNCTION (literal8_section, \
362 in_literal8, \
363 ".literal8", 1, 0) \
364 SECTION_FUNCTION (constructor_section, \
365 in_constructor, \
366 ".constructor", 0, 0) \
367 SECTION_FUNCTION (destructor_section, \
368 in_destructor, \
369 ".destructor", 0, 0) \
370 SECTION_FUNCTION (objc_class_section, \
371 in_objc_class, \
372 ".objc_class", 0, 1) \
373 SECTION_FUNCTION (objc_meta_class_section, \
374 in_objc_meta_class, \
375 ".objc_meta_class", 0, 1) \
376 SECTION_FUNCTION (objc_category_section, \
377 in_objc_category, \
378 ".objc_category", 0, 1) \
379 SECTION_FUNCTION (objc_class_vars_section, \
380 in_objc_class_vars, \
381 ".objc_class_vars", 0, 1) \
382 SECTION_FUNCTION (objc_instance_vars_section, \
383 in_objc_instance_vars, \
384 ".objc_instance_vars", 0, 1) \
385 SECTION_FUNCTION (objc_cls_meth_section, \
386 in_objc_cls_meth, \
387 ".objc_cls_meth", 0, 1) \
388 SECTION_FUNCTION (objc_inst_meth_section, \
389 in_objc_inst_meth, \
390 ".objc_inst_meth", 0, 1) \
391 SECTION_FUNCTION (objc_cat_cls_meth_section, \
392 in_objc_cat_cls_meth, \
393 ".objc_cat_cls_meth", 0, 1) \
394 SECTION_FUNCTION (objc_cat_inst_meth_section, \
395 in_objc_cat_inst_meth, \
396 ".objc_cat_inst_meth", 0, 1) \
397 SECTION_FUNCTION (objc_selector_refs_section, \
398 in_objc_selector_refs, \
399 ".objc_message_refs", 0, 1) \
400 SECTION_FUNCTION (objc_symbols_section, \
401 in_objc_symbols, \
402 ".objc_symbols", 0, 1) \
403 SECTION_FUNCTION (objc_module_info_section, \
404 in_objc_module_info, \
405 ".objc_module_info", 0, 1) \
406 SECTION_FUNCTION (objc_protocol_section, \
407 in_objc_protocol, \
408 ".objc_protocol", 0, 1) \
409 SECTION_FUNCTION (objc_string_object_section, \
410 in_objc_string_object, \
411 ".objc_string_object", 0, 1) \
412 SECTION_FUNCTION (objc_class_names_section, \
413 in_objc_class_names, \
414 ".objc_class_names", 0, 1) \
415 SECTION_FUNCTION (objc_meth_var_names_section, \
416 in_objc_meth_var_names, \
417 ".objc_meth_var_names", 0, 1) \
418 SECTION_FUNCTION (objc_meth_var_types_section, \
419 in_objc_meth_var_types, \
420 ".objc_meth_var_types", 0, 1) \
421 SECTION_FUNCTION (objc_cls_refs_section, \
422 in_objc_cls_refs, \
423 ".objc_cls_refs", 0, 1) \
425 void \
426 objc_section_init () \
428 static int been_here = 0; \
430 if (been_here == 0) \
432 been_here = 1; \
433 objc_class_section (); \
434 objc_meta_class_section (); \
435 objc_cat_cls_meth_section (); \
436 objc_cat_inst_meth_section (); \
437 objc_cls_meth_section (); \
438 objc_inst_meth_section (); \
439 objc_selector_refs_section (); \
440 objc_symbols_section (); \
441 objc_category_section (); \
442 objc_protocol_section (); \
443 objc_class_vars_section (); \
444 objc_instance_vars_section (); \
445 objc_module_info_section (); \
446 objc_string_object_section (); \
447 objc_class_names_section (); \
448 objc_meth_var_names_section (); \
449 objc_meth_var_types_section (); \
450 objc_cls_refs_section (); \
454 #undef READONLY_DATA_SECTION
455 #define READONLY_DATA_SECTION const_section
457 #undef SELECT_SECTION
458 #define SELECT_SECTION(exp,reloc) \
459 do \
461 if (TREE_CODE (exp) == STRING_CST) \
463 if (flag_writable_strings) \
464 data_section (); \
465 else if (TREE_STRING_LENGTH (exp) != \
466 strlen (TREE_STRING_POINTER (exp)) + 1) \
467 readonly_data_section (); \
468 else \
469 cstring_section (); \
471 else if (TREE_CODE (exp) == INTEGER_CST \
472 || TREE_CODE (exp) == REAL_CST) \
474 tree size = TYPE_SIZE (TREE_TYPE (exp)); \
476 if (TREE_CODE (size) == INTEGER_CST && \
477 TREE_INT_CST_LOW (size) == 4 && \
478 TREE_INT_CST_HIGH (size) == 0) \
479 literal4_section (); \
480 else if (TREE_CODE (size) == INTEGER_CST && \
481 TREE_INT_CST_LOW (size) == 8 && \
482 TREE_INT_CST_HIGH (size) == 0) \
483 literal8_section (); \
484 else \
485 readonly_data_section (); \
487 else if (TREE_CODE (exp) == CONSTRUCTOR \
488 && TREE_TYPE (exp) \
489 && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE \
490 && TYPE_NAME (TREE_TYPE (exp)) \
491 && TREE_CODE (TYPE_NAME (TREE_TYPE (exp))) == IDENTIFIER_NODE \
492 && IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (exp)))) \
494 if (!strcmp (IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (exp))), \
495 "NXConstantString")) \
496 objc_string_object_section (); \
497 else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \
498 && !TREE_SIDE_EFFECTS (exp)) \
499 readonly_data_section (); \
500 else \
501 data_section (); \
503 else if (TREE_CODE (exp) == VAR_DECL && \
504 DECL_NAME (exp) && \
505 TREE_CODE (DECL_NAME (exp)) == IDENTIFIER_NODE && \
506 IDENTIFIER_POINTER (DECL_NAME (exp)) && \
507 !strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "_OBJC_", 6)) \
509 const char *name = IDENTIFIER_POINTER (DECL_NAME (exp)); \
511 if (!strncmp (name, "_OBJC_CLASS_METHODS_", 20)) \
512 objc_cls_meth_section (); \
513 else if (!strncmp (name, "_OBJC_INSTANCE_METHODS_", 23)) \
514 objc_inst_meth_section (); \
515 else if (!strncmp (name, "_OBJC_CATEGORY_CLASS_METHODS_", 20)) \
516 objc_cat_cls_meth_section (); \
517 else if (!strncmp (name, "_OBJC_CATEGORY_INSTANCE_METHODS_", 23)) \
518 objc_cat_inst_meth_section (); \
519 else if (!strncmp (name, "_OBJC_CLASS_VARIABLES_", 22)) \
520 objc_class_vars_section (); \
521 else if (!strncmp (name, "_OBJC_INSTANCE_VARIABLES_", 25)) \
522 objc_instance_vars_section (); \
523 else if (!strncmp (name, "_OBJC_CLASS_PROTOCOLS_", 22)) \
524 objc_cat_cls_meth_section (); \
525 else if (!strncmp (name, "_OBJC_CLASS_NAME_", 17)) \
526 objc_class_names_section (); \
527 else if (!strncmp (name, "_OBJC_METH_VAR_NAME_", 20)) \
528 objc_meth_var_names_section (); \
529 else if (!strncmp (name, "_OBJC_METH_VAR_TYPE_", 20)) \
530 objc_meth_var_types_section (); \
531 else if (!strncmp (name, "_OBJC_CLASS_REFERENCES", 22)) \
532 objc_cls_refs_section (); \
533 else if (!strncmp (name, "_OBJC_CLASS_", 12)) \
534 objc_class_section (); \
535 else if (!strncmp (name, "_OBJC_METACLASS_", 16)) \
536 objc_meta_class_section (); \
537 else if (!strncmp (name, "_OBJC_CATEGORY_", 15)) \
538 objc_category_section (); \
539 else if (!strncmp (name, "_OBJC_SELECTOR_REFERENCES", 25)) \
540 objc_selector_refs_section (); \
541 else if (!strncmp (name, "_OBJC_SYMBOLS", 13)) \
542 objc_symbols_section (); \
543 else if (!strncmp (name, "_OBJC_MODULES", 13)) \
544 objc_module_info_section (); \
545 else if (!strncmp (name, "_OBJC_PROTOCOL_INSTANCE_METHODS_", 32)) \
546 objc_cat_inst_meth_section (); \
547 else if (!strncmp (name, "_OBJC_PROTOCOL_CLASS_METHODS_", 29)) \
548 objc_cat_cls_meth_section (); \
549 else if (!strncmp (name, "_OBJC_PROTOCOL_REFS_", 20)) \
550 objc_cat_cls_meth_section (); \
551 else if (!strncmp (name, "_OBJC_PROTOCOL_", 15)) \
552 objc_protocol_section (); \
553 else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \
554 && !TREE_SIDE_EFFECTS (exp)) \
555 readonly_data_section (); \
556 else \
557 data_section (); \
559 else if (TREE_CODE (exp) == VAR_DECL) \
561 if ((flag_pic && reloc) \
562 || !TREE_READONLY (exp) || TREE_SIDE_EFFECTS (exp) \
563 || !DECL_INITIAL (exp) \
564 || (DECL_INITIAL (exp) != error_mark_node \
565 && !TREE_CONSTANT (DECL_INITIAL (exp)))) \
566 data_section (); \
567 else \
568 readonly_data_section (); \
570 else \
571 readonly_data_section (); \
573 while (0)
575 #undef SELECT_RTX_SECTION
576 #define SELECT_RTX_SECTION(mode, rtx) \
577 do \
579 if (GET_MODE_SIZE(mode) == 8) \
580 literal8_section(); \
581 else if (GET_MODE_SIZE(mode) == 4) \
582 literal4_section(); \
583 else \
584 const_section (); \
586 while (0)
588 #ifdef ASM_COMMENT_START
589 # undef ASM_COMMENT_START
590 #endif
592 #define ASM_COMMENT_START ";#"