1 |
12 |
jlechner |
/* Definitions of target machine for gcc for Renesas / SuperH SH using ELF.
|
2 |
|
|
Copyright (C) 1996, 1997, 2000, 2001, 2002, 2004, 2005
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
Contributed by Ian Lance Taylor <ian@cygnus.com>.
|
5 |
|
|
|
6 |
|
|
This file is part of GCC.
|
7 |
|
|
|
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.
|
12 |
|
|
|
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.
|
17 |
|
|
|
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, 51 Franklin Street, Fifth Floor,
|
21 |
|
|
Boston, MA 02110-1301, USA. */
|
22 |
|
|
|
23 |
|
|
/* Let sh.c know this is ELF. */
|
24 |
|
|
#undef TARGET_ELF
|
25 |
|
|
#define TARGET_ELF 1
|
26 |
|
|
|
27 |
|
|
/* Generate DWARF2 debugging information and make it the default */
|
28 |
|
|
#define DWARF2_DEBUGGING_INFO 1
|
29 |
|
|
|
30 |
|
|
#undef PREFERRED_DEBUGGING_TYPE
|
31 |
|
|
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
32 |
|
|
|
33 |
|
|
/* use a more compact format for line information */
|
34 |
|
|
#define DWARF2_ASM_LINE_DEBUG_INFO 1
|
35 |
|
|
|
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
|
41 |
|
|
|
42 |
|
|
#undef WCHAR_TYPE_SIZE
|
43 |
|
|
#define WCHAR_TYPE_SIZE 32
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
/* The prefix to add to user-visible assembler symbols. */
|
47 |
|
|
|
48 |
|
|
#undef LOCAL_LABEL_PREFIX
|
49 |
|
|
#define LOCAL_LABEL_PREFIX "."
|
50 |
|
|
|
51 |
|
|
#undef SIZE_TYPE
|
52 |
|
|
#define SIZE_TYPE (TARGET_SH5 ? "long unsigned int" : "unsigned int")
|
53 |
|
|
|
54 |
|
|
#undef PTRDIFF_TYPE
|
55 |
|
|
#define PTRDIFF_TYPE (TARGET_SH5 ? "long int" : "int")
|
56 |
|
|
|
57 |
|
|
/* Pass -ml and -mrelax to the assembler and linker. */
|
58 |
|
|
#undef ASM_SPEC
|
59 |
|
|
#define ASM_SPEC SH_ASM_SPEC
|
60 |
|
|
|
61 |
|
|
#undef LINK_SPEC
|
62 |
|
|
#define LINK_SPEC SH_LINK_SPEC
|
63 |
|
|
#undef LINK_EMUL_PREFIX
|
64 |
|
|
#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
|
65 |
|
|
#define LINK_EMUL_PREFIX "sh%{!mb:l}elf"
|
66 |
|
|
#else
|
67 |
|
|
#define LINK_EMUL_PREFIX "sh%{ml:l}elf"
|
68 |
|
|
#endif
|
69 |
|
|
|
70 |
|
|
/* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
|
71 |
|
|
again. */
|
72 |
|
|
#define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
|
73 |
|
|
|
74 |
|
|
#undef ASM_GENERATE_INTERNAL_LABEL
|
75 |
|
|
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
|
76 |
|
|
sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
|
77 |
|
|
|
78 |
|
|
#define DBX_LINES_FUNCTION_RELATIVE 1
|
79 |
|
|
#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
|
80 |
|
|
|
81 |
|
|
#undef STARTFILE_SPEC
|
82 |
|
|
#define STARTFILE_SPEC \
|
83 |
|
|
"%{!shared: crt1.o%s} crti.o%s \
|
84 |
|
|
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
|
85 |
|
|
|
86 |
|
|
#undef ENDFILE_SPEC
|
87 |
|
|
#define ENDFILE_SPEC \
|
88 |
|
|
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
|
89 |
|
|
|
90 |
|
|
/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it,
|
91 |
|
|
a redundant .align was generated. */
|
92 |
|
|
#undef ASM_OUTPUT_CASE_LABEL
|