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