Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / config / sh / elf.h
blobb069308ea8c449e0eff4a7a35c8f2cffb4bd284f
1 /* Definitions of target machine for gcc for Renesas / SuperH SH using ELF.
2 Copyright (C) 1996, 1997, 2000, 2001, 2002, 2004
3 Free Software Foundation, Inc.
4 Contributed by Ian Lance Taylor <ian@cygnus.com>.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 /* Let sh.c know this is ELF. */
24 #undef TARGET_ELF
25 #define TARGET_ELF 1
27 /* Generate DWARF2 debugging information and make it the default */
28 #define DWARF2_DEBUGGING_INFO 1
30 #undef PREFERRED_DEBUGGING_TYPE
31 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
33 /* use a more compact format for line information */
34 #define DWARF2_ASM_LINE_DEBUG_INFO 1
36 /* WCHAR_TYPE / WCHAR_TYPE_SIZE are defined to long int / BITS_PER_WORD in
37 svr4.h, but these work out as 64 bit for shmedia64. */
38 #undef WCHAR_TYPE
39 /* #define WCHAR_TYPE (TARGET_SH5 ? "int" : "long int") */
40 #define WCHAR_TYPE SH_ELF_WCHAR_TYPE
42 #undef WCHAR_TYPE_SIZE
43 #define WCHAR_TYPE_SIZE 32
46 /* The prefix to add to user-visible assembler symbols. */
48 #undef LOCAL_LABEL_PREFIX
49 #define LOCAL_LABEL_PREFIX "."
51 #undef SIZE_TYPE
52 #define SIZE_TYPE (TARGET_SH5 ? "long unsigned int" : "unsigned int")
54 #undef PTRDIFF_TYPE
55 #define PTRDIFF_TYPE (TARGET_SH5 ? "long int" : "int")
57 /* Pass -ml and -mrelax to the assembler and linker. */
58 #undef ASM_SPEC
59 #define ASM_SPEC SH_ASM_SPEC
60 #undef SUBTARGET_ASM_ISA_SPEC
61 #define SUBTARGET_ASM_ISA_SPEC "\
62 %{m2a:--isa=sh2a} \
63 %{m2a-single:--isa=sh2a} \
64 %{m2a-single-only:--isa=sh2a} \
65 %{m2a-nofpu:--isa=sh2a-nofpu} \
66 %{m5-compact*:--isa=SHcompact} %{m5-32media*:--isa=SHmedia --abi=32} \
67 %{m5-64media*:--isa=SHmedia --abi=64}" ASM_ISA_DEFAULT_SPEC
69 #undef LINK_SPEC
70 #define LINK_SPEC SH_LINK_SPEC
71 #undef LINK_EMUL_PREFIX
72 #if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT
73 #define LINK_EMUL_PREFIX "sh%{!mb:l}elf"
74 #else
75 #define LINK_EMUL_PREFIX "sh%{ml:l}elf"
76 #endif
78 /* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
79 again. */
80 #define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
82 #undef ASM_GENERATE_INTERNAL_LABEL
83 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
84 sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
86 #define DBX_LINES_FUNCTION_RELATIVE 1
87 #define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
89 #undef STARTFILE_SPEC
90 #define STARTFILE_SPEC \
91 "%{!shared: crt1.o%s} crti.o%s \
92 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
94 #undef ENDFILE_SPEC
95 #define ENDFILE_SPEC \
96 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
98 /* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it,
99 a redundant .align was generated. */
100 #undef ASM_OUTPUT_CASE_LABEL