| 1 |
/* Definitions of target machine for gcc for Renesas / SuperH SH using ELF. |
| 2 |
Copyright (C) 1996-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by Ian Lance Taylor <[email protected]>. |
| 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.cc 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 DEBUGGER_REGNO(REGNO) SH_DEBUGGER_REGNO (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 |
#undef STARTFILE_SPEC |
| 71 |
#define STARTFILE_SPEC \ |
| 72 |
"%{!shared: crt1.o%s} crti.o%s \ |
| 73 |
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" |
| 74 |
|
| 75 |
#undef ENDFILE_SPEC |
| 76 |
#define ENDFILE_SPEC \ |
| 77 |
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" |
| 78 |
|
| 79 |
#undef LIB_SPEC |
| 80 |
#define LIB_SPEC "-lc" |
| 81 |
|
| 82 |
/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it, |
| 83 |
a redundant .align was generated. */ |
| 84 |
#undef ASM_OUTPUT_CASE_LABEL |