]>
Commit | Line | Data |
---|---|---|
627b12bc DE |
1 | /* Definitions of target machine for GNU compiler, for AMD Am29000 CPU |
2 | running over UDI using COFF. | |
1c940b47 | 3 | Copyright (C) 1994, 1996 Free Software Foundation, Inc. |
627b12bc DE |
4 | |
5 | This file is part of GNU CC. | |
6 | ||
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) | |
10 | any later version. | |
11 | ||
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. | |
16 | ||
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 | |
38ead7f3 RK |
19 | the Free Software Foundation, 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. */ | |
627b12bc DE |
21 | |
22 | #include "a29k/a29k.h" | |
23 | ||
94804207 | 24 | /* Support -gstabs. */ |
e57bfabe | 25 | |
94804207 | 26 | #include "dbxcoff.h" |
e57bfabe | 27 | |
627b12bc DE |
28 | /* Support the ctors and dtors sections for g++. */ |
29 | ||
30 | #define CTORS_SECTION_ASM_OP "\t.use .ctors" | |
31 | #define DTORS_SECTION_ASM_OP "\t.use .dtors" | |
32 | ||
33 | /* A list of other sections which the compiler might be "in" at any | |
34 | given time. */ | |
35 | ||
36 | #undef EXTRA_SECTIONS | |
37 | #define EXTRA_SECTIONS readonly_data, in_ctors, in_dtors | |
38 | ||
39 | /* A list of extra section function definitions. */ | |
40 | ||
41 | #undef EXTRA_SECTION_FUNCTIONS | |
42 | #define EXTRA_SECTION_FUNCTIONS \ | |
43 | READONLY_DATA_FUNCTION \ | |
44 | CTORS_SECTION_FUNCTION \ | |
45 | DTORS_SECTION_FUNCTION | |
46 | ||
47 | #define READONLY_DATA_FUNCTION \ | |
48 | void \ | |
49 | literal_section () \ | |
50 | { \ | |
51 | if (in_section != readonly_data) \ | |
52 | { \ | |
53 | fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \ | |
54 | in_section = readonly_data; \ | |
55 | } \ | |
56 | } \ | |
57 | ||
58 | #define CTORS_SECTION_FUNCTION \ | |
59 | void \ | |
60 | ctors_section () \ | |
61 | { \ | |
62 | if (in_section != in_ctors) \ | |
63 | { \ | |
64 | fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ | |
65 | in_section = in_ctors; \ | |
66 | } \ | |
67 | } | |
68 | ||
69 | #define DTORS_SECTION_FUNCTION \ | |
70 | void \ | |
71 | dtors_section () \ | |
72 | { \ | |
73 | if (in_section != in_dtors) \ | |
74 | { \ | |
75 | fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ | |
76 | in_section = in_dtors; \ | |
77 | } \ | |
78 | } | |
79 | ||
80 | #define INT_ASM_OP ".word" | |
81 | ||
82 | /* A C statement (sans semicolon) to output an element in the table of | |
83 | global constructors. */ | |
84 | #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ | |
85 | do { \ | |
86 | ctors_section (); \ | |
87 | fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ | |
88 | assemble_name (FILE, NAME); \ | |
89 | fprintf (FILE, "\n"); \ | |
90 | } while (0) | |
91 | ||
92 | /* A C statement (sans semicolon) to output an element in the table of | |
93 | global destructors. */ | |
94 | #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ | |
95 | do { \ | |
96 | dtors_section (); \ | |
97 | fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ | |
98 | assemble_name (FILE, NAME); \ | |
99 | fprintf (FILE, "\n"); \ | |
100 | } while (0) |