]>
Commit | Line | Data |
---|---|---|
a805d35f | 1 | /* Definitions of target machine for GCC, |
6ea0279f | 2 | for i386/ELF NetBSD systems. |
83ffe9cd | 3 | Copyright (C) 2001-2023 Free Software Foundation, Inc. |
6ea0279f MG |
4 | Contributed by matthew green <mrg@eterna.com.au> |
5 | ||
a805d35f | 6 | This file is part of GCC. |
6ea0279f | 7 | |
a805d35f | 8 | GCC is free software; you can redistribute it and/or modify |
6ea0279f | 9 | it under the terms of the GNU General Public License as published by |
2f83c7d6 | 10 | the Free Software Foundation; either version 3, or (at your option) |
6ea0279f MG |
11 | any later version. |
12 | ||
a805d35f | 13 | GCC is distributed in the hope that it will be useful, |
6ea0279f MG |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
2f83c7d6 NC |
19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
6ea0279f | 21 | |
45beef47 JT |
22 | #define TARGET_OS_CPP_BUILTINS() \ |
23 | do \ | |
24 | { \ | |
25 | NETBSD_OS_CPP_BUILTINS_ELF(); \ | |
26 | } \ | |
27 | while (0) | |
28 | ||
6ea0279f | 29 | |
a3e944f9 | 30 | /* Extra specs needed for NetBSD/i386 ELF. */ |
6ea0279f | 31 | |
45beef47 JT |
32 | #undef SUBTARGET_EXTRA_SPECS |
33 | #define SUBTARGET_EXTRA_SPECS \ | |
a3e944f9 JT |
34 | { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ |
35 | { "netbsd_entry_point", NETBSD_ENTRY_POINT }, | |
36 | ||
37 | ||
38 | /* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target. */ | |
39 | ||
40 | #undef LINK_SPEC | |
41 | #define LINK_SPEC NETBSD_LINK_SPEC_ELF | |
42 | ||
43 | #define NETBSD_ENTRY_POINT "__start" | |
44 | ||
6ea0279f | 45 | |
45beef47 | 46 | /* Provide a CPP_SPEC appropriate for NetBSD. */ |
f979570e JT |
47 | |
48 | #undef CPP_SPEC | |
1ba7b414 | 49 | #define CPP_SPEC "%(netbsd_cpp_spec)" |
f979570e JT |
50 | |
51 | ||
6ea0279f MG |
52 | /* Make gcc agree with <machine/ansi.h> */ |
53 | ||
54 | #undef SIZE_TYPE | |
55 | #define SIZE_TYPE "unsigned int" | |
56 | ||
57 | #undef PTRDIFF_TYPE | |
58 | #define PTRDIFF_TYPE "int" | |
59 | ||
6ea0279f MG |
60 | #undef ASM_APP_ON |
61 | #define ASM_APP_ON "#APP\n" | |
62 | ||
63 | #undef ASM_APP_OFF | |
64 | #define ASM_APP_OFF "#NO_APP\n" | |
65 | ||
f982f805 JT |
66 | #undef ASM_COMMENT_START |
67 | #define ASM_COMMENT_START "#" | |
6ea0279f | 68 | |
ca60bd93 ML |
69 | #undef DEBUGGER_REGNO |
70 | #define DEBUGGER_REGNO(n) svr4_debugger_register_map[n] | |
6ea0279f | 71 | |
f982f805 JT |
72 | |
73 | /* Output assembler code to FILE to call the profiler. */ | |
74 | ||
75 | #undef NO_PROFILE_COUNTERS | |
9739c90c | 76 | #define NO_PROFILE_COUNTERS 1 |
6ea0279f | 77 | |
f982f805 JT |
78 | #undef FUNCTION_PROFILER |
79 | #define FUNCTION_PROFILER(FILE, LABELNO) \ | |
80 | { \ | |
81 | if (flag_pic) \ | |
82 | fprintf (FILE, "\tcall __mcount@PLT\n"); \ | |
83 | else \ | |
84 | fprintf (FILE, "\tcall __mcount\n"); \ | |
85 | } | |
86 | ||
87 | ||
6ea0279f MG |
88 | #undef HAS_INIT_SECTION |
89 | ||
6ea0279f MG |
90 | /* This is how we tell the assembler that two symbols have the same value. */ |
91 | ||
92 | #define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \ | |
93 | do { assemble_name(FILE, NAME1); \ | |
94 | fputs(" = ", FILE); \ | |
95 | assemble_name(FILE, NAME2); \ | |
96 | fputc('\n', FILE); } while (0) | |
97 | ||
f982f805 JT |
98 | /* We always use gas here, so we don't worry about ECOFF assembler |
99 | problems. */ | |
6ea0279f MG |
100 | #undef TARGET_GAS |
101 | #define TARGET_GAS 1 | |
102 | ||
103 | /* Default to pcc-struct-return, because this is the ELF abi and | |
104 | we don't care about compatibility with older gcc versions. */ | |
105 | #define DEFAULT_PCC_STRUCT_RETURN 1 | |
106 | ||
10e48e39 | 107 | #define HAVE_ENABLE_EXECUTE_STACK |