]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sh/elf.h
dbxout.c (dbxout_source_line_counter): New global variable.
[thirdparty/gcc.git] / gcc / config / sh / elf.h
CommitLineData
7ab56274 1/* Definitions of target machine for gcc for Hitachi / SuperH SH using ELF.
1951818c 2 Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
c110819e
ILT
3 Contributed by Ian Lance Taylor <ian@cygnus.com>.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
32fb7c9d 22/* Generate DWARF2 debugging information and make it the default */
32fb7c9d
FS
23#define DWARF2_DEBUGGING_INFO 1
24
25#undef PREFERRED_DEBUGGING_TYPE
26#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
27
28/* use a more compact format for line information */
29#define DWARF2_ASM_LINE_DEBUG_INFO 1
30
1951818c
R
31/* WCHAR_TYPE / WCHAR_TYPE_SIZE are defined to long int / BITS_PER_WORD in
32 svr4.h, but these work out as 64 bit for shmedia64. */
33#undef WCHAR_TYPE
34/* #define WCHAR_TYPE (TARGET_SH5 ? "int" : "long int") */
35#define WCHAR_TYPE SH_ELF_WCHAR_TYPE
36
37#undef WCHAR_TYPE_SIZE
38#define WCHAR_TYPE_SIZE 32
fa5322fa 39
1245df60 40
1951818c 41/* The prefix to add to user-visible assembler symbols. */
1245df60
R
42
43#undef LOCAL_LABEL_PREFIX
44#define LOCAL_LABEL_PREFIX "."
45
46#undef ASM_FILE_START
47#define ASM_FILE_START(FILE) do { \
48 output_file_directive ((FILE), main_input_filename); \
fa5322fa
AO
49/* We also need to show the text section with the proper \
50 attributes as in TEXT_SECTION_ASM_OP, before dwarf2out \
51 emits it without attributes in TEXT_SECTION, else GAS \
52 will complain. We can teach GAS specifically about the \
53 default attributes for our choice of text section, but \
54 then we would have to change GAS again if/when we change \
55 the text section name. */ \
56 fprintf ((FILE), "%s\n", TEXT_SECTION_ASM_OP); \
1245df60
R
57 if (TARGET_LITTLE_ENDIAN) \
58 fprintf ((FILE), "\t.little\n"); \
59} while (0)
60
fa5322fa
AO
61#undef SIZE_TYPE
62#define SIZE_TYPE (TARGET_SH5 ? "long unsigned int" : "unsigned int")
63
64#undef PTRDIFF_TYPE
65#define PTRDIFF_TYPE (TARGET_SH5 ? "long int" : "int")
d44cc404 66
c110819e
ILT
67/* Pass -ml and -mrelax to the assembler and linker. */
68#undef ASM_SPEC
d44cc404
R
69#define ASM_SPEC SH_ASM_SPEC
70#undef SUBTARGET_ASM_ISA_SPEC
71#define SUBTARGET_ASM_ISA_SPEC "\
fa5322fa
AO
72%{m5-compact:--isa=SHcompact} %{m5-compact-nofpu:--isa=SHcompact} \
73%{m5-32media:--isa=SHmedia --abi=32} %{m5-32media-nofpu:--isa=SHmedia --abi=32} \
74%{m5-64media:--isa=SHmedia --abi=64} %{m5-64media-nofpu:--isa=SHmedia --abi=64}"
c110819e
ILT
75
76#undef LINK_SPEC
f1a58d92
R
77#define LINK_SPEC SH_LINK_SPEC
78#undef LINK_EMUL_PREFIX
79#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT
80#define LINK_EMUL_PREFIX "sh%{!mb:l}elf"
81#else
82#define LINK_EMUL_PREFIX "sh%{ml:l}elf"
83#endif
c110819e
ILT
84
85/* svr4.h undefined DBX_REGISTER_NUMBER, so we need to define it
86 again. */
1951818c 87#define DBX_REGISTER_NUMBER(REGNO) SH_DBX_REGISTER_NUMBER (REGNO)
c110819e 88
c110819e
ILT
89#undef ASM_GENERATE_INTERNAL_LABEL
90#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
318881c0 91 sprintf ((STRING), "*%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUM))
c110819e 92
c110819e 93#undef ASM_OUTPUT_SOURCE_LINE
a8d0467e 94#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
c110819e
ILT
95do \
96 { \
1245df60 97 asm_fprintf ((file), ".stabn 68,0,%d,%LLM%d-", \
a8d0467e 98 (line), (counter)); \
1245df60 99 assemble_name ((file), \
c110819e 100 XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
a8d0467e 101 asm_fprintf ((file), "\n%LLM%d:\n", (counter)); \
c110819e
ILT
102 } \
103while (0)
104
105#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
106#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
107do { \
108 text_section (); \
1245df60 109 fprintf ((FILE), "\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO); \
c110819e
ILT
110} while (0)
111
1a66cd67
AO
112#undef STARTFILE_SPEC
113#define STARTFILE_SPEC \
114 "%{!shared: crt1.o%s} crti.o%s \
115 %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
116
117#undef ENDFILE_SPEC
118#define ENDFILE_SPEC \
119 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
1372d4ce
NY
120
121/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it,
122 a redundant .align was generated. */
123#undef ASM_OUTPUT_CASE_LABEL