xref: /openbsd-src/gnu/usr.bin/gcc/gcc/config/i386/netbsd64.h (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1 /* Definitions of target machine for GNU compiler,
2    for x86-64/ELF NetBSD systems.
3    Copyright (C) 2002 Free Software Foundation, Inc.
4    Contributed by Wasabi Systems, Inc.
5 
6 This file is part of GNU CC.
7 
8 GNU CC 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 2, or (at your option)
11 any later version.
12 
13 GNU CC 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.
17 
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22 
23 #define TARGET_OS_CPP_BUILTINS()		\
24   do						\
25     {						\
26       NETBSD_OS_CPP_BUILTINS_ELF();		\
27       if (TARGET_64BIT)				\
28 	NETBSD_OS_CPP_BUILTINS_LP64();		\
29     }						\
30   while (0)
31 
32 
33 /* Extra specs needed for NetBSD/x86-64 ELF.  */
34 
35 #undef SUBTARGET_EXTRA_SPECS
36 #define SUBTARGET_EXTRA_SPECS			\
37   { "netbsd_cpp_spec", NETBSD_CPP_SPEC },	\
38   { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF },	\
39   { "netbsd_entry_point", NETBSD_ENTRY_POINT },
40 
41 
42 /* Provide a LINK_SPEC appropriate for a NetBSD/x86-64 ELF target.  */
43 
44 #undef LINK_SPEC
45 #define LINK_SPEC \
46   "%{m32:-m elf_i386} \
47    %{m64:-m elf_x86_64} \
48    %(netbsd_link_spec)"
49 
50 #define NETBSD_ENTRY_POINT "_start"
51 
52 
53 /* Provide a CPP_SPEC appropriate for NetBSD.  */
54 
55 #undef CPP_SPEC
56 #define CPP_SPEC "%(netbsd_cpp_spec)"
57 
58 
59 /* Output assembler code to FILE to call the profiler.  */
60 
61 #undef FUNCTION_PROFILER
62 #define FUNCTION_PROFILER(FILE, LABELNO)				\
63 {									\
64   if (TARGET_64BIT && flag_pic)						\
65     fprintf (FILE, "\tcall *__mcount@PLT\n");				\
66   else if (flag_pic)							\
67     fprintf (FILE, "\tcall *__mcount@PLT\n");				\
68   else									\
69     fprintf (FILE, "\tcall __mcount\n");				\
70 }
71 
72 /* Attempt to enable execute permissions on the stack.  */
73 #define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
74 
75 #define TARGET_VERSION fprintf (stderr, " (NetBSD/x86_64 ELF)");
76