1/* Xtensa/Elf configuration.
2   Derived from the configuration for GCC for Intel i386 running Linux.
3   Copyright (C) 2001,2003 Free Software Foundation, Inc.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING.  If not, write to the Free
19Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
2002110-1301, USA.  */
21
22#define TARGET_SECTION_TYPE_FLAGS xtensa_multibss_section_type_flags
23
24/* Don't assume anything about the header files.  */
25#define NO_IMPLICIT_EXTERN_C
26
27#undef ASM_APP_ON
28#define ASM_APP_ON "#APP\n"
29
30#undef ASM_APP_OFF
31#define ASM_APP_OFF "#NO_APP\n"
32
33#undef MD_EXEC_PREFIX
34#undef MD_STARTFILE_PREFIX
35
36#undef TARGET_VERSION
37#define TARGET_VERSION fputs (" (Xtensa/ELF)", stderr);
38
39#undef WCHAR_TYPE
40#define WCHAR_TYPE "short unsigned int"
41
42#undef WCHAR_TYPE_SIZE
43#define WCHAR_TYPE_SIZE 16
44
45#undef ASM_SPEC
46#define ASM_SPEC \
47 "%{v} \
48  %{mtext-section-literals:--text-section-literals} \
49  %{mno-text-section-literals:--no-text-section-literals} \
50  %{mtarget-align:--target-align} \
51  %{mno-target-align:--no-target-align} \
52  %{mlongcalls:--longcalls} \
53  %{mno-longcalls:--no-longcalls}"
54
55#undef LIB_SPEC
56#define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
57
58#undef STARTFILE_SPEC
59#define STARTFILE_SPEC \
60  "crt1-sim%O%s crt0%O%s crti%O%s crtbegin%O%s _vectors%O%s"
61
62#undef ENDFILE_SPEC
63#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
64
65#undef LINK_SPEC
66#define LINK_SPEC \
67 "%{shared:-shared} \
68  %{!shared: \
69    %{!static: \
70      %{rdynamic:-export-dynamic} \
71    %{static:-static}}}"
72
73#undef LOCAL_LABEL_PREFIX
74#define LOCAL_LABEL_PREFIX	"."
75
76/* Avoid dots for compatibility with VxWorks.  */
77#undef NO_DOLLAR_IN_LABEL
78#define NO_DOT_IN_LABEL
79
80/* Do not force "-fpic" for this target.  */
81#define XTENSA_ALWAYS_PIC 0
82
83/* Redefine the standard ELF version of ASM_DECLARE_FUNCTION_SIZE to
84   allow adding the ".end literal_prefix" directive at the end of the
85   function.  */
86#undef ASM_DECLARE_FUNCTION_SIZE
87#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)		\
88  do								\
89    {								\
90      if (!flag_inhibit_size_directive)				\
91	ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);			\
92      XTENSA_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL);		\
93    }								\
94  while (0)
95
96/* Search for headers in $tooldir/arch/include and for libraries and
97   startfiles in $tooldir/arch/lib.  */
98#define GCC_DRIVER_HOST_INITIALIZATION \
99do \
100{ \
101  char *tooldir, *archdir; \
102  tooldir = concat (tooldir_base_prefix, spec_machine, \
103		    dir_separator_str, NULL); \
104  if (!IS_ABSOLUTE_PATH (tooldir)) \
105    tooldir = concat (standard_exec_prefix, spec_machine, dir_separator_str, \
106		      spec_version, dir_separator_str, tooldir, NULL); \
107  archdir = concat (tooldir, "arch", dir_separator_str, NULL); \
108  add_prefix (&startfile_prefixes, \
109	      concat (archdir, "lib", dir_separator_str, NULL), \
110	      "GCC", PREFIX_PRIORITY_LAST, 0, 1); \
111  add_prefix (&include_prefixes, archdir, \
112	      "GCC", PREFIX_PRIORITY_LAST, 0, 0); \
113  } \
114while (0)
115
116