summaryrefslogtreecommitdiff
path: root/gcc/config/sh/elf.h
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@superh.com>2002-04-09 20:07:15 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2002-04-09 21:07:15 +0100
commit1951818c2f0d1786ee339c5875578f864a5d2ae9 (patch)
treec9258b87b28cb4ff5b18739fab18482fb5ad9d19 /gcc/config/sh/elf.h
parent3429579991a67f01bb6339b92a7e1abc2ab08ea0 (diff)
downloadgcc-1951818c2f0d1786ee339c5875578f864a5d2ae9.tar.gz
config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h.
* config.gcc (sh-*-elf*): Use sh/embed-elf.h instead of sh/elf.h. (sh64-*-elf*, sh-*-rtemself*): Likewise. * config/sh/embed_bb.c: New file. * config/sh/embed-elf.h: New file. * sh.h (CPP_SPEC): Supply __SIZE_TYPE__ and __PTRDIFF_TYPE__ if -m[12345]* option is given. Don't use subtarget_cpp_ptr_spec. (CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and __PTRDIFF_TYPE__ . (SUBTARGET_CPP_PTR_SPEC): Don't define. (EXTRA_SPECS): Remove subtarget_cpp_ptr_spec. Add subtarget_asm_endian_spec. (ASM_SPEC): Use subtarget_asm_endian_spec. (SUBTARGET_ASM_ENDIAN_SPEC): Define. (RETURN_ADDR_RTX): Use PR_MEDIA_REG for TARGET_SH5. (WCHAR_UNSIGNED): Define. (SH_ELF_WCHAR_TYPE, SH_DBX_REGISTER_NUMBER): Define. (DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER. (ALLOCATE_INITIAL_VALUE): Use PR_MEDIA_REG for TARGET_SH5. Fix value. * sh.c (calc_live_regs): Use PR_MEDIA_REG for TARGET_SH5. (sh_adjust_cost): Likewise. sh64.h (CPP_DEFAULT_CPU_SPEC): Add settings for __SIZE_TYPE__ and __PTRDIFF_TYPE__ . (SUBTARGET_CPP_PTR_SPEC, WCHAR_TYPE): Don't #undef/ #define. (WCHAR_TYPE_SIZE): Likewise. (ASM_SPEC): Use subtarget_asm_endian_spec. (SH_ELF_WCHAR_TYPE): #undef/ #define. (MAX_WCHAR_TYPE_SIZE): Don't #undef. * config/sh/elf.h (WCHAR_UNSIGNED): #undef . (MAX_WCHAR_TYPE_SIZE): Don't #define . (WCHAR_TYPE, WCHAR_TYPE_SIZE): #undef / #define . (USER_LABEL_PREFIX): Don't #undef /#define . (DBX_REGISTER_NUMBER): Use SH_DBX_REGISTER_NUMBER. * config/elf/linux.h (USER_LABEL_PREFIX): Don't #undef /#define . (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE, WCHAR_TYPE_SIZE): Likewise. (ASM_SPEC): Likewise. (SUBTARGET_ASM_ENDIAN_SPEC): #undef / #define . (CC1_SPEC): don't supply -m3 for -m4*, -m5*. * t-sh: (LIB1ASMFUNCS): Use LIB1ASMFUNCS_CACHE. (LIB2FUNCS_EXTRA): Define. * t-sh64 (LIB2FUNCS_EXTRA): Define. * config/sh/t-linux (LIB1ASMFUNCS): Don't redefine. (LIB1ASMFUNCS_CACHE): Define. (LIB2FUNCS_EXTRA): Redefine empty. From-SVN: r52091
Diffstat (limited to 'gcc/config/sh/elf.h')
-rw-r--r--gcc/config/sh/elf.h47
1 files changed, 14 insertions, 33 deletions
diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h
index d5aa9471057..247f735d494 100644
--- a/gcc/config/sh/elf.h
+++ b/gcc/config/sh/elf.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for gcc for Hitachi / SuperH SH using ELF.
- Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor <ian@cygnus.com>.
This file is part of GNU CC.
@@ -30,6 +30,9 @@ Boston, MA 02111-1307, USA. */
#undef SIZE_TYPE
#undef PTRDIFF_TYPE
+/* And one that is defined in sh.h and should be undefined in svr4.h... */
+#undef WCHAR_UNSIGNED
+
/* Be ELF-like. */
/* TODO: convert includes to ${tm_file} list in config.gcc. */
#include "dbxelf.h"
@@ -49,17 +52,17 @@ Boston, MA 02111-1307, USA. */
/* use a more compact format for line information */
#define DWARF2_ASM_LINE_DEBUG_INFO 1
-/* WCHAR_TYPE_SIZE is defined to BITS_PER_WORD in svr4.h, but
- BITS_PER_WORD isn't constant any more. Fortunately, on no SH
- platform is it wider than 32-bits. */
-#define MAX_WCHAR_TYPE_SIZE 32
+/* WCHAR_TYPE / WCHAR_TYPE_SIZE are defined to long int / BITS_PER_WORD in
+ svr4.h, but these work out as 64 bit for shmedia64. */
+#undef WCHAR_TYPE
+/* #define WCHAR_TYPE (TARGET_SH5 ? "int" : "long int") */
+#define WCHAR_TYPE SH_ELF_WCHAR_TYPE
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
-/* The prefix to add to user-visible assembler symbols.
- Note that svr4.h redefined it from the original value (that we want)
- in sh.h */
-#undef USER_LABEL_PREFIX
-#define USER_LABEL_PREFIX "_"
+/* The prefix to add to user-visible assembler symbols. */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
@@ -109,29 +112,7 @@ Boston, MA 02111-1307, USA. */
/* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
again. */
-#define DBX_REGISTER_NUMBER(REGNO) \
- (GENERAL_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_GENERAL_REG) \
- : FP_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_FP_REG + (TARGET_SH5 ? (TARGET_SHCOMPACT ? 245 \
- : 77) : 25)) \
- : XD_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_XD_REG + (TARGET_SH5 ? 289 : 87)) \
- : TARGET_REGISTER_P (REGNO) \
- ? ((REGNO) - FIRST_TARGET_REG + 68) \
- : (REGNO) == PR_REG \
- ? (TARGET_SH5 ? 241 : 17) \
- : (REGNO) == T_REG \
- ? (TARGET_SH5 ? 242 : 18) \
- : (REGNO) == GBR_REG \
- ? (TARGET_SH5 ? 238 : 19) \
- : (REGNO) == MACH_REG \
- ? (TARGET_SH5 ? 239 : 20) \
- : (REGNO) == MACL_REG \
- ? (TARGET_SH5 ? 240 : 21) \
- : (REGNO) == FPUL_REG \
- ? (TARGET_SH5 ? 244 : 23) \
- : (abort(), -1))
+#define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \