OSDN Git Service

PR target/50820
[pf3gnuchains/gcc-fork.git] / gcc / config / sh / netbsd-elf.h
index ce71402..f5a820b 100644 (file)
@@ -1,45 +1,25 @@
 /* Definitions for SH running NetBSD using ELF
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2011
+   Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+GCC 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.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 /* Run-time Target Specification.  */
-#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT
-#define TARGET_VERSION_ENDIAN "le"
-#else
-#define TARGET_VERSION_ENDIAN ""
-#endif
-
-#if TARGET_CPU_DEFAULT & SH5_BIT
-#if TARGET_CPU_DEFAULT & SH3E_BIT
-#define TARGET_VERSION_CPU "sh5"
-#else
-#define TARGET_VERSION_CPU "sh64"
-#endif /* SH3E_BIT */
-#else
-#define TARGET_VERSION_CPU "sh"
-#endif /* SH5_BIT */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (NetBSD/%s%s ELF)",          \
-                                 TARGET_VERSION_CPU, TARGET_VERSION_ENDIAN)
-
 
 /* Extra specs needed for NetBSD SuperH ELF targets.  */
 
@@ -52,8 +32,6 @@ Boston, MA 02111-1307, USA.  */
   do                                                                   \
     {                                                                  \
       NETBSD_OS_CPP_BUILTINS_ELF();                                    \
-      if (TARGET_SHMEDIA64)                                            \
-       NETBSD_OS_CPP_BUILTINS_LP64();                                  \
       builtin_define ("__NO_LEADING_UNDERSCORES__");                   \
     }                                                                  \
   while (0)
@@ -65,17 +43,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* LINK_EMUL_PREFIX from sh/elf.h */
 
-#undef LINK_DEFAULT_CPU_EMUL
-#if TARGET_CPU_DEFAULT & SH5_BIT
-#if TARGET_CPU_DEFAULT & SH3E_BIT
-#define LINK_DEFAULT_CPU_EMUL "32"
-#else
-#define LINK_DEFAULT_CPU_EMUL "64"
-#endif /* SH3E_BIT */
-#else
-#define LINK_DEFAULT_CPU_EMUL ""
-#endif /* SH5_BIT */
-
 #undef SUBTARGET_LINK_EMUL_SUFFIX
 #define SUBTARGET_LINK_EMUL_SUFFIX "_nbsd"
 
@@ -93,35 +60,39 @@ Boston, MA 02111-1307, USA.  */
 
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT \
-  (TARGET_CPU_DEFAULT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT)
+  (TARGET_CPU_DEFAULT | MASK_USERMODE | TARGET_ENDIAN_DEFAULT)
 
+/* Define because we use the label and we do not need them.  */
+#define NO_PROFILE_COUNTERS 1
  
 #undef FUNCTION_PROFILER
 #define FUNCTION_PROFILER(STREAM,LABELNO)                              \
 do                                                                     \
   {                                                                    \
-    if (TARGET_SHMEDIA32)                                              \
-      {                                                                        \
-       /* FIXME */                                                     \
-       abort ();                                                       \
-      }                                                                        \
-    else if (TARGET_SHMEDIA64)                                         \
+    if (TARGET_SHMEDIA32 || TARGET_SHMEDIA64)                          \
       {                                                                        \
        /* FIXME */                                                     \
-       abort ();                                                       \
+       sorry ("unimplemented-shmedia profiling");                      \
       }                                                                        \
     else                                                               \
       {                                                                        \
-        fprintf((STREAM), "\tmov.l\t%cLP%d,r1\n",                      \
+        fprintf((STREAM), "\tmov.l\t%sLP%d,r1\n",                      \
                 LOCAL_LABEL_PREFIX, (LABELNO));                                \
-        fprintf((STREAM), "\tmova\t%cLP%dr,r0\n",                      \
+        fprintf((STREAM), "\tmova\t%sLP%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",                        \
+        fprintf((STREAM), "%sLP%d:\t.long\t__mcount\n",                        \
                 LOCAL_LABEL_PREFIX, (LABELNO));                                \
-        fprintf((STREAM), "%cLP%dr:\n", LOCAL_LABEL_PREFIX, (LABELNO));        \
+        fprintf((STREAM), "%sLP%dr:\n", LOCAL_LABEL_PREFIX, (LABELNO));        \
       }                                                                        \
   }                                                                    \
 while (0)
+
+/* Since libgcc is compiled with -fpic for this target, we can't use
+   __sdivsi3_1 as the division strategy for -O0 and -Os.  */
+#undef SH_DIV_STRATEGY_DEFAULT
+#define SH_DIV_STRATEGY_DEFAULT SH_DIV_CALL2
+#undef SH_DIV_STR_FOR_SIZE
+#define SH_DIV_STR_FOR_SIZE "call2"