1 /* Definitions of target machine for GNU compiler, for SPARClite w/o FPU, COFF.
2 Copyright (C) 1994 Free Software Foundation, Inc.
3 Written by Ken Raeburn (raeburn@cygnus.com).
5 This file is part of GNU CC.
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)
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.
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 #include "sparc/lite.h"
23 #undef ASM_OUTPUT_IDENT
25 /* This is copied from final.c and sparc.h. */
26 #undef ASM_OUTPUT_SOURCE_LINE
27 #define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
28 { if (write_symbols == SDB_DEBUG) { \
29 fprintf ((FILE), "\t.ln\t%d\n", \
30 ((sdb_begin_function_line > -1) \
31 ? (LINE) - sdb_begin_function_line : 1)); \
32 } else if (write_symbols == DBX_DEBUG) { \
33 static int sym_lineno = 1; \
34 fprintf ((FILE), ".stabn 68,0,%d,LM%d\nLM%d:\n", \
35 (LINE), sym_lineno, sym_lineno); \
40 #undef SELECT_RTX_SECTION
41 #define BSS_SECTION_ASM_OP ".section\t\".bss\""
46 #define CPP_PREDEFINES "-Dsparc -Dsparclite -Acpu(sparc) -Amachine(sparc)"
49 #undef DBX_DEBUGGING_INFO
50 #undef PREFERRED_DEBUGGING_TYPE
51 #define DBX_DEBUGGING_INFO
52 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
54 /* Support the ctors and dtors sections for g++. */
56 #undef INIT_SECTION_ASM_OP
58 /* Support the ctors and dtors sections for g++. */
60 #undef CTORS_SECTION_ASM_OP
61 #define CTORS_SECTION_ASM_OP ".section\t.ctors,\"x\""
62 #undef DTORS_SECTION_ASM_OP
63 #define DTORS_SECTION_ASM_OP ".section\t.dtors,\"x\""
65 /* A list of other sections which the compiler might be "in" at any
69 #define EXTRA_SECTIONS in_const, in_bss, in_ctors, in_dtors
71 /* A list of extra section function definitions. */
73 #undef EXTRA_SECTION_FUNCTIONS
74 #define EXTRA_SECTION_FUNCTIONS \
75 CONST_SECTION_FUNCTION \
76 CTORS_SECTION_FUNCTION \
77 DTORS_SECTION_FUNCTION
79 #define CTORS_SECTION_FUNCTION \
83 if (in_section != in_ctors) \
85 fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
86 in_section = in_ctors; \
90 #define DTORS_SECTION_FUNCTION \
94 if (in_section != in_dtors) \
96 fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
97 in_section = in_dtors; \
101 #define INT_ASM_OP ".long"
103 /* A C statement (sans semicolon) to output an element in the table of
104 global constructors. */
105 #undef ASM_OUTPUT_CONSTRUCTOR
106 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
109 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
110 assemble_name (FILE, NAME); \
111 fprintf (FILE, "\n"); \
114 /* A C statement (sans semicolon) to output an element in the table of
115 global destructors. */
116 #undef ASM_OUTPUT_DESTRUCTOR
117 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
120 fprintf (FILE, "\t%s\t ", INT_ASM_OP); \
121 assemble_name (FILE, NAME); \
122 fprintf (FILE, "\n"); \
125 #undef DO_GLOBAL_CTORS_BODY
126 #undef DO_GLOBAL_DTORS_BODY