OSDN Git Service

Add -mabi=n32 support.
[pf3gnuchains/gcc-fork.git] / gcc / defaults.h
1 /* Definitions of various defaults for how to do assembler output
2    (most of which are designed to be appropriate for GAS or for
3    some BSD assembler).
4    Copyright (C) 1992, 1996 Free Software Foundation, Inc.
5    Contributed by Ron Guilmette (rfg@monkeys.com)
6
7
8 This file is part of GNU CC.
9
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
14
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING.  If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA.  */
24
25 /* Store in OUTPUT a string (made with alloca) containing
26    an assembler-name for a local static variable or function named NAME.
27    LABELNO is an integer which is different for each call.  */
28
29 #ifndef ASM_FORMAT_PRIVATE_NAME
30 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)                  \
31   do {                                                                  \
32     int len = strlen (NAME);                                            \
33     char *temp = (char *) alloca (len + 3);                             \
34     temp[0] = 'L';                                                      \
35     strcpy (&temp[1], (NAME));                                          \
36     temp[len + 1] = '.';                                                \
37     temp[len + 2] = 0;                                                  \
38     (OUTPUT) = (char *) alloca (strlen (NAME) + 11);                    \
39     ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO);                \
40   } while (0)
41 #endif
42
43 #ifndef ASM_STABD_OP
44 #define ASM_STABD_OP ".stabd"
45 #endif
46
47 /* This is how to output an element of a case-vector that is absolute.
48    Some targets don't use this, but we have to define it anyway.  */
49
50 #ifndef ASM_OUTPUT_ADDR_VEC_ELT
51 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \
52 do { fprintf (FILE, "\t%s\t", ASM_LONG);                                \
53      ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE));                    \
54      fputc ('\n', FILE);                                                \
55    } while (0)
56 #endif
57
58 /* choose a reasonable default for ASM_OUTPUT_ASCII.  */
59
60 #ifndef ASM_OUTPUT_ASCII
61 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
62   do {                                                                        \
63     FILE *_hide_asm_out_file = (MYFILE);                                      \
64     unsigned char *_hide_p = (unsigned char *) (MYSTRING);                    \
65     int _hide_thissize = (MYLENGTH);                                          \
66     {                                                                         \
67       FILE *asm_out_file = _hide_asm_out_file;                                \
68       unsigned char *p = _hide_p;                                             \
69       int thissize = _hide_thissize;                                          \
70       int i;                                                                  \
71       fprintf (asm_out_file, "\t.ascii \"");                                  \
72                                                                               \
73       for (i = 0; i < thissize; i++)                                          \
74         {                                                                     \
75           register int c = p[i];                                              \
76           if (c == '\"' || c == '\\')                                         \
77             putc ('\\', asm_out_file);                                        \
78           if (c >= ' ' && c < 0177)                                           \
79             putc (c, asm_out_file);                                           \
80           else                                                                \
81             {                                                                 \
82               fprintf (asm_out_file, "\\%o", c);                              \
83               /* After an octal-escape, if a digit follows,                   \
84                  terminate one string constant and start another.             \
85                  The Vax assembler fails to stop reading the escape           \
86                  after three digits, so this is the only way we               \
87                  can get it to parse the data properly.  */                   \
88               if (i < thissize - 1                                            \
89                   && p[i + 1] >= '0' && p[i + 1] <= '9')                      \
90                 fprintf (asm_out_file, "\"\n\t.ascii \"");                    \
91           }                                                                   \
92         }                                                                     \
93       fprintf (asm_out_file, "\"\n");                                         \
94     }                                                                         \
95   }                                                                           \
96   while (0)
97 #endif
98
99 #ifndef ASM_IDENTIFY_GCC
100   /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
101      because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
102      outputting labels, if we do want it to, then it must be defined
103      in the tm.h file.  */
104 #ifndef ASM_IDENTIFY_LANGUAGE
105 #define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
106 #endif
107 #endif
108
109 /* This is how we tell the assembler to equate two values.  */
110 #ifdef SET_ASM_OP
111 #ifndef ASM_OUTPUT_DEF
112 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2)                              \
113  do {   fprintf ((FILE), "\t%s\t", SET_ASM_OP);                         \
114         assemble_name (FILE, LABEL1);                                   \
115         fprintf (FILE, ",");                                            \
116         assemble_name (FILE, LABEL2);                                   \
117         fprintf (FILE, "\n");                                           \
118   } while (0)
119 #endif
120 #endif
121
122 /* This determines whether or not we support weak symbols.  */
123 #ifndef SUPPORTS_WEAK
124 #ifdef ASM_WEAKEN_LABEL
125 #define SUPPORTS_WEAK 1
126 #else
127 #define SUPPORTS_WEAK 0
128 #endif
129 #endif