]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i386/netbsd-elf.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / i386 / netbsd-elf.h
CommitLineData
af680fe2 1/* Definitions of target machine for GCC,
f406b863 2 for i386/ELF NetBSD systems.
fbd26352 3 Copyright (C) 2001-2019 Free Software Foundation, Inc.
f406b863 4 Contributed by matthew green <mrg@eterna.com.au>
5
af680fe2 6This file is part of GCC.
f406b863 7
af680fe2 8GCC is free software; you can redistribute it and/or modify
f406b863 9it under the terms of the GNU General Public License as published by
038d1e19 10the Free Software Foundation; either version 3, or (at your option)
f406b863 11any later version.
12
af680fe2 13GCC is distributed in the hope that it will be useful,
f406b863 14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
038d1e19 19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
f406b863 21
415e4dbd 22#define TARGET_OS_CPP_BUILTINS() \
23 do \
24 { \
25 NETBSD_OS_CPP_BUILTINS_ELF(); \
26 } \
27 while (0)
28
f406b863 29
70e6fa67 30/* Extra specs needed for NetBSD/i386 ELF. */
f406b863 31
415e4dbd 32#undef SUBTARGET_EXTRA_SPECS
33#define SUBTARGET_EXTRA_SPECS \
70e6fa67 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
f406b863 45
415e4dbd 46/* Provide a CPP_SPEC appropriate for NetBSD. */
93528070 47
48#undef CPP_SPEC
d9d8b700 49#define CPP_SPEC "%(netbsd_cpp_spec)"
93528070 50
51
f406b863 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
f406b863 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
4ace673e 66#undef ASM_COMMENT_START
67#define ASM_COMMENT_START "#"
f406b863 68
69#undef DBX_REGISTER_NUMBER
70#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
71
4ace673e 72
73/* Output assembler code to FILE to call the profiler. */
74
75#undef NO_PROFILE_COUNTERS
527d5be8 76#define NO_PROFILE_COUNTERS 1
f406b863 77
4ace673e 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
f406b863 88#undef HAS_INIT_SECTION
89
f406b863 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
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.
101
102 This is used to align code labels according to Intel recommendations. */
103
104#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
4ace673e 105#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
106 if ((LOG) != 0) { \
bc9f52f5 107 if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1) \
108 fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
109 else \
110 fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
f406b863 111 }
112#endif
113
4ace673e 114/* We always use gas here, so we don't worry about ECOFF assembler
115 problems. */
f406b863 116#undef TARGET_GAS
117#define TARGET_GAS 1
118
119/* Default to pcc-struct-return, because this is the ELF abi and
120 we don't care about compatibility with older gcc versions. */
121#define DEFAULT_PCC_STRUCT_RETURN 1
122
a6f06169 123#define HAVE_ENABLE_EXECUTE_STACK