OSDN Git Service

* config/m68hc11/m68hc11.c (m68hc11_initial_elimination_offset):
[pf3gnuchains/gcc-fork.git] / gcc / config / arm / conix-elf.h
1 /* Definitions of target machine for GNU compiler,
2    for ARM with ConiX OS.
3    Copyright (C) 2000 Free Software Foundation, Inc.
4    Contributed by Philip Blundell <pb@futuretv.com>
5    
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23 /* Run-time Target Specification.  */
24 #ifndef TARGET_VERSION
25 #define TARGET_VERSION  fputs (" (ARM/ELF ConiX)", stderr);
26 #endif
27
28 /* Default to using APCS-32 and software floating point.  */
29 #ifndef TARGET_DEFAULT
30 #define TARGET_DEFAULT  (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32)
31 #endif
32
33 /* Now we define the strings used to build the spec file.  */
34 #define STARTFILE_SPEC          "crtbegin%O%s crt0%O%s"
35
36 #define ENDFILE_SPEC            "crtend%O%s"
37
38 #define USER_LABEL_PREFIX       ""
39 #define LOCAL_LABEL_PREFIX      "."
40
41 #define TEXT_SECTION            "\t.text"
42
43 /* Debugging */
44 #define DWARF2_DEBUGGING_INFO
45 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
46
47 /* Support for Constructors and Destructors.  */
48 #define READONLY_DATA_SECTION   rdata_section
49
50 /* A list of other sections which the compiler might be "in" at any
51    given time.  */
52 #define SUBTARGET_EXTRA_SECTIONS in_rdata,
53
54 /* A list of extra section function definitions.  */
55 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS       RDATA_SECTION_FUNCTION
56   
57 #define RDATA_SECTION_ASM_OP    "\t.section .rodata"
58
59 #define RDATA_SECTION_FUNCTION                                  \
60 void                                                            \
61 rdata_section ()                                                \
62 {                                                               \
63   if (in_section != in_rdata)                                   \
64     {                                                           \
65       fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP);     \
66       in_section = in_rdata;                                    \
67     }                                                           \
68 }
69
70 #define CTOR_LIST_BEGIN                                 \
71 asm (CTORS_SECTION_ASM_OP);                             \
72 func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }
73
74 #define CTOR_LIST_END                                   \
75 asm (CTORS_SECTION_ASM_OP);                             \
76 func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
77
78 #define DTOR_LIST_BEGIN                                 \
79 asm (DTORS_SECTION_ASM_OP);                             \
80 func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) }
81
82 #define DTOR_LIST_END                                   \
83 asm (DTORS_SECTION_ASM_OP);                             \
84 func_ptr __DTOR_END__[1] = { (func_ptr) 0 };
85
86 /* A C statement to output something to the assembler file to switch to section
87    NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
88    NULL_TREE.  Some target formats do not support arbitrary sections.  Do not
89    define this macro in such cases.  */
90 #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC)              \
91   do                                                                    \
92     {                                                                   \
93       if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL)                  \
94         fprintf (STREAM, "\t.section %s,\"ax\",@progbits\n", (NAME));   \
95       else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))           \
96         fprintf (STREAM, "\t.section %s,\"a\"\n", (NAME));              \
97       else                                                              \
98         fprintf (STREAM, "\t.section %s,\"aw\"\n", (NAME));             \
99     }                                                                   \
100   while (0)
101
102 /* The ARM development system defines __main.  */
103 #define NAME__MAIN "__gccmain"
104 #define SYMBOL__MAIN __gccmain
105
106 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
107 #define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
108 #define UNIQUE_SECTION(DECL,RELOC)                              \
109   do                                                            \
110     {                                                           \
111       int len;                                                  \
112       char * name, * string, * prefix;                          \
113                                                                 \
114       name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));   \
115                                                                 \
116       if (! DECL_ONE_ONLY (DECL))                               \
117         {                                                       \
118           prefix = ".";                                         \
119           if (TREE_CODE (DECL) == FUNCTION_DECL)                \
120             prefix = ".text.";                                  \
121           else if (DECL_READONLY_SECTION (DECL, RELOC))         \
122             prefix = ".rodata.";                                \
123           else                                                  \
124             prefix = ".data.";                                  \
125         }                                                       \
126       else if (TREE_CODE (DECL) == FUNCTION_DECL)               \
127         prefix = ".gnu.linkonce.t.";                            \
128       else if (DECL_READONLY_SECTION (DECL, RELOC))             \
129         prefix = ".gnu.linkonce.r.";                            \
130       else                                                      \
131         prefix = ".gnu.linkonce.d.";                            \
132                                                                 \
133       len = strlen (name) + strlen (prefix);                    \
134       string = alloca (len + 1);                                \
135       sprintf (string, "%s%s", prefix, name);                   \
136                                                                 \
137       DECL_SECTION_NAME (DECL) = build_string (len, string);    \
138     }                                                           \
139   while (0)
140
141 #ifndef CPP_APCS_PC_DEFAULT_SPEC
142 #define CPP_APCS_PC_DEFAULT_SPEC        "-D__APCS_32__"
143 #endif
144      
145 #ifndef SUBTARGET_CPU_DEFAULT
146 #define SUBTARGET_CPU_DEFAULT           TARGET_CPU_arm7tdmi
147 #endif
148      
149 #define CPP_PREDEFINES \
150   "-D__arm__ -D__CONIX__ -Acpu=arm -Amachine=arm -D__ELF__"
151
152 /* Now get the routine arm-elf definitions.  */
153 #include "arm/elf.h"