]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/m68k/m68kelf.h
svr4.h: Remove.
[thirdparty/gcc.git] / gcc / config / m68k / m68kelf.h
CommitLineData
d1be3be3
JW
1/* m68kelf support, derived from m68kv4.h */
2
3/* Target definitions for GNU compiler for mc680x0 running System V.4
57809813 4 Copyright (C) 1991, 1993, 2000, 2002, 2003, 2004, 2007, 2010
8636be86 5 Free Software Foundation, Inc.
d1be3be3
JW
6
7 Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com).
8
7ec022b2 9This file is part of GCC.
d1be3be3 10
7ec022b2 11GCC is free software; you can redistribute it and/or modify
d1be3be3 12it under the terms of the GNU General Public License as published by
2f83c7d6 13the Free Software Foundation; either version 3, or (at your option)
d1be3be3
JW
14any later version.
15
7ec022b2 16GCC is distributed in the hope that it will be useful,
d1be3be3
JW
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
2f83c7d6
NC
22along with GCC; see the file COPYING3. If not see
23<http://www.gnu.org/licenses/>. */
d1be3be3 24
d1be3be3
JW
25
26#ifndef SWBEG_ASM_OP
6e7b07a7 27#define SWBEG_ASM_OP "\t.swbeg\t"
d1be3be3
JW
28#endif
29
ba5f7c88 30/* Here are three prefixes that are used by asm_fprintf to
d1be3be3
JW
31 facilitate customization for alternate assembler syntaxes.
32 Machines with no likelihood of an alternate syntax need not
33 define these and need not use asm_fprintf. */
34
35/* The prefix for register names. Note that REGISTER_NAMES
36 is supposed to include this prefix. Also note that this is NOT an
37 fprintf format string, it is a literal string */
38
39#undef REGISTER_PREFIX
40#define REGISTER_PREFIX "%"
41
42/* The prefix for local (compiler generated) labels.
7a1929e1 43 These labels will not appear in the symbol table. */
d1be3be3
JW
44
45#undef LOCAL_LABEL_PREFIX
46#define LOCAL_LABEL_PREFIX "."
47
7a1929e1 48/* The prefix to add to user-visible assembler symbols. */
d1be3be3
JW
49
50#undef USER_LABEL_PREFIX
51#define USER_LABEL_PREFIX ""
52
d1be3be3
JW
53/* config/m68k.md has an explicit reference to the program counter,
54 prefix this by the register prefix. */
55
c1c1d123
AS
56#define ASM_RETURN_CASE_JUMP \
57 do { \
9425fb04 58 if (TARGET_COLDFIRE) \
c1c1d123
AS
59 { \
60 if (ADDRESS_REG_P (operands[0])) \
61 return "jmp %%pc@(2,%0:l)"; \
62 else \
63 return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \
64 } \
65 else \
66 return "jmp %%pc@(2,%0:w)"; \
2d37187d 67 } while (0)
d1be3be3 68
d1be3be3
JW
69/* This is how to output an assembler line that says to advance the
70 location counter to a multiple of 2**LOG bytes. */
71
72#undef ASM_OUTPUT_ALIGN
73#define ASM_OUTPUT_ALIGN(FILE,LOG) \
046b71ed 74do { \
d1be3be3 75 if ((LOG) > 0) \
016c8440 76 fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); \
046b71ed 77} while (0)
d1be3be3 78
d1be3be3 79/* Register in which address to store a structure value is passed to a
7a1929e1 80 function. The default in m68k.h is a1. For m68k/SVR4 it is a0. */
d1be3be3 81
8636be86 82#undef M68K_STRUCT_VALUE_REGNUM
3bfe36dc 83#define M68K_STRUCT_VALUE_REGNUM A0_REG
d1be3be3 84
835b4008
NS
85/* The static chain regnum defaults to a0, but we use that for
86 structure return, so have to use a1 for the static chain. */
87
88#undef STATIC_CHAIN_REGNUM
3bfe36dc 89#define STATIC_CHAIN_REGNUM A1_REG
835b4008
NS
90#undef M68K_STATIC_CHAIN_REG_NAME
91#define M68K_STATIC_CHAIN_REG_NAME REGISTER_PREFIX "a1"
92
d1be3be3
JW
93#define ASM_COMMENT_START "|"
94
d1be3be3
JW
95/* Define how the m68k registers should be numbered for Dwarf output.
96 The numbering provided here should be compatible with the native
97 SVR4 SDB debugger in the m68k/SVR4 reference port, where d0-d7
7a1929e1 98 are 0-7, a0-a8 are 8-15, and fp0-fp7 are 16-23. */
d1be3be3
JW
99
100#undef DBX_REGISTER_NUMBER
101#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
102
d1be3be3
JW
103#if 0
104/* SVR4 m68k assembler is bitching on the `comm i,1,1' which askes for
105 1 byte alignment. Don't generate alignment for COMMON seems to be
7a1929e1 106 safer until we the assembler is fixed. */
d1be3be3
JW
107#undef ASM_OUTPUT_ALIGNED_COMMON
108/* Same problem with this one. */
109#undef ASM_OUTPUT_ALIGNED_LOCAL
110#endif
111
d1be3be3
JW
112#undef ASM_OUTPUT_COMMON
113#undef ASM_OUTPUT_LOCAL
114#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
115( fputs (".comm ", (FILE)), \
116 assemble_name ((FILE), (NAME)), \
58e15542 117 fprintf ((FILE), ",%u\n", (int)(SIZE)))
d1be3be3
JW
118
119#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
120( fputs (".lcomm ", (FILE)), \
121 assemble_name ((FILE), (NAME)), \
58e15542 122 fprintf ((FILE), ",%u\n", (int)(SIZE)))
d1be3be3
JW
123
124/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
7a1929e1 125 keep switch tables in the text section. */
d1be3be3
JW
126
127#define JUMP_TABLES_IN_TEXT_SECTION 1
128
57809813
JM
129/* In m68k svr4, using swbeg is the standard way to do switch
130 table. */
d1be3be3
JW
131#undef ASM_OUTPUT_BEFORE_CASE_LABEL
132#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
016c8440 133 fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
d1be3be3
JW
134/* end of stuff from m68kv4.h */
135
d1be3be3
JW
136#undef ENDFILE_SPEC
137#define ENDFILE_SPEC "crtend.o%s"
138
139#undef STARTFILE_SPEC
140#define STARTFILE_SPEC "crtbegin.o%s"
48b1580e
VM
141
142/* If defined, a C expression whose value is a string containing the
143 assembler operation to identify the following data as
144 uninitialized global data. If not defined, and neither
145 `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
146 uninitialized global data will be output in the data section if
147 `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
148 used. */
149#ifndef BSS_SECTION_ASM_OP
6e7b07a7 150#define BSS_SECTION_ASM_OP "\t.section\t.bss"
48b1580e
VM
151#endif
152
153/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
154 separate, explicit argument. If you define this macro, it is used
155 in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
156 handling the required alignment of the variable. The alignment is
157 specified as the number of bits.
158
159 Try to use function `asm_output_aligned_bss' defined in file
7a1929e1 160 `varasm.c' when defining this macro. */
48b1580e
VM
161#ifndef ASM_OUTPUT_ALIGNED_BSS
162#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
163 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
164#endif