xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/sh/elf.h (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1 /* Definitions of target machine for gcc for Renesas / SuperH SH using ELF.
2    Copyright (C) 1996-2020 Free Software Foundation, Inc.
3    Contributed by Ian Lance Taylor <ian@cygnus.com>.
4 
5 This file is part of GCC.
6 
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.
11 
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.
16 
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/>.  */
20 
21 /* Let sh.c know this is ELF.  */
22 #undef TARGET_ELF
23 #define TARGET_ELF 1
24 
25 /* Generate DWARF2 debugging information and make it the default.  */
26 #define DWARF2_DEBUGGING_INFO 1
27 
28 #undef PREFERRED_DEBUGGING_TYPE
29 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
30 
31 /* Use a more compact format for line information.  */
32 #define DWARF2_ASM_LINE_DEBUG_INFO 1
33 
34 #undef WCHAR_TYPE
35 #define WCHAR_TYPE SH_ELF_WCHAR_TYPE
36 
37 #undef WCHAR_TYPE_SIZE
38 #define WCHAR_TYPE_SIZE 32
39 
40 
41 /* The prefix to add to user-visible assembler symbols.  */
42 #undef LOCAL_LABEL_PREFIX
43 #define LOCAL_LABEL_PREFIX "."
44 
45 #undef SIZE_TYPE
46 #define SIZE_TYPE ("unsigned int")
47 
48 #undef PTRDIFF_TYPE
49 #define PTRDIFF_TYPE ("int")
50 
51 /* Pass -ml and -mrelax to the assembler and linker.  */
52 #undef ASM_SPEC
53 #define ASM_SPEC SH_ASM_SPEC
54 
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
63 
64 #define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
65 
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))
69 
70 #define DBX_LINES_FUNCTION_RELATIVE 1
71 #define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
72 
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}"
77 
78 #undef ENDFILE_SPEC
79 #define ENDFILE_SPEC \
80   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
81 
82 #undef LIB_SPEC
83 #define LIB_SPEC "-lc"
84 
85 /* ASM_OUTPUT_CASE_LABEL is defined in elfos.h.  With it,
86    a redundant .align was generated.  */
87 #undef  ASM_OUTPUT_CASE_LABEL
88