Rebase.
[official-gcc.git] / gcc / config / sh / elf.h
blob24b5c9815088ac73b1963b5d82763d0e95bdeee7
1 /* Definitions of target machine for gcc for Renesas / SuperH SH using ELF.
2 Copyright (C) 1996-2014 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 (TARGET_SH5 ? "int" : "long int") */
36 #define WCHAR_TYPE SH_ELF_WCHAR_TYPE
38 #undef WCHAR_TYPE_SIZE
39 #define WCHAR_TYPE_SIZE 32
42 /* The prefix to add to user-visible assembler symbols. */
43 #undef LOCAL_LABEL_PREFIX
44 #define LOCAL_LABEL_PREFIX "."
46 #undef SIZE_TYPE
47 #define SIZE_TYPE (TARGET_SH5 ? "long unsigned int" : "unsigned int")
49 #undef PTRDIFF_TYPE
50 #define PTRDIFF_TYPE (TARGET_SH5 ? "long int" : "int")
52 /* Pass -ml and -mrelax to the assembler and linker. */
53 #undef ASM_SPEC
54 #define ASM_SPEC SH_ASM_SPEC
56 #undef LINK_SPEC
57 #define LINK_SPEC SH_LINK_SPEC
58 #undef LINK_EMUL_PREFIX
59 #if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
60 #define LINK_EMUL_PREFIX "sh%{!mb:l}elf"
61 #else
62 #define LINK_EMUL_PREFIX "sh%{ml:l}elf"
63 #endif
65 #define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
67 #undef ASM_GENERATE_INTERNAL_LABEL
68 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
69 sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
71 #define DBX_LINES_FUNCTION_RELATIVE 1
72 #define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
74 #undef STARTFILE_SPEC
75 #define STARTFILE_SPEC \
76 "%{!shared: crt1.o%s} crti.o%s \
77 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
79 #undef ENDFILE_SPEC
80 #define ENDFILE_SPEC \
81 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
83 #undef LIB_SPEC
84 #define LIB_SPEC "-lc"
86 /* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it,
87 a redundant .align was generated. */
88 #undef ASM_OUTPUT_CASE_LABEL