]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/sh/elf.h
elfos.h (ASM_OUTPUT_LABELREF): Don't define.
[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 /* Mostly like the regular SH configuration. */
23 #include "sh/sh.h"
24
25 /* No SDB debugging info. */
26 #undef SDB_DEBUGGING_INFO
27
28 /* Undefine some macros defined in both sh.h and svr4.h. */
29 #undef IDENT_ASM_OP
30 #undef ASM_FILE_END
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
41
42 /* Be ELF-like. */
43 #include "svr4.h"
44
45 /* The prefix to add to user-visible assembler symbols.
46 Note that svr4.h redefined it from the original value (that we want)
47 in sh.h */
48
49 #undef USER_LABEL_PREFIX
50 #define USER_LABEL_PREFIX "_"
51
52 #undef LOCAL_LABEL_PREFIX
53 #define LOCAL_LABEL_PREFIX "."
54
55 #undef ASM_FILE_START
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"); \
60 } while (0)
61
62
63
64 /* Let code know that this is ELF. */
65 #define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Acpu(sh) -Amachine(sh)"
66
67 /* Pass -ml and -mrelax to the assembler and linker. */
68 #undef ASM_SPEC
69 #define ASM_SPEC "%{ml:-little} %{mrelax:-relax}"
70
71 #undef LINK_SPEC
72 #define LINK_SPEC "%{ml:-m shlelf} %{mrelax:-relax}"
73
74 /* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
75 again. */
76 #define DBX_REGISTER_NUMBER(REGNO) \
77 (((REGNO) >= 22 && (REGNO) <= 39) ? ((REGNO) + 1) : (REGNO))
78
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))
82
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))
86
87 #undef ASM_OUTPUT_SOURCE_LINE
88 #define ASM_OUTPUT_SOURCE_LINE(file, line) \
89 do \
90 { \
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); \
97 sym_lineno += 1; \
98 } \
99 while (0)
100
101 #undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
102 #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
103 do { \
104 text_section (); \
105 fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO); \
106 } while (0)
107
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
113 #undef ENDFILE_SPEC
114
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