]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/defaults.h
Oops, missed ChangeLog in last checkin...
[thirdparty/gcc.git] / gcc / defaults.h
CommitLineData
c53a8ab6
RS
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).
ef58a523 4 Copyright (C) 1992, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
b33c316c 5 Contributed by Ron Guilmette (rfg@monkeys.com)
c53a8ab6 6
c53a8ab6
RS
7This file is part of GNU CC.
8
9GNU CC is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)
12any later version.
13
14GNU CC is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU CC; see the file COPYING. If not, write to
940d9d63
RK
21the Free Software Foundation, 59 Temple Place - Suite 330,
22Boston, MA 02111-1307, USA. */
c53a8ab6 23
7b73db04
CH
24/* Store in OUTPUT a string (made with alloca) containing
25 an assembler-name for a local static variable or function named NAME.
26 LABELNO is an integer which is different for each call. */
27
28#ifndef ASM_FORMAT_PRIVATE_NAME
29#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
30 do { \
31 int len = strlen (NAME); \
32 char *temp = (char *) alloca (len + 3); \
33 temp[0] = 'L'; \
34 strcpy (&temp[1], (NAME)); \
35 temp[len + 1] = '.'; \
36 temp[len + 2] = 0; \
37 (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
38 ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
39 } while (0)
40#endif
41
42#ifndef ASM_STABD_OP
43#define ASM_STABD_OP ".stabd"
44#endif
45
46/* This is how to output an element of a case-vector that is absolute.
47 Some targets don't use this, but we have to define it anyway. */
48
49#ifndef ASM_OUTPUT_ADDR_VEC_ELT
50#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
51do { fprintf (FILE, "\t%s\t", ASM_LONG); \
52 ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \
53 fputc ('\n', FILE); \
54 } while (0)
55#endif
56
8cd0faaf
CM
57/* Provide default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. */
58#ifndef ASM_OUTPUT_ALTERNATE_LABEL_NAME
59#define ASM_OUTPUT_ALTERNATE_LABEL_NAME(FILE,INSN) \
a991240f 60do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
8cd0faaf
CM
61#endif
62
c53a8ab6
RS
63/* choose a reasonable default for ASM_OUTPUT_ASCII. */
64
65#ifndef ASM_OUTPUT_ASCII
66#define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
67 do { \
68 FILE *_hide_asm_out_file = (MYFILE); \
47ee9bcb 69 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
c53a8ab6
RS
70 int _hide_thissize = (MYLENGTH); \
71 { \
72 FILE *asm_out_file = _hide_asm_out_file; \
47ee9bcb 73 const unsigned char *p = _hide_p; \
c53a8ab6
RS
74 int thissize = _hide_thissize; \
75 int i; \
76 fprintf (asm_out_file, "\t.ascii \""); \
77 \
78 for (i = 0; i < thissize; i++) \
79 { \
80 register int c = p[i]; \
81 if (c == '\"' || c == '\\') \
82 putc ('\\', asm_out_file); \
5f6d3823 83 if (ISPRINT(c)) \
c53a8ab6
RS
84 putc (c, asm_out_file); \
85 else \
86 { \
87 fprintf (asm_out_file, "\\%o", c); \
88 /* After an octal-escape, if a digit follows, \
89 terminate one string constant and start another. \
90 The Vax assembler fails to stop reading the escape \
91 after three digits, so this is the only way we \
92 can get it to parse the data properly. */ \
d07ecc3b 93 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
c53a8ab6
RS
94 fprintf (asm_out_file, "\"\n\t.ascii \""); \
95 } \
96 } \
97 fprintf (asm_out_file, "\"\n"); \
98 } \
99 } \
100 while (0)
101#endif
d0d4af87
MS
102
103#ifndef ASM_IDENTIFY_GCC
104 /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
105 because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
106 outputting labels, if we do want it to, then it must be defined
107 in the tm.h file. */
108#ifndef ASM_IDENTIFY_LANGUAGE
109#define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
110#endif
111#endif
650f773a
JW
112
113/* This is how we tell the assembler to equate two values. */
114#ifdef SET_ASM_OP
115#ifndef ASM_OUTPUT_DEF
116#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
117 do { fprintf ((FILE), "\t%s\t", SET_ASM_OP); \
118 assemble_name (FILE, LABEL1); \
119 fprintf (FILE, ","); \
120 assemble_name (FILE, LABEL2); \
121 fprintf (FILE, "\n"); \
122 } while (0)
123#endif
124#endif
daefd78b 125
81d77cda
RK
126/* This is how to output a reference to a user-level label named NAME. */
127
128#ifndef ASM_OUTPUT_LABELREF
19283265 129#define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
81d77cda
RK
130#endif
131
daefd78b
JM
132/* This determines whether or not we support weak symbols. */
133#ifndef SUPPORTS_WEAK
134#ifdef ASM_WEAKEN_LABEL
135#define SUPPORTS_WEAK 1
136#else
137#define SUPPORTS_WEAK 0
138#endif
139#endif
a6ab3aad 140
8f08ea1e
L
141/* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
142 provide a weak attribute. Else define it to nothing.
143
144 This would normally belong in gansidecl.h, but SUPPORTS_WEAK is
145 not available at that time.
146
147 Note, this is only for use by target files which we know are to be
148 compiled by GCC. */
149#ifndef TARGET_ATTRIBUTE_WEAK
150# if SUPPORTS_WEAK
151# define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
152# else
153# define TARGET_ATTRIBUTE_WEAK
154# endif
155#endif
156
a6ab3aad
JM
157/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
158 the rest of the DWARF 2 frame unwind support is also provided. */
0021b564
JM
159#if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
160#define DWARF2_UNWIND_INFO 1
a6ab3aad 161#endif
b366352b 162
31cf0144
JM
163#if defined (DWARF2_UNWIND_INFO) && !defined (EH_FRAME_SECTION)
164# if defined (EH_FRAME_SECTION_ASM_OP)
165# define EH_FRAME_SECTION() eh_frame_section();
166# else
167 /* If we aren't using crtstuff to run ctors, don't use it for EH. */
168# if defined (ASM_OUTPUT_SECTION_NAME) && defined (ASM_OUTPUT_CONSTRUCTOR)
169# define EH_FRAME_SECTION_ASM_OP ".section\t.eh_frame,\"aw\""
170# define EH_FRAME_SECTION() \
171 do { named_section (NULL_TREE, ".eh_frame", 0); } while (0)
172# endif
173# endif
174#endif
175
b366352b
MM
176/* By default, we generate a label at the beginning and end of the
177 text section, and compute the size of the text section by
178 subtracting the two. However, on some platforms that doesn't
179 work, and we use the section itself, rather than a label at the
180 beginning of it, to indicate the start of the section. On such
181 platforms, define this to zero. */
182#ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL
183#define DWARF2_GENERATE_TEXT_SECTION_LABEL 1
184#endif
246833ac
RH
185
186/* Supply a default definition for PROMOTE_PROTOTYPES. */
187#ifndef PROMOTE_PROTOTYPES
188#define PROMOTE_PROTOTYPES 0
189#endif
c478efd1
GDR
190
191/* Number of hardware registers that go into the DWARF-2 unwind info.
192 If not defined, equals FIRST_PSEUDO_REGISTER */
193
194#ifndef DWARF_FRAME_REGISTERS
195#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
196#endif