* config/sol2.h (ASM_SPEC): Split into ...
[official-gcc.git] / gcc / config / i386 / sol2.h
blob593e256c164d6eaab2857b52281505d671ea26b9
1 /* Target definitions for GCC for Intel 80386 running Solaris 2
2 Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
4 Contributed by Fred Fish (fnf@cygnus.com).
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
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/>. */
22 /* Augment i386/unix.h version to return 8-byte vectors in memory, matching
23 Sun Studio compilers until version 12, the only ones supported on
24 Solaris 8 and 9. */
25 #undef TARGET_SUBTARGET_DEFAULT
26 #define TARGET_SUBTARGET_DEFAULT \
27 (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
29 /* Old versions of the Solaris assembler can not handle the difference of
30 labels in different sections, so force DW_EH_PE_datarel. */
31 #undef ASM_PREFERRED_EH_DATA_FORMAT
32 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
33 (flag_pic ? ((GLOBAL ? DW_EH_PE_indirect : 0) \
34 | (TARGET_64BIT ? DW_EH_PE_pcrel | DW_EH_PE_sdata4 \
35 : DW_EH_PE_datarel)) \
36 : DW_EH_PE_absptr)
38 /* The Solaris linker will not merge a read-only .eh_frame section
39 with a read-write .eh_frame section. None of the encodings used
40 with non-PIC code require runtime relocations. In 64-bit mode,
41 since there is no backwards compatibility issue, we use a read-only
42 section for .eh_frame. In 32-bit mode, we use a writable .eh_frame
43 section in order to be compatible with G++ for Solaris x86. */
44 #undef EH_TABLES_CAN_BE_READ_ONLY
45 #define EH_TABLES_CAN_BE_READ_ONLY (TARGET_64BIT)
47 /* Follow Sun requirements for TLS code sequences and use Sun assembler TLS
48 syntax. */
49 #undef TARGET_SUN_TLS
50 #define TARGET_SUN_TLS 1
52 #undef SIZE_TYPE
53 #define SIZE_TYPE "unsigned int"
55 #undef PTRDIFF_TYPE
56 #define PTRDIFF_TYPE "int"
58 /* Solaris 2/Intel as chokes on #line directives before Solaris 10. */
59 #undef CPP_SPEC
60 #define CPP_SPEC "%{,assembler-with-cpp:-P} %(cpp_subtarget)"
62 #define ASM_CPU_SPEC ""
64 /* Don't include ASM_PIC_SPEC. While the Solaris 8 and 9 assembler accepts
65 -K PIC, it gives many warnings:
66 R_386_32 relocation is used for symbol "<symbol>"
67 GNU as doesn't recognize -K at all. */
68 #undef ASM_SPEC
69 #define ASM_SPEC ASM_SPEC_BASE
71 #define SUBTARGET_CPU_EXTRA_SPECS \
72 { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
73 { "asm_cpu", ASM_CPU_SPEC }
75 #undef SUBTARGET_EXTRA_SPECS
76 #define SUBTARGET_EXTRA_SPECS \
77 { "startfile_arch", STARTFILE_ARCH_SPEC }, \
78 { "link_arch", LINK_ARCH_SPEC }, \
79 SUBTARGET_CPU_EXTRA_SPECS
81 /* Register the Solaris-specific #pragma directives. */
82 #define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
84 #undef LOCAL_LABEL_PREFIX
85 #define LOCAL_LABEL_PREFIX "."
87 /* The 32-bit Solaris assembler does not support .quad. Do not use it. */
88 #ifndef HAVE_AS_IX86_QUAD
89 #undef ASM_QUAD
90 #endif
92 /* The Solaris assembler wants a .local for non-exported aliases. */
93 #define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
94 do { \
95 const char *declname = \
96 IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
97 ASM_OUTPUT_DEF ((FILE), declname, \
98 IDENTIFIER_POINTER (TARGET)); \
99 if (! TREE_PUBLIC (DECL)) \
101 fprintf ((FILE), "%s", LOCAL_ASM_OP); \
102 assemble_name ((FILE), declname); \
103 fprintf ((FILE), "\n"); \
105 } while (0)
107 #ifndef USE_GAS
108 /* The Sun assembler uses .tcomm for TLS common sections. */
109 #define TLS_COMMON_ASM_OP ".tcomm"
111 /* Similar to the Sun assembler on SPARC, the native assembler requires
112 TLS objects to be declared as @tls_obj (not @tls_object). Unlike SPARC,
113 gas doesn't understand this variant. */
114 #undef ASM_DECLARE_OBJECT_NAME
115 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
116 do \
118 HOST_WIDE_INT size; \
120 if (targetm.have_tls && DECL_THREAD_LOCAL_P (DECL)) \
121 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "tls_obj"); \
122 else \
123 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
125 size_directive_output = 0; \
126 if (!flag_inhibit_size_directive \
127 && (DECL) && DECL_SIZE (DECL)) \
129 size_directive_output = 1; \
130 size = int_size_in_bytes (TREE_TYPE (DECL)); \
131 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
134 ASM_OUTPUT_LABEL (FILE, NAME); \
136 while (0)
137 #endif /* !USE_GAS */
139 /* Output a simple call for .init/.fini. */
140 #define ASM_OUTPUT_CALL(FILE, FN) \
141 do \
143 fprintf (FILE, "\tcall\t"); \
144 ix86_print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P'); \
145 fprintf (FILE, "\n"); \
147 while (0)
149 #undef TARGET_ASM_NAMED_SECTION
150 #define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
152 /* We do not need NT_VERSION notes. */
153 #undef X86_FILE_START_VERSION_DIRECTIVE
154 #define X86_FILE_START_VERSION_DIRECTIVE false
156 /* Only recent versions of Solaris 11 ld properly support hidden .gnu.linkonce
157 sections, so don't use them. */
158 #ifndef USE_GLD
159 #define USE_HIDDEN_LINKONCE 0
160 #endif
162 /* Put all *tf routines in libgcc. */
163 #undef LIBGCC2_HAS_TF_MODE
164 #define LIBGCC2_HAS_TF_MODE 1
165 #define LIBGCC2_TF_CEXT q
166 #define TF_SIZE 113