]>
gcc.gnu.org Git - gcc.git/blob - gcc/config/arm/unknown-elf.h
1 /* Definitions for non-Linux based ARM systems using ELF
2 Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
3 Contributed by Catherine Moore <clm@cygnus.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)
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 this program; 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 /* Run-time Target Specification. */
23 #ifndef TARGET_VERSION
24 #define TARGET_VERSION fputs (" (ARM/ELF non-Linux)", stderr);
27 /* Default to using APCS-32 and software floating point. */
28 #ifndef TARGET_DEFAULT
29 #define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME)
32 /* Now we define the strings used to build the spec file. */
33 #define STARTFILE_SPEC "crtbegin%O%s crt0%O%s"
35 #define ENDFILE_SPEC "crtend%O%s"
37 #define USER_LABEL_PREFIX ""
38 #define LOCAL_LABEL_PREFIX "."
40 #define TEXT_SECTION " .text"
45 #define DWARF_DEBUGGING_INFO
46 #define DWARF2_DEBUGGING_INFO
47 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
49 /* Support for Constructors and Destrcutors . */
50 #define READONLY_DATA_SECTION rdata_section
52 /* A list of other sections which the compiler might be "in" at any
54 #define SUBTARGET_EXTRA_SECTIONS in_rdata,
56 /* A list of extra section function definitions. */
57 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS RDATA_SECTION_FUNCTION
59 #define RDATA_SECTION_ASM_OP "\t.section .rodata"
61 #define RDATA_SECTION_FUNCTION \
65 if (in_section != in_rdata) \
67 fprintf (asm_out_file, "%s\n", RDATA_SECTION_ASM_OP); \
68 in_section = in_rdata; \
72 /* Switch into a generic section. */
73 #define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
75 /* The ARM development system defines __main. */
76 #define NAME__MAIN "__gccmain"
77 #define SYMBOL__MAIN __gccmain
79 /* Return a non-zero value if DECL has a section attribute. */
80 #define IN_NAMED_SECTION(DECL) \
81 ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
82 && DECL_SECTION_NAME (DECL) != NULL_TREE)
84 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
86 #define UNIQUE_SECTION(DECL, RELOC) \
94 static char * prefixes[4][2] = \
96 { ".text.", ".gnu.linkonce.t." }, \
97 { ".rodata.", ".gnu.linkonce.r." }, \
98 { ".data.", ".gnu.linkonce.d." }, \
99 { ".bss.", ".gnu.linkonce.b." } \
102 if (TREE_CODE (DECL) == FUNCTION_DECL) \
104 else if (DECL_READONLY_SECTION (DECL, RELOC)) \
106 else if (DECL_INITIAL (DECL) == NULL_TREE) \
111 prefix = prefixes[sec][DECL_ONE_ONLY(DECL)]; \
112 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
114 /* Strip off any encoding in name. */ \
115 STRIP_NAME_ENCODING (name, name); \
117 len = strlen (name) + strlen (prefix); \
118 string = alloca (len + 1); \
120 sprintf (string, "%s%s", prefix, name); \
122 DECL_SECTION_NAME (DECL) = build_string (len, string); \
126 #undef ASM_OUTPUT_ALIGNED_BSS
127 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
130 if (IN_NAMED_SECTION (DECL)) \
131 named_section (DECL, NULL, 0); \
135 ASM_GLOBALIZE_LABEL (FILE, NAME); \
137 ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
139 last_assemble_variable_decl = DECL; \
140 ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
141 ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \
145 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
146 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
149 if (IN_NAMED_SECTION (DECL)) \
150 named_section (DECL, NULL, 0); \
154 ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
155 ASM_OUTPUT_LABEL (FILE, NAME); \
156 fprintf (FILE, "\t.space\t%d\n", SIZE); \
160 #ifndef CPP_APCS_PC_DEFAULT_SPEC
161 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
164 #ifndef SUBTARGET_CPU_DEFAULT
165 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi
168 /* Now get the routine arm-elf definitions. */
This page took 0.042987 seconds and 5 git commands to generate.