]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/sh/elf.h
1 /* Definitions of target machine for gcc for Hitachi Super-H using ELF.
2 Copyright (C) 1996, 1997, 2000 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
40 #undef MAX_OFILE_ALIGNMENT
45 /* The prefix to add to user-visible assembler symbols.
46 Note that svr4.h redefined it from the original value (that we want)
49 #undef USER_LABEL_PREFIX
50 #define USER_LABEL_PREFIX "_"
52 #undef LOCAL_LABEL_PREFIX
53 #define LOCAL_LABEL_PREFIX "."
56 #define ASM_FILE_START(FILE) do { \
57 output_file_directive ((FILE), main_input_filename); \
58 if (TARGET_LITTLE_ENDIAN) \
59 fprintf ((FILE), "\t.little\n"); \
64 /* Let code know that this is ELF. */
65 #define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Acpu(sh) -Amachine(sh)"
67 /* Pass -ml and -mrelax to the assembler and linker. */
69 #define ASM_SPEC "%{ml:-little} %{mrelax:-relax}"
72 #define LINK_SPEC "%{ml:-m shlelf} %{mrelax:-relax}"
74 /* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
76 #define DBX_REGISTER_NUMBER(REGNO) \
77 (((REGNO) >= 22 && (REGNO) <= 39) ? ((REGNO) + 1) : (REGNO))
79 #undef ASM_GENERATE_INTERNAL_LABEL
80 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
81 sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
83 #undef ASM_OUTPUT_INTERNAL_LABEL
84 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
85 asm_fprintf ((FILE), "%L%s%d:\n", (PREFIX), (NUM))
87 #undef ASM_OUTPUT_SOURCE_LINE
88 #define ASM_OUTPUT_SOURCE_LINE(file, line) \
91 static int sym_lineno = 1; \
92 asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-", \
93 (line), sym_lineno); \
94 assemble_name ((file), \
95 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
96 asm_fprintf ((file), "\n%LLM%d:\n", sym_lineno); \
101 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
102 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
105 fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO); \
108 /* Arrange to call __main, rather than using crtbegin.o and crtend.o
109 and relying on .init and .fini being executed at appropriate times. */
110 #undef INIT_SECTION_ASM_OP
111 #undef FINI_SECTION_ASM_OP
112 #undef STARTFILE_SPEC
115 /* HANDLE_SYSV_PRAGMA (defined by svr4.h) takes precedence over HANDLE_PRAGMA.
116 We want to use the HANDLE_PRAGMA from sh.h. */
117 #undef HANDLE_SYSV_PRAGMA