* final.c (HAVE_READONLY_DATA_SECTION): New.
[official-gcc.git] / gcc / config / i860 / sysv4.h
blob753807fe123ca3f200a931206530e68eae3528c6
1 /* Target definitions for GNU compiler for Intel 80860 running System V.4
2 Copyright (C) 1991, 1996, 2000, 2002 Free Software Foundation, Inc.
3 Contributed by Ron Guilmette (rfg@monkeys.com).
5 This file is part of GNU CC.
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.
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.
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. */
22 #undef TARGET_VERSION
23 #define TARGET_VERSION fprintf (stderr, " (i860 System V Release 4)");
25 /* Provide a set of pre-definitions and pre-assertions appropriate for
26 the i860 running svr4. Note that the symbol `__svr4__' MUST BE
27 DEFINED! It is needed so that the va_list struct in va-i860.h
28 will get correctly defined for the svr4 (ABI compliant) case rather
29 than for the previous (svr3, svr2, ...) case. It also needs to be
30 defined so that the correct (svr4) version of __builtin_saveregs
31 will be selected when we are building gnulib2.c.
32 __svr4__ is our extension. */
34 #define CPP_PREDEFINES \
35 "-Di860 -Dunix -DSVR4 -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=i860 -Amachine=i860"
37 /* For the benefit of i860_va_arg, flag it this way too. */
39 #define I860_SVR4_VA_LIST 1
41 /* The prefix to be used in assembler output for all names of registers.
42 This string gets prepended to all i860 register names (svr4 only). */
44 #define I860_REG_PREFIX "%"
46 #define ASM_COMMENT_START "#"
48 #undef TYPE_OPERAND_FMT
49 #define TYPE_OPERAND_FMT "\"%s\""
51 /* The following macro definition overrides the one in i860.h
52 because the svr4 i860 assembler requires a different syntax
53 for getting parts of constant/relocatable values. */
55 #undef PRINT_OPERAND_PART
56 #define PRINT_OPERAND_PART(FILE, X, PART_CODE) \
57 do { fprintf (FILE, "["); \
58 output_address (X); \
59 fprintf (FILE, "]@%s", PART_CODE); \
60 } while (0)
62 #undef ASM_FILE_START
63 #define ASM_FILE_START(FILE) \
64 do { output_file_directive (FILE, main_input_filename); \
65 fprintf (FILE, "\t.version\t\"01.01\"\n"); \
66 } while (0)
68 /* Output the special word the svr4 SDB wants to see just before
69 the first word of each function's prologue code. */
71 extern const char *current_function_original_name;
73 /* This special macro is used to output a magic word just before the
74 first word of each function. On some versions of UNIX running on
75 the i860, this word can be any word that looks like a NOP, however
76 under svr4, this neds to be an `shr r0,r0,r0' instruction in which
77 the normally unused low-order bits contain the length of the function
78 prologue code (in bytes). This is needed to make the svr4 SDB debugger
79 happy. */
81 #undef ASM_OUTPUT_FUNCTION_PREFIX
82 #define ASM_OUTPUT_FUNCTION_PREFIX(FILE, FNNAME) \
83 do { ASM_OUTPUT_ALIGN (FILE, 2); \
84 fprintf ((FILE), "\t.long\t.ep."); \
85 assemble_name (FILE, FNNAME); \
86 fprintf (FILE, "-"); \
87 assemble_name (FILE, FNNAME); \
88 fprintf (FILE, "+0xc8000000\n"); \
89 current_function_original_name = (FNNAME); \
90 } while (0)
92 /* Output the special label that must go just after each function's
93 prologue code to support svr4 SDB. */
95 #define ASM_OUTPUT_PROLOGUE_SUFFIX(FILE) \
96 do { fprintf (FILE, ".ep."); \
97 assemble_name (FILE, current_function_original_name); \
98 fprintf (FILE, ":\n"); \
99 } while (0)
101 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
103 Note that we want to give these sections the SHF_WRITE attribute
104 because these sections will actually contain data (i.e. tables of
105 addresses of functions in the current root executable or shared library
106 file) and, in the case of a shared library, the relocatable addresses
107 will have to be properly resolved/relocated (and then written into) by
108 the dynamic linker when it actually attaches the given shared library
109 to the executing process. (Note that on SVR4, you may wish to use the
110 `-z text' option to the ELF linker, when building a shared library, as
111 an additional check that you are doing everything right. But if you do
112 use the `-z text' option when building a shared library, you will get
113 errors unless the .ctors and .dtors sections are marked as writable
114 via the SHF_WRITE attribute.) */
116 #undef CTORS_SECTION_ASM_OP
117 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\""
118 #undef DTORS_SECTION_ASM_OP
119 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\""
121 /* Add definitions to support the .tdesc section as specified in the svr4
122 ABI for the i860. */
124 #define TDESC_SECTION_ASM_OP "\t.section\t.tdesc"
126 #undef EXTRA_SECTIONS
127 #define EXTRA_SECTIONS in_tdesc
129 #undef EXTRA_SECTION_FUNCTIONS
130 #define EXTRA_SECTION_FUNCTIONS \
131 TDESC_SECTION_FUNCTION
133 #define TDESC_SECTION_FUNCTION \
134 void \
135 tdesc_section () \
137 if (in_section != in_tdesc) \
139 fprintf (asm_out_file, "%s\n", TDESC_SECTION_ASM_OP); \
140 in_section = in_tdesc; \