1 /* Definitions of target machine for GNU compiler,
2 for i386/ELF NetBSD systems.
3 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
4 Contributed by matthew green <mrg@eterna.com.au>
6 This file is part of GNU CC.
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)
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.
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. */
23 /* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target.
24 This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
37 %{rdynamic:-export-dynamic} \
38 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
41 /* Names to predefine in the preprocessor for this target machine. */
43 #define CPP_PREDEFINES \
44 "-D__NetBSD__ -D__ELF__ -Asystem=unix -Asystem=NetBSD"
46 /* Provide a CPP_SPEC appropriate for NetBSD. Currently we just deal with
47 the GCC option `-posix'. */
50 #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
53 /* Make gcc agree with <machine/ansi.h> */
56 #define SIZE_TYPE "unsigned int"
59 #define PTRDIFF_TYPE "int"
62 #define ASM_APP_ON "#APP\n"
65 #define ASM_APP_OFF "#NO_APP\n"
69 #undef ASM_COMMENT_START
70 #define ASM_COMMENT_START "#"
72 #undef DBX_REGISTER_NUMBER
73 #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
76 /* Output assembler code to FILE to call the profiler. */
78 #undef NO_PROFILE_COUNTERS
79 #define NO_PROFILE_COUNTERS
81 #undef FUNCTION_PROFILER
82 #define FUNCTION_PROFILER(FILE, LABELNO) \
85 fprintf (FILE, "\tcall __mcount@PLT\n"); \
87 fprintf (FILE, "\tcall __mcount\n"); \
91 #undef HAS_INIT_SECTION
93 /* This is how we tell the assembler that two symbols have the same value. */
95 #define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
96 do { assemble_name(FILE, NAME1); \
98 assemble_name(FILE, NAME2); \
99 fputc('\n', FILE); } while (0)
101 /* A C statement to output to the stdio stream FILE an assembler
102 command to advance the location counter to a multiple of 1<<LOG
103 bytes if it is within MAX_SKIP bytes.
105 This is used to align code labels according to Intel recommendations. */
107 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
108 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
110 if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
111 else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
115 /* We always use gas here, so we don't worry about ECOFF assembler
120 /* Default to pcc-struct-return, because this is the ELF abi and
121 we don't care about compatibility with older gcc versions. */
122 #define DEFAULT_PCC_STRUCT_RETURN 1
124 #define TARGET_VERSION fprintf (stderr, " (NetBSD/i386 ELF)");