0
|
1 /* Definitions for non-Linux based ARM systems using ELF
|
|
2 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, 2008
|
|
3 Free Software Foundation, Inc.
|
|
4 Contributed by Catherine Moore <clm@cygnus.com>
|
|
5
|
|
6 This file is part of GCC.
|
|
7
|
|
8 GCC is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published
|
|
10 by the Free Software Foundation; either version 3, or (at your
|
|
11 option) any later version.
|
|
12
|
|
13 GCC is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
|
16 License for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with GCC; see the file COPYING3. If not see
|
|
20 <http://www.gnu.org/licenses/>. */
|
|
21
|
|
22 /* elfos.h should have already been included. Now just override
|
|
23 any conflicting definitions and add any extras. */
|
|
24
|
|
25 /* Run-time Target Specification. */
|
|
26 #ifndef TARGET_VERSION
|
|
27 #define TARGET_VERSION fputs (" (ARM/ELF)", stderr);
|
|
28 #endif
|
|
29
|
|
30 /* Default to using software floating point. */
|
|
31 #ifndef TARGET_DEFAULT
|
|
32 #define TARGET_DEFAULT (0)
|
|
33 #endif
|
|
34
|
|
35 /* Now we define the strings used to build the spec file. */
|
|
36 #define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
|
|
37
|
|
38 #undef STARTFILE_SPEC
|
|
39 #define STARTFILE_SPEC UNKNOWN_ELF_STARTFILE_SPEC
|
|
40
|
|
41 #define UNKNOWN_ELF_ENDFILE_SPEC "crtend%O%s crtn%O%s"
|
|
42
|
|
43 #undef ENDFILE_SPEC
|
|
44 #define ENDFILE_SPEC UNKNOWN_ELF_ENDFILE_SPEC
|
|
45
|
|
46 /* The __USES_INITFINI__ define is tested in newlib/libc/sys/arm/crt0.S
|
|
47 to see if it needs to invoked _init() and _fini(). */
|
|
48 #undef SUBTARGET_CPP_SPEC
|
|
49 #define SUBTARGET_CPP_SPEC "-D__USES_INITFINI__"
|
|
50
|
|
51 #undef PREFERRED_DEBUGGING_TYPE
|
|
52 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
|
53
|
|
54 /* Return a nonzero value if DECL has a section attribute. */
|
|
55 #define IN_NAMED_SECTION(DECL) \
|
|
56 ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
|
|
57 && DECL_SECTION_NAME (DECL) != NULL_TREE)
|
|
58
|
|
59 #undef ASM_OUTPUT_ALIGNED_BSS
|
|
60 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
|
61 do \
|
|
62 { \
|
|
63 if (IN_NAMED_SECTION (DECL)) \
|
|
64 switch_to_section (get_named_section (DECL, NULL, 0)); \
|
|
65 else \
|
|
66 switch_to_section (bss_section); \
|
|
67 \
|
|
68 ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
|
|
69 \
|
|
70 last_assemble_variable_decl = DECL; \
|
|
71 ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
|
|
72 ASM_OUTPUT_SKIP (FILE, SIZE ? (int)(SIZE) : 1); \
|
|
73 } \
|
|
74 while (0)
|
|
75
|
|
76 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
|
|
77 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
|
|
78 do \
|
|
79 { \
|
|
80 if ((DECL) != NULL && IN_NAMED_SECTION (DECL)) \
|
|
81 switch_to_section (get_named_section (DECL, NULL, 0)); \
|
|
82 else \
|
|
83 switch_to_section (bss_section); \
|
|
84 \
|
|
85 ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
|
|
86 ASM_OUTPUT_LABEL (FILE, NAME); \
|
|
87 fprintf (FILE, "\t.space\t%d\n", SIZE ? (int)(SIZE) : 1); \
|
|
88 } \
|
|
89 while (0)
|
|
90
|
|
91 #ifndef SUBTARGET_CPU_DEFAULT
|
|
92 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi
|
|
93 #endif
|
|
94
|
|
95 /* The libgcc udivmod functions may throw exceptions. If newlib is
|
|
96 configured to support long longs in I/O, then printf will depend on
|
|
97 udivmoddi4, which will depend on the exception unwind routines,
|
|
98 which will depend on abort, which is defined in libc. */
|
|
99 #undef LINK_GCC_C_SEQUENCE_SPEC
|
|
100 #define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group"
|