]>
Commit | Line | Data |
---|---|---|
b355a481 | 1 | /* Definitions for non-Linux based ARM systems using ELF |
f22db2ef | 2 | Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
b355a481 NC |
3 | Contributed by Catherine Moore <clm@cygnus.com> |
4 | ||
5 | This file is part of GNU CC. | |
6 | ||
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. | |
11 | ||
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. | |
16 | ||
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. */ | |
21 | ||
be393ecf NC |
22 | /* elfos.h should have already been included. Now just override |
23 | any conflicting definitions and add any extras. */ | |
24 | ||
b355a481 | 25 | /* Run-time Target Specification. */ |
e6592fff | 26 | #ifndef TARGET_VERSION |
7b07d808 | 27 | #define TARGET_VERSION fputs (" (ARM/ELF)", stderr); |
e6592fff | 28 | #endif |
b355a481 | 29 | |
b355a481 | 30 | /* Default to using APCS-32 and software floating point. */ |
0122a613 | 31 | #ifndef TARGET_DEFAULT |
d5b7b3ae | 32 | #define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME) |
0122a613 | 33 | #endif |
b355a481 NC |
34 | |
35 | /* Now we define the strings used to build the spec file. */ | |
be393ecf NC |
36 | #undef STARTFILE_SPEC |
37 | #define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s" | |
b355a481 | 38 | |
be393ecf NC |
39 | #undef ENDFILE_SPEC |
40 | #define ENDFILE_SPEC "crtend%O%s crtn%O%s" | |
b355a481 | 41 | |
be393ecf NC |
42 | /* The __USES_INITFINI__ define is tested in newlib/libc/sys/arm/crt0.S |
43 | to see if it needs to invoked _init() and _fini(). */ | |
44 | #undef SUBTARGET_CPP_SPEC | |
45 | #define SUBTARGET_CPP_SPEC "-D__ELF__ -D__USES_INITFINI__" | |
b355a481 | 46 | |
be393ecf | 47 | #undef PREFERRED_DEBUGGING_TYPE |
b355a481 NC |
48 | #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG |
49 | ||
a56e7c08 NC |
50 | /* Return a non-zero value if DECL has a section attribute. */ |
51 | #define IN_NAMED_SECTION(DECL) \ | |
52 | ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \ | |
53 | && DECL_SECTION_NAME (DECL) != NULL_TREE) | |
54 | ||
a56e7c08 NC |
55 | #undef ASM_OUTPUT_ALIGNED_BSS |
56 | #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ | |
57 | do \ | |
58 | { \ | |
59 | if (IN_NAMED_SECTION (DECL)) \ | |
60 | named_section (DECL, NULL, 0); \ | |
61 | else \ | |
62 | bss_section (); \ | |
63 | \ | |
5eb99654 | 64 | (*targetm.asm_out.globalize_label) (FILE, NAME); \ |
a56e7c08 NC |
65 | \ |
66 | ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \ | |
67 | \ | |
68 | last_assemble_variable_decl = DECL; \ | |
69 | ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \ | |
70 | ASM_OUTPUT_SKIP (FILE, SIZE ? SIZE : 1); \ | |
71 | } \ | |
72 | while (0) | |
73 | ||
74 | #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL | |
75 | #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ | |
76 | do \ | |
77 | { \ | |
648f5f04 | 78 | if ((DECL) != NULL && IN_NAMED_SECTION (DECL)) \ |
a56e7c08 NC |
79 | named_section (DECL, NULL, 0); \ |
80 | else \ | |
81 | bss_section (); \ | |
82 | \ | |
83 | ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \ | |
84 | ASM_OUTPUT_LABEL (FILE, NAME); \ | |
85 | fprintf (FILE, "\t.space\t%d\n", SIZE); \ | |
86 | } \ | |
87 | while (0) | |
b355a481 | 88 | |
0122a613 | 89 | #ifndef CPP_APCS_PC_DEFAULT_SPEC |
b355a481 | 90 | #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" |
0122a613 NC |
91 | #endif |
92 | ||
93 | #ifndef SUBTARGET_CPU_DEFAULT | |
b355a481 | 94 | #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi |
0122a613 | 95 | #endif |
d5b7b3ae | 96 |