diff options
author | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-31 01:31:26 +0000 |
---|---|---|
committer | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-31 01:31:26 +0000 |
commit | 4ee34c7039b9612f03f786d18e2f1c4cd9980659 (patch) | |
tree | ebee8bc6cfc925fdd877623f42e647f17007517b /gcc/config/sh | |
parent | 5bbf85e7e3ad90bcf0bdebb45f81888809e83c62 (diff) | |
download | gcc-4ee34c7039b9612f03f786d18e2f1c4cd9980659.tar.gz |
* config.gcc (sh[123456789l]*-*-*): Set cpu_type to sh.
(sh-*-netbsdelf*)
(shl*-*-netbsdelf*): New targets.
* config/sh/netbsd-elf.h: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54079 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sh')
-rw-r--r-- | gcc/config/sh/netbsd-elf.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/gcc/config/sh/netbsd-elf.h b/gcc/config/sh/netbsd-elf.h new file mode 100644 index 00000000000..951f2a6b748 --- /dev/null +++ b/gcc/config/sh/netbsd-elf.h @@ -0,0 +1,88 @@ +/* Definitions for SH running NetBSD using ELF + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Wasabi Systems, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Run-time Target Specification. */ +#undef TARGET_VERSION +#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT +#define TARGET_VERSION fputs (" (NetBSD/shle ELF)", stderr); +#else +#define TARGET_VERSION fputs (" (NetBSD/sh ELF)", stderr); +#endif + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + NETBSD_OS_CPP_BUILTINS_ELF(); \ + builtin_define ("__NO_LEADING_UNDERSCORES__"); \ + } \ + while (0) + +/* Provide a LINK_SPEC appropriate for a NetBSD/sh ELF target. + This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for + the SH target. */ + +#undef LINK_SPEC +#define LINK_SPEC \ + "%{assert*} %{R*} \ + %{mb:-m shelf_nbsd} \ + %{ml:-m shlelf_nbsd} \ + %{mrelax:-relax} \ + %{shared:-shared} \ + %{!shared: \ + -dc -dp \ + %{!nostdlib: \ + %{!r*: \ + %{!e*:-e __start}}} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \ + %{static:-static}}" + + +/* Provide a CPP_SPEC appropriate for NetBSD. */ +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC + +/* Restore the ASM_SPEC from sh/sh.h; sh/elf.h clobbers it. */ +#undef ASM_SPEC +#define ASM_SPEC "%(subtarget_asm_endian_spec) %{mrelax:-relax}" + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT \ + (SH1_BIT|SH2_BIT|SH3_BIT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT) + + +#undef FUNCTION_PROFILER +#define FUNCTION_PROFILER(STREAM,LABELNO) \ +do \ + { \ + fprintf((STREAM), "\tmov.l\t%cLP%d,r1\n", \ + LOCAL_LABEL_PREFIX, (LABELNO)); \ + fprintf((STREAM), "\tmova\t%cLP%dr,r0\n", \ + LOCAL_LABEL_PREFIX, (LABELNO)); \ + fprintf((STREAM), "\tjmp\t@r1\n"); \ + fprintf((STREAM), "\tnop\n"); \ + fprintf((STREAM), "\t.align\t2\n"); \ + fprintf((STREAM), "%cLP%d:\t.long\t__mcount\n", \ + LOCAL_LABEL_PREFIX, (LABELNO)); \ + fprintf((STREAM), "%cLP%dr:\n", LOCAL_LABEL_PREFIX, (LABELNO)); \ + } \ +while (0) |