1 /* Definitions of target machine for gcc for Hitachi Super-H using ELF.
2 Copyright (C) 1996 Free Software Foundation, Inc.
3 Contributed by Ian Lance Taylor <ian@cygnus.com>.
5 This file is part of GNU CC.
7 GNU CC 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 2, or (at your option)
12 GNU CC 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 GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Mostly like the regular SH configuration. */
25 /* No SDB debugging info. */
26 #undef SDB_DEBUGGING_INFO
28 /* Undefine some macros defined in both sh.h and svr4.h. */
31 #undef ASM_OUTPUT_SOURCE_LINE
32 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
33 #undef CTORS_SECTION_ASM_OP
34 #undef DTORS_SECTION_ASM_OP
35 #undef ASM_OUTPUT_SECTION_NAME
36 #undef ASM_OUTPUT_CONSTRUCTOR
37 #undef ASM_OUTPUT_DESTRUCTOR
38 #undef ASM_DECLARE_FUNCTION_NAME
39 #undef PREFERRED_DEBUGGING_TYPE
44 /* The prefix to add to user-visible assembler symbols.
45 Note that svr4.h redefined it from the original value (that we want)
48 #undef USER_LABEL_PREFIX
49 #define USER_LABEL_PREFIX "_"
51 #undef LOCAL_LABEL_PREFIX
52 #define LOCAL_LABEL_PREFIX "."
55 #define ASM_FILE_START(FILE) do { \
56 output_file_directive ((FILE), main_input_filename); \
57 if (TARGET_LITTLE_ENDIAN) \
58 fprintf ((FILE), "\t.little\n"); \
63 /* Let code know that this is ELF. */
64 #define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Acpu(sh) -Amachine(sh)"
66 /* Pass -ml and -mrelax to the assembler and linker. */
68 #define ASM_SPEC "%{ml:-little} %{mrelax:-relax}"
71 #define LINK_SPEC "%{ml:-m shlelf} %{mrelax:-relax}"
73 /* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
75 #define DBX_REGISTER_NUMBER(REGNO) \
76 (((REGNO) >= 22 && (REGNO) <= 39) ? ((REGNO) + 1) : (REGNO))
78 /* SH ELF, unlike most ELF implementations, uses underscores before
80 #undef ASM_OUTPUT_LABELREF
81 #define ASM_OUTPUT_LABELREF(STREAM,NAME) \
82 asm_fprintf (STREAM, "%U%s", NAME)
84 #undef ASM_GENERATE_INTERNAL_LABEL
85 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
86 sprintf ((STRING), "*%s%s%d", LOCAL_LABEL_PREFIX, (PREFIX), (NUM))
88 #undef ASM_OUTPUT_INTERNAL_LABEL
89 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
90 asm_fprintf ((FILE), "%L%s%d:\n", (PREFIX), (NUM))
92 #undef ASM_OUTPUT_SOURCE_LINE
93 #define ASM_OUTPUT_SOURCE_LINE(file, line) \
96 static int sym_lineno = 1; \
97 asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-", \
98 (line), sym_lineno); \
99 assemble_name ((file), \
100 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
101 asm_fprintf ((file), "\n%LLM%d:\n", sym_lineno); \
106 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
107 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
110 fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO); \
113 /* Arrange to call __main, rather than using crtbegin.o and crtend.o
114 and relying on .init and .fini being executed at appropriate times. */
115 #undef INIT_SECTION_ASM_OP
116 #undef FINI_SECTION_ASM_OP
117 #undef STARTFILE_SPEC
120 /* HANDLE_SYSV_PRAGMA (defined by svr4.h) takes precedence over HANDLE_PRAGMA.
121 We want to use the HANDLE_PRAGMA from sh.h. */
122 #undef HANDLE_SYSV_PRAGMA