som.h revision 1.1.1.1.8.2 1 1.1.1.1.8.2 tls /* Definitions for SOM assembler support.
2 1.1.1.1.8.2 tls Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation,
3 1.1.1.1.8.2 tls Inc.
4 1.1.1.1.8.2 tls
5 1.1.1.1.8.2 tls This file is part of GCC.
6 1.1.1.1.8.2 tls
7 1.1.1.1.8.2 tls GCC is free software; you can redistribute it and/or modify
8 1.1.1.1.8.2 tls it under the terms of the GNU General Public License as published by
9 1.1.1.1.8.2 tls the Free Software Foundation; either version 3, or (at your option)
10 1.1.1.1.8.2 tls any later version.
11 1.1.1.1.8.2 tls
12 1.1.1.1.8.2 tls GCC is distributed in the hope that it will be useful,
13 1.1.1.1.8.2 tls but WITHOUT ANY WARRANTY; without even the implied warranty of
14 1.1.1.1.8.2 tls MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 1.1.1.1.8.2 tls GNU General Public License for more details.
16 1.1.1.1.8.2 tls
17 1.1.1.1.8.2 tls You should have received a copy of the GNU General Public License
18 1.1.1.1.8.2 tls along with GCC; see the file COPYING3. If not see
19 1.1.1.1.8.2 tls <http://www.gnu.org/licenses/>. */
20 1.1.1.1.8.2 tls
21 1.1.1.1.8.2 tls /* So we can conditionalize small amounts of code in pa.c or pa.md. */
22 1.1.1.1.8.2 tls #undef TARGET_SOM
23 1.1.1.1.8.2 tls #define TARGET_SOM 1
24 1.1.1.1.8.2 tls
25 1.1.1.1.8.2 tls /* We do not use BINCL stabs in SOM.
26 1.1.1.1.8.2 tls ??? If it does not hurt, we probably should to avoid useless divergence
27 1.1.1.1.8.2 tls from other embedded stabs implementations. */
28 1.1.1.1.8.2 tls #undef DBX_USE_BINCL
29 1.1.1.1.8.2 tls
30 1.1.1.1.8.2 tls #define DBX_LINES_FUNCTION_RELATIVE 1
31 1.1.1.1.8.2 tls
32 1.1.1.1.8.2 tls /* gdb needs a null N_SO at the end of each file for scattered loading. */
33 1.1.1.1.8.2 tls
34 1.1.1.1.8.2 tls #define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
35 1.1.1.1.8.2 tls
36 1.1.1.1.8.2 tls /* HPUX has a program 'chatr' to list the dependencies of dynamically
37 1.1.1.1.8.2 tls linked executables and shared libraries. */
38 1.1.1.1.8.2 tls #define LDD_SUFFIX "chatr"
39 1.1.1.1.8.2 tls /* Look for lines like "dynamic /usr/lib/X11R5/libX11.sl"
40 1.1.1.1.8.2 tls or "static /usr/lib/X11R5/libX11.sl".
41 1.1.1.1.8.2 tls
42 1.1.1.1.8.2 tls HPUX 10.20 also has lines like "static branch prediction ..."
43 1.1.1.1.8.2 tls so we filter that out explicitly.
44 1.1.1.1.8.2 tls
45 1.1.1.1.8.2 tls We also try to bound our search for libraries with marker
46 1.1.1.1.8.2 tls lines. What a pain. */
47 1.1.1.1.8.2 tls #define PARSE_LDD_OUTPUT(PTR) \
48 1.1.1.1.8.2 tls do { \
49 1.1.1.1.8.2 tls static int in_shlib_list = 0; \
50 1.1.1.1.8.2 tls while (*PTR == ' ') PTR++; \
51 1.1.1.1.8.2 tls if (strncmp (PTR, "shared library list:", \
52 1.1.1.1.8.2 tls sizeof ("shared library list:") - 1) == 0) \
53 1.1.1.1.8.2 tls { \
54 1.1.1.1.8.2 tls PTR = 0; \
55 1.1.1.1.8.2 tls in_shlib_list = 1; \
56 1.1.1.1.8.2 tls } \
57 1.1.1.1.8.2 tls else if (strncmp (PTR, "shared library binding:", \
58 1.1.1.1.8.2 tls sizeof ("shared library binding:") - 1) == 0)\
59 1.1.1.1.8.2 tls { \
60 1.1.1.1.8.2 tls PTR = 0; \
61 1.1.1.1.8.2 tls in_shlib_list = 0; \
62 1.1.1.1.8.2 tls } \
63 1.1.1.1.8.2 tls else if (strncmp (PTR, "static branch prediction disabled", \
64 1.1.1.1.8.2 tls sizeof ("static branch prediction disabled") - 1) == 0)\
65 1.1.1.1.8.2 tls { \
66 1.1.1.1.8.2 tls PTR = 0; \
67 1.1.1.1.8.2 tls in_shlib_list = 0; \
68 1.1.1.1.8.2 tls } \
69 1.1.1.1.8.2 tls else if (in_shlib_list \
70 1.1.1.1.8.2 tls && strncmp (PTR, "dynamic", sizeof ("dynamic") - 1) == 0) \
71 1.1.1.1.8.2 tls { \
72 1.1.1.1.8.2 tls PTR += sizeof ("dynamic") - 1; \
73 1.1.1.1.8.2 tls while (*p == ' ') PTR++; \
74 1.1.1.1.8.2 tls } \
75 1.1.1.1.8.2 tls else if (in_shlib_list \
76 1.1.1.1.8.2 tls && strncmp (PTR, "static", sizeof ("static") - 1) == 0) \
77 1.1.1.1.8.2 tls { \
78 1.1.1.1.8.2 tls PTR += sizeof ("static") - 1; \
79 1.1.1.1.8.2 tls while (*p == ' ') PTR++; \
80 1.1.1.1.8.2 tls } \
81 1.1.1.1.8.2 tls else \
82 1.1.1.1.8.2 tls PTR = 0; \
83 1.1.1.1.8.2 tls } while (0)
84 1.1.1.1.8.2 tls
85 1.1.1.1.8.2 tls /* Output the label for a function definition. */
86 1.1.1.1.8.2 tls #ifndef HP_FP_ARG_DESCRIPTOR_REVERSED
87 1.1.1.1.8.2 tls #define ASM_DOUBLE_ARG_DESCRIPTORS(FILE, ARG0, ARG1) \
88 1.1.1.1.8.2 tls do { fprintf (FILE, ",ARGW%d=FR", (ARG0)); \
89 1.1.1.1.8.2 tls fprintf (FILE, ",ARGW%d=FU", (ARG1));} while (0)
90 1.1.1.1.8.2 tls #define DFMODE_RETURN_STRING ",RTNVAL=FU"
91 1.1.1.1.8.2 tls #define SFMODE_RETURN_STRING ",RTNVAL=FR"
92 1.1.1.1.8.2 tls #else
93 1.1.1.1.8.2 tls #define ASM_DOUBLE_ARG_DESCRIPTORS(FILE, ARG0, ARG1) \
94 1.1.1.1.8.2 tls do { fprintf (FILE, ",ARGW%d=FU", (ARG0)); \
95 1.1.1.1.8.2 tls fprintf (FILE, ",ARGW%d=FR", (ARG1));} while (0)
96 1.1.1.1.8.2 tls #define DFMODE_RETURN_STRING ",RTNVAL=FR"
97 1.1.1.1.8.2 tls #define SFMODE_RETURN_STRING ",RTNVAL=FU"
98 1.1.1.1.8.2 tls #endif
99 1.1.1.1.8.2 tls
100 1.1.1.1.8.2 tls
101 1.1.1.1.8.2 tls #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
103 1.1.1.1.8.2 tls do { tree fntype = TREE_TYPE (TREE_TYPE (DECL)); \
104 1.1.1.1.8.2 tls tree tree_type = TREE_TYPE (DECL); \
105 1.1.1.1.8.2 tls tree parm; \
106 1.1.1.1.8.2 tls int i; \
107 1.1.1.1.8.2 tls if (TREE_PUBLIC (DECL) || TARGET_GAS) \
108 1.1.1.1.8.2 tls { \
109 1.1.1.1.8.2 tls if (TREE_PUBLIC (DECL)) \
110 1.1.1.1.8.2 tls { \
111 1.1.1.1.8.2 tls fputs ("\t.EXPORT ", FILE); \
112 1.1.1.1.8.2 tls assemble_name (FILE, NAME); \
113 1.1.1.1.8.2 tls fputs (",ENTRY,PRIV_LEV=3", FILE); \
114 1.1.1.1.8.2 tls } \
115 1.1.1.1.8.2 tls else \
116 1.1.1.1.8.2 tls { \
117 1.1.1.1.8.2 tls fputs ("\t.PARAM ", FILE); \
118 1.1.1.1.8.2 tls assemble_name (FILE, NAME); \
119 1.1.1.1.8.2 tls fputs (",PRIV_LEV=3", FILE); \
120 1.1.1.1.8.2 tls } \
121 1.1.1.1.8.2 tls for (parm = DECL_ARGUMENTS (DECL), i = 0; parm && i < 4; \
122 1.1.1.1.8.2 tls parm = TREE_CHAIN (parm)) \
123 1.1.1.1.8.2 tls { \
124 1.1.1.1.8.2 tls if (TYPE_MODE (DECL_ARG_TYPE (parm)) == SFmode \
125 1.1.1.1.8.2 tls && ! TARGET_SOFT_FLOAT) \
126 1.1.1.1.8.2 tls fprintf (FILE, ",ARGW%d=FR", i++); \
127 1.1.1.1.8.2 tls else if (TYPE_MODE (DECL_ARG_TYPE (parm)) == DFmode \
128 1.1.1.1.8.2 tls && ! TARGET_SOFT_FLOAT) \
129 1.1.1.1.8.2 tls { \
130 1.1.1.1.8.2 tls if (i <= 2) \
131 1.1.1.1.8.2 tls { \
132 1.1.1.1.8.2 tls if (i == 1) i++; \
133 1.1.1.1.8.2 tls ASM_DOUBLE_ARG_DESCRIPTORS (FILE, i++, i++); \
134 1.1.1.1.8.2 tls } \
135 1.1.1.1.8.2 tls else \
136 1.1.1.1.8.2 tls break; \
137 1.1.1.1.8.2 tls } \
138 1.1.1.1.8.2 tls else \
139 1.1.1.1.8.2 tls { \
140 1.1.1.1.8.2 tls int arg_size = \
141 1.1.1.1.8.2 tls FUNCTION_ARG_SIZE (TYPE_MODE (DECL_ARG_TYPE (parm)),\
142 1.1.1.1.8.2 tls DECL_ARG_TYPE (parm)); \
143 1.1.1.1.8.2 tls /* Passing structs by invisible reference uses \
144 1.1.1.1.8.2 tls one general register. */ \
145 1.1.1.1.8.2 tls if (arg_size > 2 \
146 1.1.1.1.8.2 tls || TREE_ADDRESSABLE (DECL_ARG_TYPE (parm))) \
147 1.1.1.1.8.2 tls arg_size = 1; \
148 1.1.1.1.8.2 tls if (arg_size == 2 && i <= 2) \
149 1.1.1.1.8.2 tls { \
150 1.1.1.1.8.2 tls if (i == 1) i++; \
151 1.1.1.1.8.2 tls fprintf (FILE, ",ARGW%d=GR", i++); \
152 1.1.1.1.8.2 tls fprintf (FILE, ",ARGW%d=GR", i++); \
153 1.1.1.1.8.2 tls } \
154 1.1.1.1.8.2 tls else if (arg_size == 1) \
155 1.1.1.1.8.2 tls fprintf (FILE, ",ARGW%d=GR", i++); \
156 1.1.1.1.8.2 tls else \
157 1.1.1.1.8.2 tls i += arg_size; \
158 1.1.1.1.8.2 tls } \
159 1.1.1.1.8.2 tls } \
160 1.1.1.1.8.2 tls /* anonymous args */ \
161 1.1.1.1.8.2 tls if (TYPE_ARG_TYPES (tree_type) != 0 \
162 1.1.1.1.8.2 tls && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (tree_type)))\
163 1.1.1.1.8.2 tls != void_type_node)) \
164 1.1.1.1.8.2 tls { \
165 1.1.1.1.8.2 tls for (; i < 4; i++) \
166 1.1.1.1.8.2 tls fprintf (FILE, ",ARGW%d=GR", i); \
167 1.1.1.1.8.2 tls } \
168 1.1.1.1.8.2 tls if (TYPE_MODE (fntype) == DFmode && ! TARGET_SOFT_FLOAT) \
169 1.1.1.1.8.2 tls fputs (DFMODE_RETURN_STRING, FILE); \
170 1.1.1.1.8.2 tls else if (TYPE_MODE (fntype) == SFmode && ! TARGET_SOFT_FLOAT) \
171 1.1.1.1.8.2 tls fputs (SFMODE_RETURN_STRING, FILE); \
172 1.1.1.1.8.2 tls else if (fntype != void_type_node) \
173 1.1.1.1.8.2 tls fputs (",RTNVAL=GR", FILE); \
174 1.1.1.1.8.2 tls fputs ("\n", FILE); \
175 1.1.1.1.8.2 tls }} while (0)
176 1.1.1.1.8.2 tls
177 1.1.1.1.8.2 tls #define TARGET_ASM_FILE_START pa_som_file_start
178 1.1.1.1.8.2 tls #define TARGET_ASM_INIT_SECTIONS pa_som_asm_init_sections
179 1.1.1.1.8.2 tls
180 1.1.1.1.8.2 tls /* String to output before writable data. */
181 1.1.1.1.8.2 tls #define DATA_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\t.SUBSPA $DATA$\n"
182 1.1.1.1.8.2 tls
183 1.1.1.1.8.2 tls /* String to output before uninitialized data. */
184 1.1.1.1.8.2 tls #define BSS_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\t.SUBSPA $BSS$\n"
185 1.1.1.1.8.2 tls
186 1.1.1.1.8.2 tls /* This is how to output a command to make the user-level label
187 1.1.1.1.8.2 tls named NAME defined for reference from other files. We use
188 1.1.1.1.8.2 tls assemble_name_raw instead of assemble_name since a symbol in
189 1.1.1.1.8.2 tls a .IMPORT directive that isn't otherwise referenced is not
190 1.1.1.1.8.2 tls placed in the symbol table of the assembled object.
191 1.1.1.1.8.2 tls
192 1.1.1.1.8.2 tls Failure to import a function reference can cause the HP linker
193 1.1.1.1.8.2 tls to segmentation fault!
194 1.1.1.1.8.2 tls
195 1.1.1.1.8.2 tls Note that the SOM based tools need the symbol imported as a
196 1.1.1.1.8.2 tls CODE symbol, while the ELF based tools require the symbol to
197 1.1.1.1.8.2 tls be imported as an ENTRY symbol. */
198 1.1.1.1.8.2 tls
199 1.1.1.1.8.2 tls #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
200 1.1.1.1.8.2 tls pa_hpux_asm_output_external ((FILE), (DECL), (NAME))
201 1.1.1.1.8.2 tls #define ASM_OUTPUT_EXTERNAL_REAL(FILE, DECL, NAME) \
202 1.1.1.1.8.2 tls do { fputs ("\t.IMPORT ", FILE); \
203 1.1.1.1.8.2 tls assemble_name_raw (FILE, NAME); \
204 1.1.1.1.8.2 tls if (FUNCTION_NAME_P (NAME)) \
205 1.1.1.1.8.2 tls fputs (",CODE\n", FILE); \
206 1.1.1.1.8.2 tls else \
207 1.1.1.1.8.2 tls fputs (",DATA\n", FILE); \
208 1.1.1.1.8.2 tls } while (0)
209 1.1.1.1.8.2 tls
210 1.1.1.1.8.2 tls /* The bogus HP assembler requires ALL external references to be
211 1.1.1.1.8.2 tls "imported", even library calls. They look a bit different, so
212 1.1.1.1.8.2 tls here's this macro.
213 1.1.1.1.8.2 tls
214 1.1.1.1.8.2 tls Also note not all libcall names are passed to pa_encode_section_info
215 1.1.1.1.8.2 tls (__main for example). To make sure all libcall names have section
216 1.1.1.1.8.2 tls info recorded in them, we do it here.
217 1.1.1.1.8.2 tls
218 1.1.1.1.8.2 tls We must also ensure that a libcall that has been previously
219 1.1.1.1.8.2 tls exported is not subsequently imported since the HP assembler may
220 1.1.1.1.8.2 tls change the type from an ENTRY to a CODE symbol. This would make
221 1.1.1.1.8.2 tls the symbol local. We are forced to use the identifier node
222 1.1.1.1.8.2 tls associated with the real assembler name for this check as the
223 1.1.1.1.8.2 tls symbol_ref available in ASM_DECLARE_FUNCTION_NAME is not the
224 1.1.1.1.8.2 tls same as the one used here. As a result, we can't use flags
225 1.1.1.1.8.2 tls in the symbol_ref for this check. The identifier check assumes
226 1.1.1.1.8.2 tls assemble_external_libcall is called before the symbol is used. */
227 1.1.1.1.8.2 tls
228 1.1.1.1.8.2 tls #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, RTL) \
229 1.1.1.1.8.2 tls do { const char *name; \
230 1.1.1.1.8.2 tls tree id; \
231 1.1.1.1.8.2 tls \
232 1.1.1.1.8.2 tls if (!function_label_operand (RTL, VOIDmode)) \
233 1.1.1.1.8.2 tls hppa_encode_label (RTL); \
234 1.1.1.1.8.2 tls \
235 1.1.1.1.8.2 tls name = targetm.strip_name_encoding (XSTR ((RTL), 0)); \
236 1.1.1.1.8.2 tls id = maybe_get_identifier (name); \
237 1.1.1.1.8.2 tls if (!id || !TREE_SYMBOL_REFERENCED (id)) \
238 1.1.1.1.8.2 tls { \
239 1.1.1.1.8.2 tls fputs ("\t.IMPORT ", FILE); \
240 1.1.1.1.8.2 tls assemble_name_raw (FILE, XSTR ((RTL), 0)); \
241 1.1.1.1.8.2 tls fputs (",CODE\n", FILE); \
242 1.1.1.1.8.2 tls } \
243 1.1.1.1.8.2 tls } while (0)
244 1.1.1.1.8.2 tls
245 1.1.1.1.8.2 tls /* We want __gcc_plt_call to appear in every program built by
246 1.1.1.1.8.2 tls gcc, so we make a reference to it out of __main.
247 1.1.1.1.8.2 tls We use the asm statement to fool the optimizer into not
248 1.1.1.1.8.2 tls removing the dead (but important) initialization of
249 1.1.1.1.8.2 tls REFERENCE. */
250 1.1.1.1.8.2 tls
251 1.1.1.1.8.2 tls #define DO_GLOBAL_DTORS_BODY \
252 1.1.1.1.8.2 tls do { \
253 1.1.1.1.8.2 tls extern void __gcc_plt_call (void); \
254 1.1.1.1.8.2 tls void (*reference)(void) = &__gcc_plt_call; \
255 1.1.1.1.8.2 tls func_ptr *p; \
256 1.1.1.1.8.2 tls __asm__ ("" : : "r" (reference)); \
257 1.1.1.1.8.2 tls for (p = __DTOR_LIST__ + 1; *p; ) \
258 1.1.1.1.8.2 tls (*p++) (); \
259 1.1.1.1.8.2 tls } while (0)
260 1.1.1.1.8.2 tls
261 1.1.1.1.8.2 tls /* This macro specifies the biggest alignment supported by the object
262 1.1.1.1.8.2 tls file format of this machine.
263 1.1.1.1.8.2 tls
264 1.1.1.1.8.2 tls The .align directive in the HP assembler allows alignments up to 4096
265 1.1.1.1.8.2 tls bytes. However, the maximum alignment of a global common symbol is 8
266 1.1.1.1.8.2 tls bytes for objects smaller than the page size (4096 bytes). For larger
267 1.1.1.1.8.2 tls objects, the linker provides an alignment of 32 bytes. Unfortunately,
268 1.1.1.1.8.2 tls this macro doesn't provide a mechanism to test for common symbols. */
269 1.1.1.1.8.2 tls #define MAX_OFILE_ALIGNMENT 32768
270 1.1.1.1.8.2 tls
271 1.1.1.1.8.2 tls /* The SOM linker hardcodes paths into binaries. As a result, dotdots
272 1.1.1.1.8.2 tls must be removed from library prefixes to prevent binaries from depending
273 1.1.1.1.8.2 tls on the location of the GCC tool directory. The downside is GCC
274 1.1.1.1.8.2 tls cannot be moved after installation using a symlink. */
275 1.1.1.1.8.2 tls #define ALWAYS_STRIP_DOTDOT 1
276 1.1.1.1.8.2 tls
277 1.1.1.1.8.2 tls /* If GAS supports weak, we can support weak when we have working linker
278 1.1.1.1.8.2 tls support for secondary definitions and are generating code for GAS. */
279 1.1.1.1.8.2 tls #ifdef HAVE_GAS_WEAK
280 1.1.1.1.8.2 tls #define SUPPORTS_WEAK (TARGET_SOM_SDEF && TARGET_GAS)
281 1.1.1.1.8.2 tls #else
282 1.1.1.1.8.2 tls #define SUPPORTS_WEAK 0
283 1.1.1.1.8.2 tls #endif
284 1.1.1.1.8.2 tls
285 1.1.1.1.8.2 tls /* CVS GAS as of 4/28/04 supports a comdat parameter for the .nsubspa
286 1.1.1.1.8.2 tls directive. This provides one-only linkage semantics even though we
287 1.1.1.1.8.2 tls don't have weak support. */
288 1.1.1.1.8.2 tls #ifdef HAVE_GAS_NSUBSPA_COMDAT
289 1.1.1.1.8.2 tls #define SUPPORTS_SOM_COMDAT (TARGET_GAS)
290 1.1.1.1.8.2 tls #else
291 1.1.1.1.8.2 tls #define SUPPORTS_SOM_COMDAT 0
292 1.1.1.1.8.2 tls #endif
293 1.1.1.1.8.2 tls
294 1.1.1.1.8.2 tls /* We can support one only if we support weak or comdat. */
295 1.1.1.1.8.2 tls #define SUPPORTS_ONE_ONLY (SUPPORTS_WEAK || SUPPORTS_SOM_COMDAT)
296 1.1.1.1.8.2 tls
297 1.1.1.1.8.2 tls /* We use DECL_COMMON for uninitialized one-only variables as we don't
298 1.1.1.1.8.2 tls have linkonce .bss. We use SOM secondary definitions or comdat for
299 1.1.1.1.8.2 tls initialized variables and functions. */
300 1.1.1.1.8.2 tls #define MAKE_DECL_ONE_ONLY(DECL) \
301 1.1.1.1.8.2 tls do { \
302 1.1.1.1.8.2 tls if (TREE_CODE (DECL) == VAR_DECL \
303 1.1.1.1.8.2 tls && (DECL_INITIAL (DECL) == 0 \
304 1.1.1.1.8.2 tls || DECL_INITIAL (DECL) == error_mark_node)) \
305 1.1.1.1.8.2 tls DECL_COMMON (DECL) = 1; \
306 1.1.1.1.8.2 tls else if (SUPPORTS_WEAK) \
307 1.1.1.1.8.2 tls DECL_WEAK (DECL) = 1; \
308 1.1.1.1.8.2 tls } while (0)
309 1.1.1.1.8.2 tls
310 1.1.1.1.8.2 tls /* This is how we tell the assembler that a symbol is weak. The SOM
311 1.1.1.1.8.2 tls weak implementation uses the secondary definition (sdef) flag.
312 1.1.1.1.8.2 tls
313 1.1.1.1.8.2 tls The behavior of sdef symbols is similar to ELF weak symbols in that
314 1.1.1.1.8.2 tls multiple definitions can occur without incurring a link error.
315 1.1.1.1.8.2 tls However, they differ in the following ways:
316 1.1.1.1.8.2 tls 1) Undefined sdef symbols are not allowed.
317 1.1.1.1.8.2 tls 2) The linker searches for undefined sdef symbols and will load an
318 1.1.1.1.8.2 tls archive library member to resolve an undefined sdef symbol.
319 1.1.1.1.8.2 tls 3) The exported symbol from a shared library is a primary symbol
320 1.1.1.1.8.2 tls rather than a sdef symbol. Thus, more care is needed in the
321 1.1.1.1.8.2 tls ordering of libraries.
322 1.1.1.1.8.2 tls
323 1.1.1.1.8.2 tls It appears that the linker discards extra copies of "weak" functions
324 1.1.1.1.8.2 tls when linking shared libraries, independent of whether or not they
325 1.1.1.1.8.2 tls are in their own section. In linking final executables, -Wl,-O can
326 1.1.1.1.8.2 tls be used to remove dead procedures. Thus, support for named sections
327 1.1.1.1.8.2 tls is not needed and in previous testing caused problems with various
328 1.1.1.1.8.2 tls HP tools. */
329 1.1.1.1.8.2 tls #define ASM_WEAKEN_LABEL(FILE,NAME) \
330 1.1.1.1.8.2 tls do { fputs ("\t.weak\t", FILE); \
331 1.1.1.1.8.2 tls assemble_name (FILE, NAME); \
332 1.1.1.1.8.2 tls fputc ('\n', FILE); \
333 1.1.1.1.8.2 tls targetm.asm_out.globalize_label (FILE, NAME); \
334 1.1.1.1.8.2 tls } while (0)
335 1.1.1.1.8.2 tls
336 1.1.1.1.8.2 tls /* We can't handle weak aliases, and therefore can't support pragma weak.
337 1.1.1.1.8.2 tls Suppress the use of pragma weak in gthr-dce.h and gthr-posix.h. */
338 1.1.1.1.8.2 tls #define GTHREAD_USE_WEAK 0
339 1.1.1.1.8.2 tls
340 1.1.1.1.8.2 tls /* Shared library suffix. Collect2 strips the version string after
341 1.1.1.1.8.2 tls this suffix when generating constructor/destructor names. */
342 #define SHLIB_SUFFIX ".sl"
343