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