]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/sh/elf.h
c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if REGISTER_TARGET_PRAGMAS is defined.
[thirdparty/gcc.git] / 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>.
4
5 This file is part of GNU CC.
6
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)
10 any later version.
11
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.
16
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. */
21
22 /* No SDB debugging info. */
23 #undef SDB_DEBUGGING_INFO
24
25 /* Generate DWARF2 debugging information and make it the default */
26 #define DWARF2_DEBUGGING_INFO
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 /* Undefine some macros defined in both sh.h and svr4.h. */
35 #undef IDENT_ASM_OP
36 #undef ASM_FILE_END
37 #undef ASM_OUTPUT_SOURCE_LINE
38 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
39 #undef CTORS_SECTION_ASM_OP
40 #undef DTORS_SECTION_ASM_OP
41 #undef ASM_OUTPUT_SECTION_NAME
42 #undef ASM_OUTPUT_CONSTRUCTOR
43 #undef ASM_OUTPUT_DESTRUCTOR
44 #undef ASM_DECLARE_FUNCTION_NAME
45 #undef MAX_OFILE_ALIGNMENT
46 #undef INIT_SECTION_ASM_OP
47 #undef FINI_SECTION_ASM_OP
48
49 /* Be ELF-like. */
50 #include "svr4.h"
51
52 /* The prefix to add to user-visible assembler symbols.
53 Note that svr4.h redefined it from the original value (that we want)
54 in sh.h */
55
56 #undef USER_LABEL_PREFIX
57 #define USER_LABEL_PREFIX "_"
58
59 #undef LOCAL_LABEL_PREFIX
60 #define LOCAL_LABEL_PREFIX "."
61
62 #undef ASM_FILE_START
63 #define ASM_FILE_START(FILE) do { \
64 output_file_directive ((FILE), main_input_filename); \
65 if (TARGET_LITTLE_ENDIAN) \
66 fprintf ((FILE), "\t.little\n"); \
67 } while (0)
68
69
70
71 /* Let code know that this is ELF. */
72 #define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Acpu(sh) -Amachine(sh)"
73
74 /* Pass -ml and -mrelax to the assembler and linker. */
75 #undef ASM_SPEC
76 #define ASM_SPEC "%{ml:-little} %{mrelax:-relax}"
77
78 #undef LINK_SPEC
79 #define LINK_SPEC "%{ml:-m shlelf} %{mrelax:-relax}"
80
81 /* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
82 again. */
83 #define DBX_REGISTER_NUMBER(REGNO) \
84 (((REGNO) >= 22 && (REGNO) <= 39) ? ((REGNO) + 1) : (REGNO))
85
86 #undef ASM_GENERATE_INTERNAL_LABEL
87 #define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
88 sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
89
90 #undef ASM_OUTPUT_INTERNAL_LABEL
91 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
92 asm_fprintf ((FILE), "%L%s%d:\n", (PREFIX), (NUM))
93
94 #undef ASM_OUTPUT_SOURCE_LINE
95 #define ASM_OUTPUT_SOURCE_LINE(file, line) \
96 do \
97 { \
98 static int sym_lineno = 1; \
99 asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-", \
100 (line), sym_lineno); \
101 assemble_name ((file), \
102 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
103 asm_fprintf ((file), "\n%LLM%d:\n", sym_lineno); \
104 sym_lineno += 1; \
105 } \
106 while (0)
107
108 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
109 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
110 do { \
111 text_section (); \
112 fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO); \
113 } while (0)
114
115 #undef STARTFILE_SPEC
116 #define STARTFILE_SPEC \
117 "%{!shared: crt1.o%s} crti.o%s \
118 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
119
120 #undef ENDFILE_SPEC
121 #define ENDFILE_SPEC \
122 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"