update copyrights in config dir.
[official-gcc.git] / gcc / config / arm / linux-telf.h
blobdd730d864726195ea59621dc99a16f82b5eac446
1 /* Definitions for Thumb running Linux-based GNU systems using ELF
2 Copyright (C) 1999 Free Software Foundation, Inc.
3 Contributed by Philip Blundell <philb@gnu.org>
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 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 #define SUBTARGET_EXTRA_ASM_SPEC \
23 " %{fPIC:-k} %{fpic:-k}"
25 /* This was defined in linux.h. Define it here also. */
26 #undef DEFAULT_VTABLE_THUNKS
27 #define DEFAULT_VTABLE_THUNKS 1
29 /* Handle #pragma weak and #pragma pack. */
30 #define HANDLE_SYSV_PRAGMA
32 /* Now we define the strings used to build the spec file. */
33 #define LIB_SPEC \
34 "%{shared: -lc} \
35 %{!shared: %{pthread:-lpthread} \
36 %{profile:-lc_p} %{!profile: -lc}}"
38 /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
39 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
40 provides part of the support for getting C++ file-scope static
41 object constructed before entering `main'. */
43 #define STARTFILE_SPEC \
44 "%{!shared: \
45 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
46 %{!p:%{profile:gcrt1.o%s} \
47 %{!profile:crt1.o%s}}}} \
48 crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
50 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
51 the GNU/Linux magical crtend.o file (see crtstuff.c) which
52 provides part of the support for getting C++ file-scope static
53 object constructed before entering `main', followed by a normal
54 GNU/Linux "finalizer" file, `crtn.o'. */
56 #define ENDFILE_SPEC \
57 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
59 #define LINK_SPEC "%{h*} %{version:-v} \
60 %{b} %{Wl,*:%*} \
61 %{static:-Bstatic} \
62 %{shared:-shared} \
63 %{symbolic:-Bsymbolic} \
64 %{rdynamic:-export-dynamic} \
65 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
66 -X -mno-fpu -p \
67 %{mbig-endian:-EB} \
68 -m armelf_linux"
70 #define CPP_PREDEFINES \
71 "-Dunix -Dthumb -D__thumb -Dlinux \
72 -Asystem(unix) -Asystem(posix) -Acpu(arm) \
73 -Amachine(arm) -D__ELF__"
75 /* Allow #sccs in preprocessor. */
76 #define SCCS_DIRECTIVE
78 #define USER_LABEL_PREFIX "" /* For ELF the default is no underscores */
79 #define LOCAL_LABEL_PREFIX "."
81 /* Attach a special .ident directive to the end of the file to identify
82 the version of GCC which compiled this code. */
83 #define IDENT_ASM_OP ".ident"
85 /* Output #ident as a .ident. */
86 #define ASM_OUTPUT_IDENT(FILE, NAME) \
87 fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
89 #ifdef IDENTIFY_WITH_IDENT
90 #define ASM_IDENTIFY_GCC(FILE) /* nothing */
91 #define ASM_IDENTIFY_LANGUAGE(FILE) \
92 fprintf (FILE, "\t%s \"GCC (%s) %s\"\n", IDENT_ASM_OP, \
93 lang_identify (), version_string)
94 #else
95 #define ASM_FILE_END(FILE) \
96 do \
97 { \
98 if (!flag_no_ident) \
99 fprintf (FILE, "\t%s\t\"GCC: (GNU) %s\"\n", \
100 IDENT_ASM_OP, version_string); \
102 while (0)
103 #endif
105 /* Support const sections and the ctors and dtors sections for g++.
106 Note that there appears to be two different ways to support const
107 sections at the moment. You can either #define the symbol
108 READONLY_DATA_SECTION (giving it some code which switches to the
109 readonly data section) or else you can #define the symbols
110 EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, SELECT_SECTION, and
111 SELECT_RTX_SECTION. We do both here just to be on the safe side. */
112 #define USE_CONST_SECTION 1
114 /* Support for Constructors and Destructors. */
115 #define READONLY_DATA_SECTION() const_section ()
117 /* A default list of other sections which we might be "in" at any given
118 time. For targets that use additional sections (e.g. .tdesc) you
119 should override this definition in the target-specific file which
120 includes this file. */
121 #define SUBTARGET_EXTRA_SECTIONS in_const,
123 /* A default list of extra section function definitions. For targets
124 that use additional sections (e.g. .tdesc) you should override this
125 definition in the target-specific file which includes this file. */
126 #define SUBTARGET_EXTRA_SECTION_FUNCTIONS CONST_SECTION_FUNCTION
128 #define CONST_SECTION_ASM_OP ".section\t.rodata"
130 #define CONST_SECTION_FUNCTION \
131 void \
132 const_section () \
134 if (!USE_CONST_SECTION) \
135 text_section (); \
136 else if (in_section != in_const) \
138 fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \
139 in_section = in_const; \
143 /* A C statement or statements to switch to the appropriate
144 section for output of DECL. DECL is either a `VAR_DECL' node
145 or a constant of some sort. RELOC indicates whether forming
146 the initial value of DECL requires link-time relocations. */
147 #define SELECT_SECTION(DECL, RELOC) \
149 if (TREE_CODE (DECL) == STRING_CST) \
151 if (! flag_writable_strings) \
152 const_section (); \
153 else \
154 data_section (); \
156 else if (TREE_CODE (DECL) == VAR_DECL) \
158 if ((flag_pic && RELOC) \
159 || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \
160 || !DECL_INITIAL (DECL) \
161 || (DECL_INITIAL (DECL) != error_mark_node \
162 && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \
163 data_section (); \
164 else \
165 const_section (); \
167 else \
168 const_section (); \
171 /* A C statement or statements to switch to the appropriate
172 section for output of RTX in mode MODE. RTX is some kind
173 of constant in RTL. The argument MODE is redundant except
174 in the case of a `const_int' rtx. Currently, these always
175 go into the const section. */
176 #define SELECT_RTX_SECTION(MODE, RTX) const_section ()
178 /* On svr4, we *do* have support for the .init and .fini sections, and we
179 can put stuff in there to be executed before and after `main'. We let
180 crtstuff.c and other files know this by defining the following symbols.
181 The definitions say how to change sections to the .init and .fini
182 sections. This is the same for all known svr4 assemblers. */
183 #define INIT_SECTION_ASM_OP ".section\t.init"
184 #define FINI_SECTION_ASM_OP ".section\t.fini"
187 /* This is how we tell the assembler that a symbol is weak. */
188 #define ASM_WEAKEN_LABEL(FILE, NAME) \
189 do \
191 fputs ("\t.weak\t", FILE); \
192 assemble_name (FILE, NAME); \
193 fputc ('\n', FILE); \
195 while (0)
197 #include "arm/telf.h"
198 #include "arm/linux-tgas.h"
200 /* Run-time Target Specification. */
201 #undef TARGET_VERSION
202 #define TARGET_VERSION fputs (" (Thumb GNU/Linux)", stderr);