1 /* Definitions of target machine for GCC,
2 for i386/ELF NetBSD systems.
3 Copyright (C) 2001-2015 Free Software Foundation, Inc.
4 Contributed by matthew green <mrg@eterna.com.au>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 GCC is distributed in the hope that it will be useful,
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.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #define TARGET_OS_CPP_BUILTINS() \
25 NETBSD_OS_CPP_BUILTINS_ELF(); \
30 /* Extra specs needed for NetBSD/i386 ELF. */
32 #undef SUBTARGET_EXTRA_SPECS
33 #define SUBTARGET_EXTRA_SPECS \
34 { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \
35 { "netbsd_entry_point", NETBSD_ENTRY_POINT },
38 /* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target. */
41 #define LINK_SPEC NETBSD_LINK_SPEC_ELF
43 #define NETBSD_ENTRY_POINT "__start"
46 /* Provide a CPP_SPEC appropriate for NetBSD. */
49 #define CPP_SPEC "%(netbsd_cpp_spec)"
52 /* Make gcc agree with <machine/ansi.h> */
55 #define SIZE_TYPE "unsigned int"
58 #define PTRDIFF_TYPE "int"
61 #define ASM_APP_ON "#APP\n"
64 #define ASM_APP_OFF "#NO_APP\n"
66 #undef ASM_COMMENT_START
67 #define ASM_COMMENT_START "#"
69 #undef DBX_REGISTER_NUMBER
70 #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
73 /* Output assembler code to FILE to call the profiler. */
75 #undef NO_PROFILE_COUNTERS
76 #define NO_PROFILE_COUNTERS 1
78 #undef FUNCTION_PROFILER
79 #define FUNCTION_PROFILER(FILE, LABELNO) \
82 fprintf (FILE, "\tcall __mcount@PLT\n"); \
84 fprintf (FILE, "\tcall __mcount\n"); \
88 #undef HAS_INIT_SECTION
90 /* This is how we tell the assembler that two symbols have the same value. */
92 #define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
93 do { assemble_name(FILE, NAME1); \
95 assemble_name(FILE, NAME2); \
96 fputc('\n', FILE); } while (0)
98 /* A C statement to output to the stdio stream FILE an assembler
99 command to advance the location counter to a multiple of 1<<LOG
100 bytes if it is within MAX_SKIP bytes.
102 This is used to align code labels according to Intel recommendations. */
104 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
105 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
107 if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
108 else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
112 /* We always use gas here, so we don't worry about ECOFF assembler
117 /* Default to pcc-struct-return, because this is the ELF abi and
118 we don't care about compatibility with older gcc versions. */
119 #define DEFAULT_PCC_STRUCT_RETURN 1
121 #define HAVE_ENABLE_EXECUTE_STACK
123 #define IX86_MAYBE_NO_LIBGCC_TFMODE