136ac495dSmrg /* Definitions for SH running NetBSD using ELF 2*8feb0f0bSmrg Copyright (C) 2002-2020 Free Software Foundation, Inc. 336ac495dSmrg Contributed by Wasabi Systems, Inc. 436ac495dSmrg 536ac495dSmrg This file is part of GCC. 636ac495dSmrg 736ac495dSmrg GCC is free software; you can redistribute it and/or modify 836ac495dSmrg it under the terms of the GNU General Public License as published by 936ac495dSmrg the Free Software Foundation; either version 3, or (at your option) 1036ac495dSmrg any later version. 1136ac495dSmrg 1236ac495dSmrg GCC is distributed in the hope that it will be useful, 1336ac495dSmrg but WITHOUT ANY WARRANTY; without even the implied warranty of 1436ac495dSmrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1536ac495dSmrg GNU General Public License for more details. 1636ac495dSmrg 1736ac495dSmrg You should have received a copy of the GNU General Public License 1836ac495dSmrg along with GCC; see the file COPYING3. If not see 1936ac495dSmrg <http://www.gnu.org/licenses/>. */ 2036ac495dSmrg 2136ac495dSmrg /* Run-time Target Specification. */ 2236ac495dSmrg 2336ac495dSmrg #define TARGET_OS_CPP_BUILTINS() \ 2436ac495dSmrg do \ 2536ac495dSmrg { \ 2636ac495dSmrg NETBSD_OS_CPP_BUILTINS_ELF(); \ 2736ac495dSmrg builtin_define ("__NO_LEADING_UNDERSCORES__"); \ 2836ac495dSmrg } \ 2936ac495dSmrg while (0) 3036ac495dSmrg 3136ac495dSmrg /* Provide a LINK_SPEC appropriate for a NetBSD/sh ELF target. 3236ac495dSmrg We use the SH_LINK_SPEC from sh/sh.h, and define the appropriate 3336ac495dSmrg SUBTARGET_LINK_SPEC that pulls in what we need from a generic 3436ac495dSmrg NetBSD ELF LINK_SPEC. */ 3536ac495dSmrg 3636ac495dSmrg /* LINK_EMUL_PREFIX from sh/elf.h */ 3736ac495dSmrg #undef SUBTARGET_LINK_EMUL_SUFFIX 3836ac495dSmrg #define SUBTARGET_LINK_EMUL_SUFFIX "_nbsd" 3936ac495dSmrg 4036ac495dSmrg #undef SUBTARGET_LINK_SPEC 4136ac495dSmrg #define SUBTARGET_LINK_SPEC NETBSD_LINK_SPEC_ELF 4236ac495dSmrg 4336ac495dSmrg #undef LINK_SPEC 4436ac495dSmrg #define LINK_SPEC SH_LINK_SPEC 4536ac495dSmrg 4636ac495dSmrg #define NETBSD_ENTRY_POINT "__start" 4736ac495dSmrg 4836ac495dSmrg /* Provide a CPP_SPEC appropriate for NetBSD. */ 4936ac495dSmrg #undef SUBTARGET_CPP_SPEC 5036ac495dSmrg #define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC 5136ac495dSmrg 5236ac495dSmrg #undef TARGET_DEFAULT 5336ac495dSmrg #define TARGET_DEFAULT \ 5436ac495dSmrg (TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT) 5536ac495dSmrg 5636ac495dSmrg /* Define because we use the label and we do not need them. */ 5736ac495dSmrg #define NO_PROFILE_COUNTERS 1 5836ac495dSmrg 5936ac495dSmrg #undef FUNCTION_PROFILER 6036ac495dSmrg #define FUNCTION_PROFILER(STREAM,LABELNO) \ 6136ac495dSmrg do \ 6236ac495dSmrg { \ 6336ac495dSmrg fprintf((STREAM), "\tmov.l\t%sLP%d,r1\n", \ 6436ac495dSmrg LOCAL_LABEL_PREFIX, (LABELNO)); \ 6536ac495dSmrg fprintf((STREAM), "\tmova\t%sLP%dr,r0\n", \ 6636ac495dSmrg LOCAL_LABEL_PREFIX, (LABELNO)); \ 6736ac495dSmrg fprintf((STREAM), "\tjmp\t@r1\n"); \ 6836ac495dSmrg fprintf((STREAM), "\tnop\n"); \ 6936ac495dSmrg fprintf((STREAM), "\t.align\t2\n"); \ 7036ac495dSmrg fprintf((STREAM), "%sLP%d:\t.long\t__mcount\n", \ 7136ac495dSmrg LOCAL_LABEL_PREFIX, (LABELNO)); \ 7236ac495dSmrg fprintf((STREAM), "%sLP%dr:\n", LOCAL_LABEL_PREFIX, (LABELNO)); \ 7336ac495dSmrg } \ 7436ac495dSmrg while (0) 7536ac495dSmrg 7636ac495dSmrg #undef SUBTARGET_OVERRIDE_OPTIONS 7736ac495dSmrg #define SUBTARGET_OVERRIDE_OPTIONS \ 7836ac495dSmrg do \ 7936ac495dSmrg { \ 8036ac495dSmrg /* Set -musermode if it hasn't been specified. */ \ 8136ac495dSmrg if (global_options_set.x_TARGET_USERMODE == 0) \ 8236ac495dSmrg TARGET_USERMODE = true; \ 8336ac495dSmrg } \ 8436ac495dSmrg while (0) 85