]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/rs6000/aix.h
rs6000.h (EXCEPTION_SECTION): Move to...
[thirdparty/gcc.git] / gcc / config / rs6000 / aix.h
1 /* Definitions of target machine for GNU compiler,
2 for IBM RS/6000 POWER running AIX.
3 Copyright (C) 2000, 2001 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, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 /* Yes! We are AIX! */
23 #define DEFAULT_ABI ABI_AIX
24 #define TARGET_OBJECT_FORMAT OBJECT_XCOFF
25
26 /* The AIX linker will discard static constructors in object files before
27 collect has a chance to see them, so scan the object files directly. */
28 #define COLLECT_EXPORT_LIST
29
30 /* The RS/6000 uses the XCOFF format. */
31 #define XCOFF_DEBUGGING_INFO
32
33 /* Define if the object format being used is COFF or a superset. */
34 #define OBJECT_FORMAT_COFF
35
36 /* Define the magic numbers that we recognize as COFF.
37
38 AIX 4.3 adds U803XTOCMAGIC (0757) for 64-bit objects and AIX V5 adds
39 U64_TOCMAGIC (0767), but collect2.c does not include files in the
40 correct order to conditionally define the symbolic name in this macro.
41
42 The AIX linker accepts import/export files as object files,
43 so accept "#!" (0x2321) magic number. */
44 #define MY_ISCOFF(magic) \
45 ((magic) == U802WRMAGIC || (magic) == U802ROMAGIC \
46 || (magic) == U802TOCMAGIC || (magic) == 0757 || (magic) == 0767 \
47 || (magic) == 0x2321)
48
49 /* This is the only version of nm that collect2 can work with. */
50 #define REAL_NM_FILE_NAME "/usr/ucb/nm"
51
52 /* We don't have GAS for the RS/6000 yet, so don't write out special
53 .stabs in cc1plus. */
54
55 #define FASCIST_ASSEMBLER
56
57 /* We define this to prevent the name mangler from putting dollar signs into
58 function names. */
59
60 #define NO_DOLLAR_IN_LABEL
61
62 /* We define this to 0 so that gcc will never accept a dollar sign in a
63 variable name. This is needed because the AIX assembler will not accept
64 dollar signs. */
65
66 #define DOLLARS_IN_IDENTIFIERS 0
67
68 /* AIX does not have any init/fini or ctor/dtor sections, so create
69 static constructors and destructors as normal functions. */
70 /* #define ASM_OUTPUT_CONSTRUCTOR(file, name) */
71 /* #define ASM_OUTPUT_DESTRUCTOR(file, name) */
72
73 /* The prefix to add to user-visible assembler symbols. */
74 #define USER_LABEL_PREFIX "."
75
76 /* Don't turn -B into -L if the argument specifies a relative file name. */
77 #define RELATIVE_PREFIX_NOT_LINKDIR
78
79 /* Because of the above, we must have gcc search itself to find libgcc.a. */
80 #define LINK_LIBGCC_SPECIAL_1
81
82 /* Names to predefine in the preprocessor for this target machine. */
83 #define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_LONG_LONG \
84 -Asystem=unix -Asystem=aix -Acpu=rs6000 -Amachine=rs6000"
85
86 /* Define appropriate architecture macros for preprocessor depending on
87 target switches. */
88
89 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
90 %{ansi: -D_ANSI_C_SOURCE}\
91 %(cpp_cpu)"
92
93 /* Tell the assembler to assume that all undefined names are external.
94
95 Don't do this until the fixed IBM assembler is more generally available.
96 When this becomes permanently defined, the ASM_OUTPUT_EXTERNAL,
97 ASM_OUTPUT_EXTERNAL_LIBCALL, and RS6000_OUTPUT_BASENAME macros will no
98 longer be needed. Also, the extern declaration of mcount in ASM_FILE_START
99 will no longer be needed. */
100
101 /* #define ASM_SPEC "-u %(asm_cpu)" */
102
103 /* Default location of syscalls.exp under AIX */
104 #ifndef CROSS_COMPILE
105 #define LINK_SYSCALLS_SPEC "-bI:/lib/syscalls.exp"
106 #else
107 #define LINK_SYSCALLS_SPEC ""
108 #endif
109
110 /* Default location of libg.exp under AIX */
111 #ifndef CROSS_COMPILE
112 #define LINK_LIBG_SPEC "-bexport:/usr/lib/libg.exp"
113 #else
114 #define LINK_LIBG_SPEC ""
115 #endif
116
117 /* Define the options for the binder: Start text at 512, align all segments
118 to 512 bytes, and warn if there is text relocation.
119
120 The -bhalt:4 option supposedly changes the level at which ld will abort,
121 but it also suppresses warnings about multiply defined symbols and is
122 used by the AIX cc command. So we use it here.
123
124 -bnodelcsect undoes a poor choice of default relating to multiply-defined
125 csects. See AIX documentation for more information about this.
126
127 -bM:SRE tells the linker that the output file is Shared REusable. Note
128 that to actually build a shared library you will also need to specify an
129 export list with the -Wl,-bE option. */
130
131 #define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
132 %{static:-bnso %(link_syscalls) } \
133 %{!shared:%{g*: %(link_libg) }} %{shared:-bM:SRE}"
134
135 /* Profiled library versions are used by linking with special directories. */
136 #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
137 %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc"
138
139 /* Define the extra sections we need. We define three: one is the read-only
140 data section which is used for constants. This is a csect whose name is
141 derived from the name of the input file. The second is for initialized
142 global variables. This is a csect whose name is that of the variable.
143 The third is the TOC. */
144
145 #define EXTRA_SECTIONS \
146 read_only_data, private_data, read_only_private_data, toc, bss
147
148 /* Define the routines to implement these extra sections.
149 BIGGEST_ALIGNMENT is 64, so align the sections that much. */
150
151 #define EXTRA_SECTION_FUNCTIONS \
152 \
153 void \
154 read_only_data_section () \
155 { \
156 if (in_section != read_only_data) \
157 { \
158 fprintf (asm_out_file, "\t.csect %s[RO],3\n", \
159 xcoff_read_only_section_name); \
160 in_section = read_only_data; \
161 } \
162 } \
163 \
164 void \
165 private_data_section () \
166 { \
167 if (in_section != private_data) \
168 { \
169 fprintf (asm_out_file, "\t.csect %s[RW],3\n", \
170 xcoff_private_data_section_name); \
171 in_section = private_data; \
172 } \
173 } \
174 \
175 void \
176 read_only_private_data_section () \
177 { \
178 if (in_section != read_only_private_data) \
179 { \
180 fprintf (asm_out_file, "\t.csect %s[RO],3\n", \
181 xcoff_private_data_section_name); \
182 in_section = read_only_private_data; \
183 } \
184 } \
185 \
186 void \
187 toc_section () \
188 { \
189 if (TARGET_MINIMAL_TOC) \
190 { \
191 /* toc_section is always called at least once from ASM_FILE_START, \
192 so this is guaranteed to always be defined once and only once \
193 in each file. */ \
194 if (! toc_initialized) \
195 { \
196 fputs ("\t.toc\nLCTOC..1:\n", asm_out_file); \
197 fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \
198 toc_initialized = 1; \
199 } \
200 \
201 if (in_section != toc) \
202 fprintf (asm_out_file, "\t.csect toc_table[RW]%s\n", \
203 (TARGET_32BIT ? "" : ",3")); \
204 } \
205 else \
206 { \
207 if (in_section != toc) \
208 fputs ("\t.toc\n", asm_out_file); \
209 } \
210 in_section = toc; \
211 }
212
213 /* Define the name of our readonly data section. */
214
215 #define READONLY_DATA_SECTION read_only_data_section
216
217 /* Select the section for an initialized data object.
218
219 On the RS/6000, we have a special section for all variables except those
220 that are static. */
221
222 #define SELECT_SECTION(EXP,RELOC) \
223 { \
224 if ((TREE_CODE (EXP) == STRING_CST \
225 && ! flag_writable_strings) \
226 || (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'd' \
227 && TREE_READONLY (EXP) && ! TREE_THIS_VOLATILE (EXP) \
228 && DECL_INITIAL (EXP) \
229 && (DECL_INITIAL (EXP) == error_mark_node \
230 || TREE_CONSTANT (DECL_INITIAL (EXP))) \
231 && ! (RELOC))) \
232 { \
233 if (TREE_PUBLIC (EXP)) \
234 read_only_data_section (); \
235 else \
236 read_only_private_data_section (); \
237 } \
238 else \
239 { \
240 if (TREE_PUBLIC (EXP)) \
241 data_section (); \
242 else \
243 private_data_section (); \
244 } \
245 }
246
247 /* Return non-zero if this entry is to be written into the constant
248 pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
249 or a CONST containing one of them. If -mfp-in-toc (the default),
250 we also do this for floating-point constants. We actually can only
251 do this if the FP formats of the target and host machines are the
252 same, but we can't check that since not every file that uses
253 GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when
254 we can write the entry into the TOC and the entry is not larger
255 than a TOC entry. */
256
257 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
258 (TARGET_TOC \
259 && (GET_CODE (X) == SYMBOL_REF \
260 || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
261 && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
262 || GET_CODE (X) == LABEL_REF \
263 || (GET_CODE (X) == CONST_INT \
264 && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
265 || (GET_CODE (X) == CONST_DOUBLE \
266 && (TARGET_POWERPC64 \
267 || TARGET_MINIMAL_TOC \
268 || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
269 && ! TARGET_NO_FP_IN_TOC)))))
270
271 /* Select section for constant in constant pool.
272
273 On RS/6000, all constants are in the private read-only data area.
274 However, if this is being placed in the TOC it must be output as a
275 toc entry. */
276
277 #define SELECT_RTX_SECTION(MODE, X) \
278 { if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE)) \
279 toc_section (); \
280 else \
281 read_only_private_data_section (); \
282 }
283
284 /* If we are referencing a function that is static or is known to be
285 in this file, make the SYMBOL_REF special. We can use this to indicate
286 that we can branch to this function without emitting a no-op after the
287 call. Do not set this flag if the function is weakly defined. */
288
289 #define ENCODE_SECTION_INFO(DECL) \
290 if (TREE_CODE (DECL) == FUNCTION_DECL \
291 && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \
292 && ! DECL_WEAK (DECL)) \
293 SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
294
295 /* Indicate that jump tables go in the text section. */
296
297 #define JUMP_TABLES_IN_TEXT_SECTION 1
298
299 /* Enable AIX XL compiler calling convention breakage compatibility. */
300 #undef TARGET_XL_CALL
301 #define MASK_XL_CALL 0x40000000
302 #define TARGET_XL_CALL (target_flags & MASK_XL_CALL)
303 #undef SUBTARGET_SWITCHES
304 #define SUBTARGET_SWITCHES \
305 {"xl-call", MASK_XL_CALL, \
306 N_("Always pass floating-point arguments in memory") }, \
307 {"no-xl-call", - MASK_XL_CALL, \
308 N_("Don't always pass floating-point arguments in memory") }, \
309 SUBSUBTARGET_SWITCHES
310 #define SUBSUBTARGET_SWITCHES
311
312 /* Define any extra SPECS that the compiler needs to generate. */
313 #undef SUBTARGET_EXTRA_SPECS
314 #define SUBTARGET_EXTRA_SPECS \
315 { "link_syscalls", LINK_SYSCALLS_SPEC }, \
316 { "link_libg", LINK_LIBG_SPEC }
317
318 /* FP save and restore routines. */
319 #define SAVE_FP_PREFIX "._savef"
320 #define SAVE_FP_SUFFIX ""
321 #define RESTORE_FP_PREFIX "._restf"
322 #define RESTORE_FP_SUFFIX ""
323
324 /* Define cutoff for using external functions to save floating point. */
325 #define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) == 62 || (FIRST_REG) == 63)
326
327 /* Function name to call to do profiling. */
328 #define RS6000_MCOUNT ".__mcount"
329
330 /* Function names to call to do floating point truncation. */
331
332 #define RS6000_ITRUNC "__itrunc"
333 #define RS6000_UITRUNC "__uitrunc"
334
335 /* Optabs entries for the int->float routines, using the standard
336 AIX names. */
337 #define INIT_TARGET_OPTABS \
338 do { \
339 if (! TARGET_POWER2 && ! TARGET_POWERPC && TARGET_HARD_FLOAT) \
340 { \
341 fixdfsi_libfunc = init_one_libfunc (RS6000_ITRUNC); \
342 fixunsdfsi_libfunc = init_one_libfunc (RS6000_UITRUNC); \
343 } \
344 } while (0)
345
346 /* AIX always has a TOC. */
347 #define TARGET_NO_TOC 0
348 #define TARGET_TOC 1
349
350 /* AIX allows r13 to be used. */
351 #define FIXED_R13 0
352
353 /* This outputs NAME to FILE up to the first null or '['. */
354
355 #define RS6000_OUTPUT_BASENAME(FILE, NAME) \
356 { \
357 const char *_p; \
358 \
359 STRIP_NAME_ENCODING (_p, (NAME)); \
360 assemble_name ((FILE), _p); \
361 }
362
363 /* This is how to output the definition of a user-level label named NAME,
364 such as the label on a static function or variable NAME. */
365
366 #define ASM_OUTPUT_LABEL(FILE,NAME) \
367 do { RS6000_OUTPUT_BASENAME (FILE, NAME); fputs (":\n", FILE); } while (0)
368
369 /* This is how to output a command to make the user-level label named NAME
370 defined for reference from other files. */
371
372 #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
373 do { fputs ("\t.globl ", FILE); \
374 RS6000_OUTPUT_BASENAME (FILE, NAME); putc ('\n', FILE);} while (0)
375
376 /* Remove any trailing [DS] or the like from the symbol name. */
377
378 #define STRIP_NAME_ENCODING(VAR,NAME) \
379 do \
380 { \
381 const char *_name = (NAME); \
382 size_t _len; \
383 if (*_name == '*') \
384 _name++; \
385 _len = strlen (_name); \
386 if (_name[_len - 1] != ']') \
387 (VAR) = _name; \
388 else \
389 { \
390 char *_new_name = (char *) alloca (_len + 1); \
391 strcpy (_new_name, _name); \
392 _new_name[_len - 4] = '\0'; \
393 (VAR) = _new_name; \
394 } \
395 } \
396 while (0)
397
398 /* Output at beginning of assembler file.
399
400 Initialize the section names for the RS/6000 at this point.
401
402 Specify filename, including full path, to assembler.
403
404 We want to go into the TOC section so at least one .toc will be emitted.
405 Also, in order to output proper .bs/.es pairs, we need at least one static
406 [RW] section emitted.
407
408 Finally, declare mcount when profiling to make the assembler happy. */
409
410 #define ASM_FILE_START(FILE) \
411 { \
412 rs6000_gen_section_name (&xcoff_bss_section_name, \
413 main_input_filename, ".bss_"); \
414 rs6000_gen_section_name (&xcoff_private_data_section_name, \
415 main_input_filename, ".rw_"); \
416 rs6000_gen_section_name (&xcoff_read_only_section_name, \
417 main_input_filename, ".ro_"); \
418 \
419 fprintf (FILE, "\t.file\t\"%s\"\n", main_input_filename); \
420 if (TARGET_64BIT) \
421 fputs ("\t.machine\t\"ppc64\"\n", FILE); \
422 toc_section (); \
423 if (write_symbols != NO_DEBUG) \
424 private_data_section (); \
425 text_section (); \
426 if (profile_flag) \
427 fprintf (FILE, "\t.extern %s\n", RS6000_MCOUNT); \
428 rs6000_file_start (FILE, TARGET_CPU_DEFAULT); \
429 }
430
431 /* Output at end of assembler file.
432
433 On the RS/6000, referencing data should automatically pull in text. */
434
435 #define ASM_FILE_END(FILE) \
436 { \
437 text_section (); \
438 fputs ("_section_.text:\n", FILE); \
439 data_section (); \
440 fputs (TARGET_32BIT \
441 ? "\t.long _section_.text\n" : "\t.llong _section_.text\n", FILE); \
442 }
443
444 /* This macro produces the initial definition of a function name.
445 On the RS/6000, we need to place an extra '.' in the function name and
446 output the function descriptor.
447
448 The csect for the function will have already been created by the
449 `text_section' call previously done. We do have to go back to that
450 csect, however.
451
452 The third and fourth parameters to the .function pseudo-op (16 and 044)
453 are placeholders which no longer have any use. */
454
455 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
456 { if (TREE_PUBLIC (DECL)) \
457 { \
458 fputs ("\t.globl .", FILE); \
459 RS6000_OUTPUT_BASENAME (FILE, NAME); \
460 putc ('\n', FILE); \
461 } \
462 else \
463 { \
464 fputs ("\t.lglobl .", FILE); \
465 RS6000_OUTPUT_BASENAME (FILE, NAME); \
466 putc ('\n', FILE); \
467 } \
468 fputs ("\t.csect ", FILE); \
469 RS6000_OUTPUT_BASENAME (FILE, NAME); \
470 fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \
471 RS6000_OUTPUT_BASENAME (FILE, NAME); \
472 fputs (":\n", FILE); \
473 fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \
474 RS6000_OUTPUT_BASENAME (FILE, NAME); \
475 fputs (", TOC[tc0], 0\n", FILE); \
476 in_section = no_section; \
477 function_section(DECL); \
478 putc ('.', FILE); \
479 RS6000_OUTPUT_BASENAME (FILE, NAME); \
480 fputs (":\n", FILE); \
481 if (write_symbols == XCOFF_DEBUG) \
482 xcoffout_declare_function (FILE, DECL, NAME); \
483 }
484
485 /* Output a reference to SYM on FILE. */
486
487 #define ASM_OUTPUT_SYMBOL_REF(FILE, SYM) \
488 rs6000_output_symbol_ref (FILE, SYM)
489
490 /* This is how to output a reference to a user-level label named NAME.
491 `assemble_name' uses this. */
492
493 #define ASM_OUTPUT_LABELREF(FILE,NAME) \
494 fputs (NAME, FILE)
495
496 /* This says how to output an external. */
497
498 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
499 { rtx _symref = XEXP (DECL_RTL (DECL), 0); \
500 if ((TREE_CODE (DECL) == VAR_DECL \
501 || TREE_CODE (DECL) == FUNCTION_DECL) \
502 && (NAME)[strlen (NAME) - 1] != ']') \
503 { \
504 char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
505 strcpy (_name, XSTR (_symref, 0)); \
506 strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
507 XSTR (_symref, 0) = _name; \
508 } \
509 }
510
511 /* This is how to output an internal numbered label where
512 PREFIX is the class of label and NUM is the number within the class. */
513
514 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
515 fprintf (FILE, "%s..%d:\n", PREFIX, NUM)
516
517 /* This is how to output an internal label prefix. rs6000.c uses this
518 when generating traceback tables. */
519
520 #define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \
521 fprintf (FILE, "%s..", PREFIX)
522
523 /* This is how to output a label for a jump table. Arguments are the same as
524 for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is
525 passed. */
526
527 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
528 { ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
529
530 /* This is how to store into the string LABEL
531 the symbol_ref name of an internal numbered label where
532 PREFIX is the class of label and NUM is the number within the class.
533 This is suitable for output with `assemble_name'. */
534
535 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
536 sprintf (LABEL, "*%s..%ld", (PREFIX), (long)(NUM))
537
538 /* This is how to output an assembler line to define N characters starting
539 at P to FILE. */
540
541 #define ASM_OUTPUT_ASCII(FILE, P, N) output_ascii ((FILE), (P), (N))
542
543 /* This is how to advance the location counter by SIZE bytes. */
544
545 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
546 fprintf (FILE, "\t.space %d\n", (SIZE))
547
548 /* This says how to output an assembler line
549 to define a global common symbol. */
550
551 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGNMENT) \
552 do { fputs (".comm ", (FILE)); \
553 RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
554 if ( (SIZE) > 4) \
555 fprintf ((FILE), ",%d,3\n", (SIZE)); \
556 else \
557 fprintf( (FILE), ",%d\n", (SIZE)); \
558 } while (0)
559
560 /* These are various definitions for DWARF output. They could just
561 use '.long' or '.word', but that aligns to a 4-byte boundary which
562 is not what is required. So we define a million macros... */
563
564 #define UNALIGNED_SHORT_ASM_OP "\t.vbyte\t2,"
565 #define UNALIGNED_INT_ASM_OP "\t.vbyte\t4,"
566 #define UNALIGNED_DOUBLE_INT_ASM_OP "\t.vbyte\t8,"
567
568 /* Output before instructions. */
569 #define TEXT_SECTION_ASM_OP "\t.csect .text[PR]"
570
571 /* Output before writable data.
572 Align entire section to BIGGEST_ALIGNMENT. */
573 #define DATA_SECTION_ASM_OP "\t.csect .data[RW],3"
574
575 /* Define unique section name -- functions only. */
576 #define UNIQUE_SECTION(DECL,RELOC) \
577 do { \
578 int len; \
579 const char *name; \
580 char *string; \
581 \
582 if (TREE_CODE (DECL) == FUNCTION_DECL) { \
583 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
584 len = strlen (name) + 5; \
585 string = alloca (len) + 1; \
586 sprintf (string, ".%s[PR]", name); \
587 DECL_SECTION_NAME (DECL) = build_string (len, string); \
588 } \
589 } while (0)
590
591 #define ASM_OUTPUT_SECTION_NAME(ASM_OUT_FILE,DECL,NAME,RELOC) \
592 do { fputs ("\t.csect ", ASM_OUT_FILE); \
593 fputs (TREE_STRING_POINTER (DECL_SECTION_NAME (DECL)), ASM_OUT_FILE); \
594 putc ('\n', ASM_OUT_FILE); \
595 } while (0)
596
597 /* Define the name of the section to use for the exception tables.
598 TODO: test and see if we can use read_only_data_section, if so,
599 remove this. */
600
601 #define EXCEPTION_SECTION data_section
602
603 /* __throw will restore its own return address to be the same as the
604 return address of the function that the throw is being made to.
605 This is unfortunate, because we want to check the original
606 return address to see if we need to restore the TOC.
607 So we have to squirrel it away with this. */
608 #define SETUP_FRAME_ADDRESSES() rs6000_aix_emit_builtin_unwind_init ()
609
610 #define PROFILE_HOOK(LABEL) output_profile_hook (LABEL)