]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sparc/pbd.h
dbxout.c (dbxout_source_line_counter): New global variable.
[thirdparty/gcc.git] / gcc / config / sparc / pbd.h
CommitLineData
66dae892
RK
1/* Definitions of target machine for GNU compiler, Citicorp/TTI Unicom PBD
2 version (using GAS and COFF (encapsulated is unacceptable) )
471b6f1b 3 Copyright (C) 1990, 1996, 2000 Free Software Foundation, Inc.
8763cbe8
RS
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
c15c9075
RK
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
8763cbe8 21
9b8466f4
NB
22/* Target OS builtins. */
23#define TARGET_OS_CPP_BUILTINS() \
24 do \
25 { \
26 builtin_define_std ("unix"); \
27 builtin_define_std ("UnicomPBD"); \
28 builtin_assert ("system=unix"); \
29 } \
30 while (0)
8763cbe8
RS
31
32/* We want DBX format for use with gdb under COFF. */
33
23532de9 34#define DBX_DEBUGGING_INFO 1
8763cbe8
RS
35
36/* Generate calls to memcpy, memcmp and memset. */
37
38#define TARGET_MEM_FUNCTIONS
39
40/* we use /lib/libp/lib* when profiling */
41
42#undef LIB_SPEC
0c8d4ff0 43#define LIB_SPEC "%{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp} -lc"
8763cbe8 44
8763cbe8 45
0c8d4ff0
RS
46/* Use crt1.o as a startup file and crtn.o as a closing file. */
47/*
48 * The loader directive file gcc.ifile defines how to merge the constructor
49 * sections into the data section. Also, since gas only puts out those
50 * sections in response to N_SETT stabs, and does not (yet) have a
51 * ".sections" directive, gcc.ifile also defines the list symbols
52 * __DTOR_LIST__ and __CTOR_LIST__.
53 *
54 * Finally, we must explicitly specify the file from libgcc.a that defines
55 * exit(), otherwise if the user specifies (for example) "-lc_s" on the
56 * command line, the wrong exit() will be used and global destructors will
57 * not get called .
58 */
59
8763cbe8 60#define STARTFILE_SPEC \
0c8d4ff0
RS
61"%{!r: gcc.ifile%s} %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \
62%{!r:_exit.o%s}"
63
64#define ENDFILE_SPEC "crtn.o%s"
8763cbe8 65
2296cba3 66/* LINK_SPEC is needed only for SunOS 4. */
0c8d4ff0
RS
67
68#undef LINK_SPEC
69
70/* Although the gas we use can create .ctor and .dtor sections from N_SETT
71 stabs, it does not support section directives, so we need to have the loader
72 define the lists.
73 */
74#define CTOR_LISTS_DEFINED_EXTERNALLY
75
76/* similar to default, but allows for the table defined by ld with gcc.ifile.
77 nptrs is always 0. So we need to instead check that __DTOR_LIST__[1] != 0.
78 The old check is left in so that the same macro can be used if and when
80ffc95e 79 a future version of gas does support section directives. */
0c8d4ff0
RS
80
81#define DO_GLOBAL_DTORS_BODY {int nptrs = *(int *)__DTOR_LIST__; int i; \
82 if (nptrs == -1 || (__DTOR_LIST__[0] == 0 && __DTOR_LIST__[1] != 0)) \
83 for (nptrs = 0; __DTOR_LIST__[nptrs + 1] != 0; nptrs++); \
84 for (i = nptrs; i >= 1; i--) \
85 __DTOR_LIST__[i] (); }
86
87/*
88 * Here is an example gcc.ifile. I've tested it on PBD sparc
89 * systems. The NEXT(0x200000) works on just about all 386 and m68k systems,
90 * but can be reduced to any power of 2 that is >= NBPS (0x40000 on a pbd).
91
92 SECTIONS {
93 .text BIND(0x41000200) BLOCK (0x200) :
94 { *(.init) *(.text) vfork = fork; *(.fini) }
95
96 GROUP BIND( NEXT(0x200000) + ADDR(.text) + SIZEOF(.text)):
97 { .data : { __CTOR_LIST__ = . ; . += 4; *(.ctor) . += 4 ;
98 __DTOR_LIST__ = . ; . += 4; *(.dtor) . += 4 ; }
99 .bss : { }
100 }
101 }
102 */
103
80ffc95e 104/* The prefix to add to user-visible assembler symbols. */
66dae892
RK
105
106#undef USER_LABEL_PREFIX
107#define USER_LABEL_PREFIX ""
8763cbe8
RS
108
109/* fixes: */
110/*
111 * Internal labels are prefixed with a period.
112 */
113
59f96879
RH
114#undef LOCAL_LABEL_PREFIX
115#define LOCAL_LABEL_PREFIX "."
116
8763cbe8
RS
117/* This is how to store into the string LABEL
118 the symbol_ref name of an internal numbered label where
119 PREFIX is the class of label and NUM is the number within the class.
120 This is suitable for output with `assemble_name'. */
121
122#undef ASM_GENERATE_INTERNAL_LABEL
8763cbe8 123#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
e59f7d3d 124 sprintf (LABEL, "*.%s%ld", PREFIX, (long)(NUM))
8763cbe8 125
8763cbe8
RS
126/* This is how to output an element of a case-vector that is relative. */
127
128#undef ASM_OUTPUT_ADDR_DIFF_ELT
33f7f353 129#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
8763cbe8
RS
130 fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
131
132/* This is how to output an element of a case-vector that is absolute.
133 (The 68000 does not use such vectors,
134 but we must define this macro anyway.) */
135
136#undef ASM_OUTPUT_ADDR_VEC_ELT
137#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
138 fprintf (FILE, "\t.word .L%d\n", VALUE)
139
2be15d0f 140/* This is needed for SunOS 4.0, and should not hurt for 3.2
8763cbe8 141 versions either. */
e59f7d3d 142#undef ASM_OUTPUT_SOURCE_LINE
a8d0467e
EB
143#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
144 fprintf (file, ".stabn 68,0,%d,.LM%d\n.LM%d:\n", \
145 line, counter, counter)
8763cbe8 146
471b6f1b 147#define ASM_INT_OP "\t.long "