OSDN Git Service

Move stabs specific target macros out od svr4.h and elfos.h and into dbxelf.h
[pf3gnuchains/gcc-fork.git] / gcc / config / elfos.h
1 /* elfos.h  --  operating system specific defines to be used when
2    targeting GCC for some generic ELF system
3    Copyright (C) 1991, 1994, 1995, 1999 Free Software Foundation, Inc.
4    Based on svr4.h contributed by Ron Guilmette (rfg@netcom.com).
5
6 This file is part of GNU CC.
7
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.
12
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.
17
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.  */
22
23 /* For the sake of libgcc2.c, indicate target supports atexit.  */
24 #define HAVE_ATEXIT
25
26 #undef  ENDFILE_SPEC
27 #define ENDFILE_SPEC "crtend.o%s"
28
29 #undef  STARTFILE_SPEC
30 #define STARTFILE_SPEC "%{!shared: \
31                          %{!symbolic: \
32                           %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
33                         crtbegin.o%s"
34
35 /* Attach a special .ident directive to the end of the file to identify
36    the version of GCC which compiled this code.  The format of the
37    .ident string is patterned after the ones produced by native svr4
38    C compilers.  */
39
40 #define IDENT_ASM_OP ".ident"
41
42 #define ASM_FILE_END(FILE)                                      \
43 do {                                                            \
44      if (!flag_no_ident)                                        \
45         fprintf ((FILE), "\t%s\t\"GCC: (GNU) %s\"\n",           \
46                  IDENT_ASM_OP, version_string);                 \
47    } while (0)
48
49 /* Output #ident as a .ident.  */
50
51 #define ASM_OUTPUT_IDENT(FILE, NAME) \
52   fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
53
54 /* Use periods rather than dollar signs in special g++ assembler names.  */
55
56 #define NO_DOLLAR_IN_LABEL
57
58 /* Writing `int' for a bitfield forces int alignment for the structure.  */
59
60 #define PCC_BITFIELD_TYPE_MATTERS 1
61
62 /* Implicit library calls should use memcpy, not bcopy, etc.  */
63
64 #define TARGET_MEM_FUNCTIONS
65
66 /* Handle #pragma weak and #pragma pack.  */
67
68 #define HANDLE_SYSV_PRAGMA
69
70 /* System V Release 4 uses DWARF debugging info.  */
71
72 #define DWARF_DEBUGGING_INFO
73
74 /* All ELF targets can support DWARF-2.  */
75
76 #define DWARF2_DEBUGGING_INFO
77
78 /* Also allow them to support STABS debugging.  */
79
80 #include "dbxelf.h"
81
82 /* The GNU tools operate better with stabs.  Since we don't have
83    any native tools to be compatible with, default to stabs.  */
84
85 #ifndef PREFERRED_DEBUGGING_TYPE
86 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
87 #endif
88
89 #undef ASM_BYTE_OP
90 #define ASM_BYTE_OP     ".byte"
91
92 #undef SET_ASM_OP
93 #define SET_ASM_OP      ".set"
94
95 /* This is how to begin an assembly language file.  Most svr4 assemblers want
96    at least a .file directive to come first, and some want to see a .version
97    directive come right after that.  Here we just establish a default
98    which generates only the .file directive.  If you need a .version
99    directive for any specific target, you should override this definition
100    in the target-specific file which includes this one.  */
101
102 #undef ASM_FILE_START
103 #define ASM_FILE_START(FILE)                                    \
104   output_file_directive ((FILE), main_input_filename)
105
106 /* This is how to allocate empty space in some section.  The .zero
107    pseudo-op is used for this on most svr4 assemblers.  */
108
109 #define SKIP_ASM_OP     ".zero"
110
111 #undef ASM_OUTPUT_SKIP
112 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
113   fprintf (FILE, "\t%s\t%u\n", SKIP_ASM_OP, (SIZE))
114
115 /* This is how to output a reference to a user-level label named NAME.
116    `assemble_name' uses this.
117
118    For System V Release 4 the convention is *not* to prepend a leading
119    underscore onto user-level symbol names.  */
120
121 #undef ASM_OUTPUT_LABELREF
122 #define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "%s", NAME)
123
124 /* This is how to output an internal numbered label where
125    PREFIX is the class of label and NUM is the number within the class.
126
127    For most svr4 systems, the convention is that any symbol which begins
128    with a period is not put into the linker symbol table by the assembler.  */
129
130 #undef ASM_OUTPUT_INTERNAL_LABEL
131 #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM)                    \
132 do {                                                                    \
133   fprintf (FILE, ".%s%d:\n", PREFIX, NUM);                              \
134 } while (0)
135
136 /* This is how to store into the string LABEL
137    the symbol_ref name of an internal numbered label where
138    PREFIX is the class of label and NUM is the number within the class.
139    This is suitable for output with `assemble_name'.
140
141    For most svr4 systems, the convention is that any symbol which begins
142    with a period is not put into the linker symbol table by the assembler.  */
143
144 #undef ASM_GENERATE_INTERNAL_LABEL
145 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM)                 \
146 do {                                                                    \
147   sprintf (LABEL, "*.%s%d", PREFIX, NUM);                               \
148 } while (0)
149
150 /* Output the label which precedes a jumptable.  Note that for all svr4
151    systems where we actually generate jumptables (which is to say every
152    svr4 target except i386, where we use casesi instead) we put the jump-
153    tables into the .rodata section and since other stuff could have been
154    put into the .rodata section prior to any given jumptable, we have to
155    make sure that the location counter for the .rodata section gets pro-
156    perly re-aligned prior to the actual beginning of the jump table.  */
157
158 #define ALIGN_ASM_OP ".align"
159
160 #ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
161 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
162   ASM_OUTPUT_ALIGN ((FILE), 2);
163 #endif
164
165 #undef ASM_OUTPUT_CASE_LABEL
166 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE)                \
167   do {                                                                  \
168     ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE)         \
169     ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM);                      \
170   } while (0)
171
172 /* The standard SVR4 assembler seems to require that certain builtin
173    library routines (e.g. .udiv) be explicitly declared as .globl
174    in each assembly file where they are referenced.  */
175
176 #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)                          \
177   ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
178
179 /* This says how to output assembler code to declare an
180    uninitialized external linkage data object.  Under SVR4,
181    the linker seems to want the alignment of data objects
182    to depend on their types.  We do exactly that here.  */
183
184 #define COMMON_ASM_OP   ".comm"
185
186 #undef ASM_OUTPUT_ALIGNED_COMMON
187 #define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)              \
188 do {                                                                    \
189   fprintf ((FILE), "\t%s\t", COMMON_ASM_OP);                            \
190   assemble_name ((FILE), (NAME));                                       \
191   fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT);        \
192 } while (0)
193
194 /* This says how to output assembler code to declare an
195    uninitialized internal linkage data object.  Under SVR4,
196    the linker seems to want the alignment of data objects
197    to depend on their types.  We do exactly that here.  */
198
199 #define LOCAL_ASM_OP    ".local"
200
201 #undef ASM_OUTPUT_ALIGNED_LOCAL
202 #define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)               \
203 do {                                                                    \
204   fprintf ((FILE), "\t%s\t", LOCAL_ASM_OP);                             \
205   assemble_name ((FILE), (NAME));                                       \
206   fprintf ((FILE), "\n");                                               \
207   ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN);                  \
208 } while (0)
209
210 /* This is the pseudo-op used to generate a 32-bit word of data with a
211    specific value in some section.  This is the same for all known svr4
212    assemblers.  */
213
214 #define INT_ASM_OP              ".long"
215
216 /* This is the pseudo-op used to generate a contiguous sequence of byte
217    values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
218    AUTOMATICALLY APPENDED.  This is the same for most svr4 assemblers.  */
219
220 #undef ASCII_DATA_ASM_OP
221 #define ASCII_DATA_ASM_OP       ".ascii"
222
223 /* Support const sections and the ctors and dtors sections for g++.
224    Note that there appears to be two different ways to support const
225    sections at the moment.  You can either #define the symbol
226    READONLY_DATA_SECTION (giving it some code which switches to the
227    readonly data section) or else you can #define the symbols
228    EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
229    SELECT_RTX_SECTION.  We do both here just to be on the safe side.  */
230
231 #define USE_CONST_SECTION       1
232
233 #define CONST_SECTION_ASM_OP    ".section\t.rodata"
234
235 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
236
237    Note that we want to give these sections the SHF_WRITE attribute
238    because these sections will actually contain data (i.e. tables of
239    addresses of functions in the current root executable or shared library
240    file) and, in the case of a shared library, the relocatable addresses
241    will have to be properly resolved/relocated (and then written into) by
242    the dynamic linker when it actually attaches the given shared library
243    to the executing process.  (Note that on SVR4, you may wish to use the
244    `-z text' option to the ELF linker, when building a shared library, as
245    an additional check that you are doing everything right.  But if you do
246    use the `-z text' option when building a shared library, you will get
247    errors unless the .ctors and .dtors sections are marked as writable
248    via the SHF_WRITE attribute.)  */
249
250 #define CTORS_SECTION_ASM_OP    ".section\t.ctors,\"aw\""
251 #define DTORS_SECTION_ASM_OP    ".section\t.dtors,\"aw\""
252
253 /* On svr4, we *do* have support for the .init and .fini sections, and we
254    can put stuff in there to be executed before and after `main'.  We let
255    crtstuff.c and other files know this by defining the following symbols.
256    The definitions say how to change sections to the .init and .fini
257    sections.  This is the same for all known svr4 assemblers.  */
258
259 #define INIT_SECTION_ASM_OP     ".section\t.init"
260 #define FINI_SECTION_ASM_OP     ".section\t.fini"
261
262 /* A default list of other sections which we might be "in" at any given
263    time.  For targets that use additional sections (e.g. .tdesc) you
264    should override this definition in the target-specific file which
265    includes this file.  */
266
267 #undef EXTRA_SECTIONS
268 #define EXTRA_SECTIONS in_const, in_ctors, in_dtors
269
270 /* A default list of extra section function definitions.  For targets
271    that use additional sections (e.g. .tdesc) you should override this
272    definition in the target-specific file which includes this file.  */
273
274 #undef EXTRA_SECTION_FUNCTIONS
275 #define EXTRA_SECTION_FUNCTIONS                                         \
276   CONST_SECTION_FUNCTION                                                \
277   CTORS_SECTION_FUNCTION                                                \
278   DTORS_SECTION_FUNCTION
279
280 #define READONLY_DATA_SECTION() const_section ()
281
282 extern void text_section ();
283
284 #define CONST_SECTION_FUNCTION                                          \
285 void                                                                    \
286 const_section ()                                                        \
287 {                                                                       \
288   if (!USE_CONST_SECTION)                                               \
289     text_section();                                                     \
290   else if (in_section != in_const)                                      \
291     {                                                                   \
292       fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP);             \
293       in_section = in_const;                                            \
294     }                                                                   \
295 }
296
297 #define CTORS_SECTION_FUNCTION                                          \
298 void                                                                    \
299 ctors_section ()                                                        \
300 {                                                                       \
301   if (in_section != in_ctors)                                           \
302     {                                                                   \
303       fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP);             \
304       in_section = in_ctors;                                            \
305     }                                                                   \
306 }
307
308 #define DTORS_SECTION_FUNCTION                                          \
309 void                                                                    \
310 dtors_section ()                                                        \
311 {                                                                       \
312   if (in_section != in_dtors)                                           \
313     {                                                                   \
314       fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP);             \
315       in_section = in_dtors;                                            \
316     }                                                                   \
317 }
318
319 /* Switch into a generic section.
320    This is currently only used to support section attributes.  */
321
322 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)                \
323 do {                                                                    \
324   static struct section_info                                            \
325     {                                                                   \
326       struct section_info *next;                                        \
327       char *name;                                                       \
328       enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type;                \
329     } *sections;                                                        \
330   struct section_info *s;                                               \
331   char *mode;                                                           \
332   enum sect_enum type;                                                  \
333                                                                         \
334   for (s = sections; s; s = s->next)                                    \
335     if (!strcmp (NAME, s->name))                                        \
336       break;                                                            \
337                                                                         \
338   if (DECL && TREE_CODE (DECL) == FUNCTION_DECL)                        \
339     type = SECT_EXEC, mode = "ax";                                      \
340   else if (DECL && DECL_READONLY_SECTION (DECL, RELOC))                 \
341     type = SECT_RO, mode = "a";                                         \
342   else                                                                  \
343     type = SECT_RW, mode = "aw";                                        \
344                                                                         \
345   if (s == 0)                                                           \
346     {                                                                   \
347       s = (struct section_info *) xmalloc (sizeof (struct section_info));  \
348       s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME));         \
349       strcpy (s->name, NAME);                                           \
350       s->type = type;                                                   \
351       s->next = sections;                                               \
352       sections = s;                                                     \
353       fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, mode);    \
354     }                                                                   \
355   else                                                                  \
356     {                                                                   \
357       if (DECL && s->type != type)                                      \
358         error_with_decl (DECL, "%s causes a section type conflict");    \
359                                                                         \
360       fprintf (FILE, ".section\t%s\n", NAME);                           \
361     }                                                                   \
362 } while (0)
363
364 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
365 #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
366 #define UNIQUE_SECTION(DECL,RELOC)                              \
367 do {                                                            \
368   int len;                                                      \
369   char *name, *string, *prefix;                                 \
370                                                                 \
371   name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));       \
372                                                                 \
373   if (! DECL_ONE_ONLY (DECL))                                   \
374     {                                                           \
375       if (TREE_CODE (DECL) == FUNCTION_DECL)                    \
376         prefix = ".text.";                                      \
377       else if (DECL_READONLY_SECTION (DECL, RELOC))             \
378         prefix = ".rodata.";                                    \
379       else                                                      \
380         prefix = ".data.";                                      \
381     }                                                           \
382   else if (TREE_CODE (DECL) == FUNCTION_DECL)                   \
383     prefix = ".gnu.linkonce.t.";                                \
384   else if (DECL_READONLY_SECTION (DECL, RELOC))                 \
385     prefix = ".gnu.linkonce.r.";                                \
386   else                                                          \
387     prefix = ".gnu.linkonce.d.";                                \
388                                                                 \
389   len = strlen (name) + strlen (prefix);                        \
390   string = alloca (len + 1);                                    \
391   sprintf (string, "%s%s", prefix, name);                       \
392                                                                 \
393   DECL_SECTION_NAME (DECL) = build_string (len, string);        \
394 } while (0)
395 /* A C statement (sans semicolon) to output an element in the table of
396    global constructors.  */
397 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                               \
398   do {                                                                  \
399     ctors_section ();                                                   \
400     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
401     assemble_name (FILE, NAME);                                         \
402     fprintf (FILE, "\n");                                               \
403   } while (0)
404
405 /* A C statement (sans semicolon) to output an element in the table of
406    global destructors.  */
407 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                                \
408   do {                                                                  \
409     dtors_section ();                                                   \
410     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                              \
411     assemble_name (FILE, NAME);                                         \
412     fprintf (FILE, "\n");                                               \
413   } while (0)
414
415 /* A C statement or statements to switch to the appropriate
416    section for output of DECL.  DECL is either a `VAR_DECL' node
417    or a constant of some sort.  RELOC indicates whether forming
418    the initial value of DECL requires link-time relocations.  */
419
420 #define SELECT_SECTION(DECL,RELOC)                                      \
421 {                                                                       \
422   if (TREE_CODE (DECL) == STRING_CST)                                   \
423     {                                                                   \
424       if (! flag_writable_strings)                                      \
425         const_section ();                                               \
426       else                                                              \
427         data_section ();                                                \
428     }                                                                   \
429   else if (TREE_CODE (DECL) == VAR_DECL)                                \
430     {                                                                   \
431       if ((flag_pic && RELOC)                                           \
432           || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)          \
433           || !DECL_INITIAL (DECL)                                       \
434           || (DECL_INITIAL (DECL) != error_mark_node                    \
435               && !TREE_CONSTANT (DECL_INITIAL (DECL))))                 \
436         data_section ();                                                \
437       else                                                              \
438         const_section ();                                               \
439     }                                                                   \
440   else                                                                  \
441     const_section ();                                                   \
442 }
443
444 /* A C statement or statements to switch to the appropriate
445    section for output of RTX in mode MODE.  RTX is some kind
446    of constant in RTL.  The argument MODE is redundant except
447    in the case of a `const_int' rtx.  Currently, these always
448    go into the const section.  */
449
450 #undef SELECT_RTX_SECTION
451 #define SELECT_RTX_SECTION(MODE,RTX) const_section()
452
453 /* Define the strings used for the special svr4 .type and .size directives.
454    These strings generally do not vary from one system running svr4 to
455    another, but if a given system (e.g. m88k running svr) needs to use
456    different pseudo-op names for these, they may be overridden in the
457    file which includes this one.  */
458
459 #define TYPE_ASM_OP     ".type"
460 #define SIZE_ASM_OP     ".size"
461
462 /* This is how we tell the assembler that a symbol is weak.  */
463
464 #define ASM_WEAKEN_LABEL(FILE,NAME) \
465   do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
466        fputc ('\n', FILE); } while (0)
467
468 /* The following macro defines the format used to output the second
469    operand of the .type assembler directive.  Different svr4 assemblers
470    expect various different forms for this operand.  The one given here
471    is just a default.  You may need to override it in your machine-
472    specific tm.h file (depending upon the particulars of your assembler).  */
473
474 #define TYPE_OPERAND_FMT        "@%s"
475
476 /* Write the extra assembler code needed to declare a function's result.
477    Most svr4 assemblers don't require any special declaration of the
478    result value, but there are exceptions.  */
479
480 #ifndef ASM_DECLARE_RESULT
481 #define ASM_DECLARE_RESULT(FILE, RESULT)
482 #endif
483
484 /* These macros generate the special .type and .size directives which
485    are used to set the corresponding fields of the linker symbol table
486    entries in an ELF object file under SVR4.  These macros also output
487    the starting labels for the relevant functions/objects.  */
488
489 /* Write the extra assembler code needed to declare a function properly.
490    Some svr4 assemblers need to also have something extra said about the
491    function's return value.  We allow for that here.  */
492
493 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
494   do {                                                                  \
495     fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                             \
496     assemble_name (FILE, NAME);                                         \
497     putc (',', FILE);                                                   \
498     fprintf (FILE, TYPE_OPERAND_FMT, "function");                       \
499     putc ('\n', FILE);                                                  \
500     ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));                      \
501     ASM_OUTPUT_LABEL(FILE, NAME);                                       \
502   } while (0)
503
504 /* Write the extra assembler code needed to declare an object properly.  */
505
506 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)                       \
507   do {                                                                  \
508     fprintf (FILE, "\t%s\t ", TYPE_ASM_OP);                             \
509     assemble_name (FILE, NAME);                                         \
510     putc (',', FILE);                                                   \
511     fprintf (FILE, TYPE_OPERAND_FMT, "object");                         \
512     putc ('\n', FILE);                                                  \
513     size_directive_output = 0;                                          \
514     if (!flag_inhibit_size_directive && DECL_SIZE (DECL))               \
515       {                                                                 \
516         size_directive_output = 1;                                      \
517         fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                         \
518         assemble_name (FILE, NAME);                                     \
519         fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
520       }                                                                 \
521     ASM_OUTPUT_LABEL(FILE, NAME);                                       \
522   } while (0)
523
524 /* Output the size directive for a decl in rest_of_decl_compilation
525    in the case where we did not do so before the initializer.
526    Once we find the error_mark_node, we know that the value of
527    size_directive_output was set
528    by ASM_DECLARE_OBJECT_NAME when it was run for the same decl.  */
529
530 #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)         \
531 do {                                                                     \
532      char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);                   \
533      if (!flag_inhibit_size_directive && DECL_SIZE (DECL)                \
534          && ! AT_END && TOP_LEVEL                                        \
535          && DECL_INITIAL (DECL) == error_mark_node                       \
536          && !size_directive_output)                                      \
537        {                                                                 \
538          size_directive_output = 1;                                      \
539          fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                         \
540          assemble_name (FILE, name);                                     \
541          fprintf (FILE, ",%d\n",  int_size_in_bytes (TREE_TYPE (DECL))); \
542        }                                                                 \
543    } while (0)
544
545 /* This is how to declare the size of a function.  */
546
547 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)                    \
548   do {                                                                  \
549     if (!flag_inhibit_size_directive)                                   \
550       {                                                                 \
551         char label[256];                                                \
552         static int labelno;                                             \
553         labelno++;                                                      \
554         ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno);            \
555         ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno);               \
556         fprintf (FILE, "\t%s\t ", SIZE_ASM_OP);                         \
557         assemble_name (FILE, (FNAME));                                  \
558         fprintf (FILE, ",");                                            \
559         assemble_name (FILE, label);                                    \
560         fprintf (FILE, "-");                                            \
561         assemble_name (FILE, (FNAME));                                  \
562         putc ('\n', FILE);                                              \
563       }                                                                 \
564   } while (0)
565
566 /* A table of bytes codes used by the ASM_OUTPUT_ASCII and
567    ASM_OUTPUT_LIMITED_STRING macros.  Each byte in the table
568    corresponds to a particular byte value [0..255].  For any
569    given byte value, if the value in the corresponding table
570    position is zero, the given character can be output directly.
571    If the table value is 1, the byte must be output as a \ooo
572    octal escape.  If the tables value is anything else, then the
573    byte value should be output as a \ followed by the value
574    in the table.  Note that we can use standard UN*X escape
575    sequences for many control characters, but we don't use
576    \a to represent BEL because some svr4 assemblers (e.g. on
577    the i386) don't know about that.  Also, we don't use \v
578    since some versions of gas, such as 2.2 did not accept it.  */
579
580 #define ESCAPES \
581 "\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\
582 \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\
583 \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\
584 \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\
585 \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\
586 \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\
587 \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\
588 \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"
589
590 /* Some svr4 assemblers have a limit on the number of characters which
591    can appear in the operand of a .string directive.  If your assembler
592    has such a limitation, you should define STRING_LIMIT to reflect that
593    limit.  Note that at least some svr4 assemblers have a limit on the
594    actual number of bytes in the double-quoted string, and that they
595    count each character in an escape sequence as one byte.  Thus, an
596    escape sequence like \377 would count as four bytes.
597
598    If your target assembler doesn't support the .string directive, you
599    should define this to zero.
600 */
601
602 #define STRING_LIMIT    ((unsigned) 256)
603
604 #define STRING_ASM_OP   ".string"
605
606 /* The routine used to output NUL terminated strings.  We use a special
607    version of this for most svr4 targets because doing so makes the
608    generated assembly code more compact (and thus faster to assemble)
609    as well as more readable, especially for targets like the i386
610    (where the only alternative is to output character sequences as
611    comma separated lists of numbers).   */
612
613 #define ASM_OUTPUT_LIMITED_STRING(FILE, STR)                            \
614   do                                                                    \
615     {                                                                   \
616       register unsigned char *_limited_str = (unsigned char *) (STR);   \
617       register unsigned ch;                                             \
618       fprintf ((FILE), "\t%s\t\"", STRING_ASM_OP);                      \
619       for (; ch = *_limited_str; _limited_str++)                        \
620         {                                                               \
621           register int escape;                                          \
622           switch (escape = ESCAPES[ch])                                 \
623             {                                                           \
624             case 0:                                                     \
625               putc (ch, (FILE));                                        \
626               break;                                                    \
627             case 1:                                                     \
628               fprintf ((FILE), "\\%03o", ch);                           \
629               break;                                                    \
630             default:                                                    \
631               putc ('\\', (FILE));                                      \
632               putc (escape, (FILE));                                    \
633               break;                                                    \
634             }                                                           \
635         }                                                               \
636       fprintf ((FILE), "\"\n");                                         \
637     }                                                                   \
638   while (0)
639
640 /* The routine used to output sequences of byte values.  We use a special
641    version of this for most svr4 targets because doing so makes the
642    generated assembly code more compact (and thus faster to assemble)
643    as well as more readable.  Note that if we find subparts of the
644    character sequence which end with NUL (and which are shorter than
645    STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING.  */
646
647 #undef ASM_OUTPUT_ASCII
648 #define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)                             \
649   do                                                                    \
650     {                                                                   \
651       register unsigned char *_ascii_bytes = (unsigned char *) (STR);   \
652       register unsigned char *limit = _ascii_bytes + (LENGTH);          \
653       register unsigned bytes_in_chunk = 0;                             \
654       for (; _ascii_bytes < limit; _ascii_bytes++)                      \
655         {                                                               \
656           register unsigned char *p;                                    \
657           if (bytes_in_chunk >= 60)                                     \
658             {                                                           \
659               fprintf ((FILE), "\"\n");                                 \
660               bytes_in_chunk = 0;                                       \
661             }                                                           \
662           for (p = _ascii_bytes; p < limit && *p != '\0'; p++)          \
663             continue;                                                   \
664           if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT)          \
665             {                                                           \
666               if (bytes_in_chunk > 0)                                   \
667                 {                                                       \
668                   fprintf ((FILE), "\"\n");                             \
669                   bytes_in_chunk = 0;                                   \
670                 }                                                       \
671               ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);         \
672               _ascii_bytes = p;                                         \
673             }                                                           \
674           else                                                          \
675             {                                                           \
676               register int escape;                                      \
677               register unsigned ch;                                     \
678               if (bytes_in_chunk == 0)                                  \
679                 fprintf ((FILE), "\t%s\t\"", ASCII_DATA_ASM_OP);        \
680               switch (escape = ESCAPES[ch = *_ascii_bytes])             \
681                 {                                                       \
682                 case 0:                                                 \
683                   putc (ch, (FILE));                                    \
684                   bytes_in_chunk++;                                     \
685                   break;                                                \
686                 case 1:                                                 \
687                   fprintf ((FILE), "\\%03o", ch);                       \
688                   bytes_in_chunk += 4;                                  \
689                   break;                                                \
690                 default:                                                \
691                   putc ('\\', (FILE));                                  \
692                   putc (escape, (FILE));                                \
693                   bytes_in_chunk += 2;                                  \
694                   break;                                                \
695                 }                                                       \
696             }                                                           \
697         }                                                               \
698       if (bytes_in_chunk > 0)                                           \
699         fprintf ((FILE), "\"\n");                                       \
700     }                                                                   \
701   while (0)
702
703 /* All SVR4 targets use the ELF object file format.  */
704 #define OBJECT_FORMAT_ELF