Turn CANNOT_CHANGE_MODE_CLASS into a hook
[official-gcc.git] / gcc / config / sh / elf.h
blob6bb218c7ae488fc3f0ce3a9aebf8a8f144c8e188
1 /* Definitions of target machine for gcc for Renesas / SuperH SH using ELF.
2 Copyright (C) 1996-2017 Free Software Foundation, Inc.
3 Contributed by Ian Lance Taylor <ian@cygnus.com>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 /* Let sh.c know this is ELF. */
22 #undef TARGET_ELF
23 #define TARGET_ELF 1
25 /* Generate DWARF2 debugging information and make it the default. */
26 #define DWARF2_DEBUGGING_INFO 1
28 #undef PREFERRED_DEBUGGING_TYPE
29 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
31 /* Use a more compact format for line information. */
32 #define DWARF2_ASM_LINE_DEBUG_INFO 1
34 #undef WCHAR_TYPE
35 #define WCHAR_TYPE SH_ELF_WCHAR_TYPE
37 #undef WCHAR_TYPE_SIZE
38 #define WCHAR_TYPE_SIZE 32
41 /* The prefix to add to user-visible assembler symbols. */
42 #undef LOCAL_LABEL_PREFIX
43 #define LOCAL_LABEL_PREFIX "."
45 #undef SIZE_TYPE
46 #define SIZE_TYPE ("unsigned int")
48 #undef PTRDIFF_TYPE
49 #define PTRDIFF_TYPE ("int")
51 /* Pass -ml and -mrelax to the assembler and linker. */
52 #undef ASM_SPEC
53 #define ASM_SPEC SH_ASM_SPEC
55 #undef LINK_SPEC
56 #define LINK_SPEC SH_LINK_SPEC
57 #undef LINK_EMUL_PREFIX
58 #if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
59 #define LINK_EMUL_PREFIX "sh%{!mb:l}elf"
60 #else
61 #define LINK_EMUL_PREFIX "sh%{ml:l}elf"
62 #endif
64 #define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
66 #undef ASM_GENERATE_INTERNAL_LABEL
67 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
68 sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
70 #define DBX_LINES_FUNCTION_RELATIVE 1
71 #define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
73 #undef STARTFILE_SPEC
74 #define STARTFILE_SPEC \
75 "%{!shared: crt1.o%s} crti.o%s \
76 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
78 #undef ENDFILE_SPEC
79 #define ENDFILE_SPEC \
80 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
82 #undef LIB_SPEC
83 #define LIB_SPEC "-lc"
85 /* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it,
86 a redundant .align was generated. */
87 #undef ASM_OUTPUT_CASE_LABEL