1 /* Definitions for SH running NetBSD using ELF
2 Copyright (C) 2002 Free Software Foundation, Inc.
3 Contributed by Wasabi Systems, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Run-time Target Specification. */
24 #if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT
25 #define TARGET_VERSION fputs (" (NetBSD/shle ELF)", stderr);
27 #define TARGET_VERSION fputs (" (NetBSD/sh ELF)", stderr);
30 #define TARGET_OS_CPP_BUILTINS() \
33 NETBSD_OS_CPP_BUILTINS_ELF(); \
34 builtin_define ("__NO_LEADING_UNDERSCORES__"); \
38 /* Provide a LINK_SPEC appropriate for a NetBSD/sh ELF target.
39 This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
46 %{ml:-m shlelf_nbsd} \
55 %{rdynamic:-export-dynamic} \
56 %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
60 /* Provide a CPP_SPEC appropriate for NetBSD. */
61 #undef SUBTARGET_CPP_SPEC
62 #define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
64 /* Restore the ASM_SPEC from sh/sh.h; sh/elf.h clobbers it. */
66 #define ASM_SPEC "%(subtarget_asm_endian_spec) %{mrelax:-relax}"
69 #define TARGET_DEFAULT \
70 (SH1_BIT|SH2_BIT|SH3_BIT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT)
73 #undef FUNCTION_PROFILER
74 #define FUNCTION_PROFILER(STREAM,LABELNO) \
77 fprintf((STREAM), "\tmov.l\t%cLP%d,r1\n", \
78 LOCAL_LABEL_PREFIX, (LABELNO)); \
79 fprintf((STREAM), "\tmova\t%cLP%dr,r0\n", \
80 LOCAL_LABEL_PREFIX, (LABELNO)); \
81 fprintf((STREAM), "\tjmp\t@r1\n"); \
82 fprintf((STREAM), "\tnop\n"); \
83 fprintf((STREAM), "\t.align\t2\n"); \
84 fprintf((STREAM), "%cLP%d:\t.long\t__mcount\n", \
85 LOCAL_LABEL_PREFIX, (LABELNO)); \
86 fprintf((STREAM), "%cLP%dr:\n", LOCAL_LABEL_PREFIX, (LABELNO)); \