OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [config/] [rs6000/] [sysv4.h] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* Target definitions for GNU compiler for PowerPC running System V.4
2
   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3
   2004, 2005, 2006 Free Software Foundation, Inc.
4
   Contributed by Cygnus Support.
5
 
6
   This file is part of GCC.
7
 
8
   GCC is free software; you can redistribute it and/or modify it
9
   under the terms of the GNU General Public License as published
10
   by the Free Software Foundation; either version 2, or (at your
11
   option) any later version.
12
 
13
   GCC is distributed in the hope that it will be useful, but WITHOUT
14
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16
   License for more details.
17
 
18
   You should have received a copy of the GNU General Public License
19
   along with GCC; see the file COPYING.  If not, write to the
20
   Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
21
   MA 02110-1301, USA.  */
22
 
23
/* Header files should be C++ aware in general.  */
24
#undef  NO_IMPLICIT_EXTERN_C
25
#define NO_IMPLICIT_EXTERN_C
26
 
27
/* Yes!  We are ELF.  */
28
#define TARGET_OBJECT_FORMAT OBJECT_ELF
29
 
30
/* Default ABI to compile code for.  */
31
#define DEFAULT_ABI rs6000_current_abi
32
 
33
/* Default ABI to use.  */
34
#define RS6000_ABI_NAME "sysv"
35
 
36
/* Override rs6000.h definition.  */
37
#undef  ASM_DEFAULT_SPEC
38
#define ASM_DEFAULT_SPEC "-mppc"
39
 
40
/* Small data support types.  */
41
enum rs6000_sdata_type {
42
  SDATA_NONE,                   /* No small data support.  */
43
  SDATA_DATA,                   /* Just put data in .sbss/.sdata, don't use relocs.  */
44
  SDATA_SYSV,                   /* Use r13 to point to .sdata/.sbss.  */
45
  SDATA_EABI                    /* Use r13 like above, r2 points to .sdata2/.sbss2.  */
46
};
47
 
48
extern enum rs6000_sdata_type rs6000_sdata;
49
 
50
#define TARGET_TOC              ((target_flags & MASK_64BIT)            \
51
                                 || ((target_flags & (MASK_RELOCATABLE  \
52
                                                      | MASK_MINIMAL_TOC)) \
53
                                     && flag_pic > 1)                   \
54
                                 || DEFAULT_ABI == ABI_AIX)
55
 
56
#define TARGET_BITFIELD_TYPE    (! TARGET_NO_BITFIELD_TYPE)
57
#define TARGET_BIG_ENDIAN       (! TARGET_LITTLE_ENDIAN)
58
#define TARGET_NO_PROTOTYPE     (! TARGET_PROTOTYPE)
59
#define TARGET_NO_TOC           (! TARGET_TOC)
60
#define TARGET_NO_EABI          (! TARGET_EABI)
61
 
62
#ifdef HAVE_AS_REL16
63
#undef TARGET_SECURE_PLT
64
#define TARGET_SECURE_PLT       secure_plt
65
#endif
66
 
67
extern const char *rs6000_abi_name;
68
extern const char *rs6000_sdata_name;
69
extern const char *rs6000_tls_size_string; /* For -mtls-size= */
70
 
71
#define SDATA_DEFAULT_SIZE 8
72
 
73
/* Sometimes certain combinations of command options do not make sense
74
   on a particular target machine.  You can define a macro
75
   `OVERRIDE_OPTIONS' to take account of this.  This macro, if
76
   defined, is executed once just after all the command options have
77
   been parsed.
78
 
79
   The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
80
   get control.  */
81
 
82
#define SUBTARGET_OVERRIDE_OPTIONS                                      \
83
do {                                                                    \
84
  if (!g_switch_set)                                                    \
85
    g_switch_value = SDATA_DEFAULT_SIZE;                                \
86
                                                                        \
87
  if (rs6000_abi_name == NULL)                                          \
88
    rs6000_abi_name = RS6000_ABI_NAME;                                  \
89
                                                                        \
90
  if (!strcmp (rs6000_abi_name, "sysv"))                                \
91
    rs6000_current_abi = ABI_V4;                                        \
92
  else if (!strcmp (rs6000_abi_name, "sysv-noeabi"))                    \
93
    {                                                                   \
94
      rs6000_current_abi = ABI_V4;                                      \
95
      target_flags &= ~ MASK_EABI;                                      \
96
    }                                                                   \
97
  else if (!strcmp (rs6000_abi_name, "sysv-eabi")                       \
98
           || !strcmp (rs6000_abi_name, "eabi"))                        \
99
    {                                                                   \
100
      rs6000_current_abi = ABI_V4;                                      \
101
      target_flags |= MASK_EABI;                                        \
102
    }                                                                   \
103
  else if (!strcmp (rs6000_abi_name, "aixdesc"))                        \
104
    rs6000_current_abi = ABI_AIX;                                       \
105
  else if (!strcmp (rs6000_abi_name, "freebsd"))                        \
106
    rs6000_current_abi = ABI_V4;                                        \
107
  else if (!strcmp (rs6000_abi_name, "linux"))                          \
108
    {                                                                   \
109
      if (TARGET_64BIT)                                                 \
110
        rs6000_current_abi = ABI_AIX;                                   \
111
      else                                                              \
112
        rs6000_current_abi = ABI_V4;                                    \
113
    }                                                                   \
114
  else if (!strcmp (rs6000_abi_name, "gnu"))                            \
115
    rs6000_current_abi = ABI_V4;                                        \
116
  else if (!strcmp (rs6000_abi_name, "netbsd"))                         \
117
    rs6000_current_abi = ABI_V4;                                        \
118
  else if (!strcmp (rs6000_abi_name, "openbsd"))                        \
119
    rs6000_current_abi = ABI_V4;                                        \
120
  else if (!strcmp (rs6000_abi_name, "i960-old"))                       \
121
    {                                                                   \
122
      rs6000_current_abi = ABI_V4;                                      \
123
      target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI                   \
124
                       | MASK_NO_BITFIELD_WORD);                        \
125
      target_flags &= ~MASK_STRICT_ALIGN;                               \
126
    }                                                                   \
127
  else                                                                  \
128
    {                                                                   \
129
      rs6000_current_abi = ABI_V4;                                      \
130
      error ("bad value for -mcall-%s", rs6000_abi_name);               \
131
    }                                                                   \
132
                                                                        \
133
  if (rs6000_sdata_name)                                                \
134
    {                                                                   \
135
      if (!strcmp (rs6000_sdata_name, "none"))                          \
136
        rs6000_sdata = SDATA_NONE;                                      \
137
      else if (!strcmp (rs6000_sdata_name, "data"))                     \
138
        rs6000_sdata = SDATA_DATA;                                      \
139
      else if (!strcmp (rs6000_sdata_name, "default"))                  \
140
        rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV;         \
141
      else if (!strcmp (rs6000_sdata_name, "sysv"))                     \
142
        rs6000_sdata = SDATA_SYSV;                                      \
143
      else if (!strcmp (rs6000_sdata_name, "eabi"))                     \
144
        rs6000_sdata = SDATA_EABI;                                      \
145
      else                                                              \
146
        error ("bad value for -msdata=%s", rs6000_sdata_name);          \
147
    }                                                                   \
148
  else if (DEFAULT_ABI == ABI_V4)                                       \
149
    {                                                                   \
150
      rs6000_sdata = SDATA_DATA;                                        \
151
      rs6000_sdata_name = "data";                                       \
152
    }                                                                   \
153
  else                                                                  \
154
    {                                                                   \
155
      rs6000_sdata = SDATA_NONE;                                        \
156
      rs6000_sdata_name = "none";                                       \
157
    }                                                                   \
158
                                                                        \
159
  if (TARGET_RELOCATABLE &&                                             \
160
      (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV))       \
161
    {                                                                   \
162
      rs6000_sdata = SDATA_DATA;                                        \
163
      error ("-mrelocatable and -msdata=%s are incompatible",           \
164
             rs6000_sdata_name);                                        \
165
    }                                                                   \
166
                                                                        \
167
  else if (flag_pic && DEFAULT_ABI != ABI_AIX                           \
168
           && (rs6000_sdata == SDATA_EABI                               \
169
               || rs6000_sdata == SDATA_SYSV))                          \
170
    {                                                                   \
171
      rs6000_sdata = SDATA_DATA;                                        \
172
      error ("-f%s and -msdata=%s are incompatible",                    \
173
             (flag_pic > 1) ? "PIC" : "pic",                            \
174
             rs6000_sdata_name);                                        \
175
    }                                                                   \
176
                                                                        \
177
  if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4)             \
178
      || (rs6000_sdata == SDATA_EABI && !TARGET_EABI))                  \
179
    {                                                                   \
180
      rs6000_sdata = SDATA_NONE;                                        \
181
      error ("-msdata=%s and -mcall-%s are incompatible",               \
182
             rs6000_sdata_name, rs6000_abi_name);                       \
183
    }                                                                   \
184
                                                                        \
185
  targetm.have_srodata_section = rs6000_sdata == SDATA_EABI;            \
186
                                                                        \
187
  if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC)                        \
188
    {                                                                   \
189
      target_flags |= MASK_MINIMAL_TOC;                                 \
190
      error ("-mrelocatable and -mno-minimal-toc are incompatible");    \
191
    }                                                                   \
192
                                                                        \
193
  if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX)              \
194
    {                                                                   \
195
      target_flags &= ~MASK_RELOCATABLE;                                \
196
      error ("-mrelocatable and -mcall-%s are incompatible",            \
197
             rs6000_abi_name);                                          \
198
    }                                                                   \
199
                                                                        \
200
  if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi == ABI_AIX)   \
201
    {                                                                   \
202
      flag_pic = 0;                                                      \
203
      error ("-fPIC and -mcall-%s are incompatible",                    \
204
             rs6000_abi_name);                                          \
205
    }                                                                   \
206
                                                                        \
207
  if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN)            \
208
    {                                                                   \
209
      target_flags &= ~MASK_LITTLE_ENDIAN;                              \
210
      error ("-mcall-aixdesc must be big endian");                      \
211
    }                                                                   \
212
                                                                        \
213
  if (TARGET_SECURE_PLT != secure_plt)                                  \
214
    {                                                                   \
215
      error ("-msecure-plt not supported by your assembler");           \
216
    }                                                                   \
217
                                                                        \
218
  if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128                       \
219
      && rs6000_explicit_options.long_double)                           \
220
    warning (0, "-msoft-float and -mlong-double-128 not supported");     \
221
                                                                        \
222
  /* Treat -fPIC the same as -mrelocatable.  */                         \
223
  if (flag_pic > 1 && DEFAULT_ABI != ABI_AIX)                           \
224
    target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \
225
                                                                        \
226
  else if (TARGET_RELOCATABLE)                                          \
227
    flag_pic = 2;                                                       \
228
} while (0)
229
 
230
#ifndef RS6000_BI_ARCH
231
# define SUBSUBTARGET_OVERRIDE_OPTIONS                                  \
232
do {                                                                    \
233
  if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT)                     \
234
    error ("-m%s not supported in this configuration",                  \
235
           (target_flags & MASK_64BIT) ? "64" : "32");                  \
236
} while (0)
237
#endif
238
 
239
/* Override rs6000.h definition.  */
240
#undef  TARGET_DEFAULT
241
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
242
 
243
/* Override rs6000.h definition.  */
244
#undef  PROCESSOR_DEFAULT
245
#define PROCESSOR_DEFAULT PROCESSOR_PPC750
246
 
247
/* SVR4 only defined for PowerPC, so short-circuit POWER patterns.  */
248
#undef  TARGET_POWER
249
#define TARGET_POWER 0
250
 
251
#define FIXED_R2 1
252
/* System V.4 uses register 13 as a pointer to the small data area,
253
   so it is not available to the normal user.  */
254
#define FIXED_R13 1
255
 
256
/* Override default big endianism definitions in rs6000.h.  */
257
#undef  BYTES_BIG_ENDIAN
258
#undef  WORDS_BIG_ENDIAN
259
#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
260
#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
261
 
262
/* Define this to set the endianness to use in libgcc2.c, which can
263
   not depend on target_flags.  */
264
#if !defined(__LITTLE_ENDIAN__) && !defined(__sun__)
265
#define LIBGCC2_WORDS_BIG_ENDIAN 1
266
#else
267
#define LIBGCC2_WORDS_BIG_ENDIAN 0
268
#endif
269
 
270
/* Define cutoff for using external functions to save floating point.
271
   Currently on V.4, always use inline stores.  */
272
#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
273
 
274
/* Put jump tables in read-only memory, rather than in .text.  */
275
#define JUMP_TABLES_IN_TEXT_SECTION 0
276
 
277
/* Prefix and suffix to use to saving floating point.  */
278
#define SAVE_FP_PREFIX "_savefpr_"
279
#define SAVE_FP_SUFFIX "_l"
280
 
281
/* Prefix and suffix to use to restoring floating point.  */
282
#define RESTORE_FP_PREFIX "_restfpr_"
283
#define RESTORE_FP_SUFFIX "_l"
284
 
285
/* Type used for ptrdiff_t, as a string used in a declaration.  */
286
#define PTRDIFF_TYPE "int"
287
 
288
/* Type used for wchar_t, as a string used in a declaration.  */
289
/* Override svr4.h definition.  */
290
#undef  WCHAR_TYPE
291
#define WCHAR_TYPE "long int"
292
 
293
/* Width of wchar_t in bits.  */
294
/* Override svr4.h definition.  */
295
#undef  WCHAR_TYPE_SIZE
296
#define WCHAR_TYPE_SIZE 32
297
 
298
/* Make int foo : 8 not cause structures to be aligned to an int boundary.  */
299
/* Override elfos.h definition.  */
300
#undef  PCC_BITFIELD_TYPE_MATTERS
301
#define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)
302
 
303
#undef  BITFIELD_NBYTES_LIMITED
304
#define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)
305
 
306
/* Define this macro to be the value 1 if instructions will fail to
307
   work if given data not on the nominal alignment.  If instructions
308
   will merely go slower in that case, define this macro as 0.  */
309
#undef  STRICT_ALIGNMENT
310
#define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)
311
 
312
/* Define this macro if you wish to preserve a certain alignment for
313
   the stack pointer, greater than what the hardware enforces.  The
314
   definition is a C expression for the desired alignment (measured
315
   in bits).  This macro must evaluate to a value equal to or larger
316
   than STACK_BOUNDARY.
317
   For the SYSV ABI and variants the alignment of the stack pointer
318
   is usually controlled manually in rs6000.c. However, to maintain
319
   alignment across alloca () in all circumstances,
320
   PREFERRED_STACK_BOUNDARY needs to be set as well.
321
   This has the additional advantage of allowing a bigger maximum
322
   alignment of user objects on the stack.  */
323
 
324
#undef PREFERRED_STACK_BOUNDARY
325
#define PREFERRED_STACK_BOUNDARY 128
326
 
327
/* Real stack boundary as mandated by the appropriate ABI.  */
328
#define ABI_STACK_BOUNDARY \
329
  ((TARGET_EABI && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI) ? 64 : 128)
330
 
331
/* An expression for the alignment of a structure field FIELD if the
332
   alignment computed in the usual way is COMPUTED.  */
333
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED)                                   \
334
        ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
335
         ? 128 : COMPUTED)
336
 
337
#undef  BIGGEST_FIELD_ALIGNMENT
338
 
339
/* Use ELF style section commands.  */
340
 
341
#define TEXT_SECTION_ASM_OP     "\t.section\t\".text\""
342
 
343
#define DATA_SECTION_ASM_OP     "\t.section\t\".data\""
344
 
345
#define BSS_SECTION_ASM_OP      "\t.section\t\".bss\""
346
 
347
/* Override elfos.h definition.  */
348
#undef  INIT_SECTION_ASM_OP
349
#define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
350
 
351
/* Override elfos.h definition.  */
352
#undef  FINI_SECTION_ASM_OP
353
#define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""
354
 
355
#define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""
356
 
357
/* Put PC relative got entries in .got2.  */
358
#define MINIMAL_TOC_SECTION_ASM_OP \
359
  (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI != ABI_AIX)           \
360
   ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
361
 
362
#define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
363
#define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
364
#define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"
365
 
366
/* Besides the usual ELF sections, we need a toc section.  */
367
/* Override elfos.h definition.  */
368
#undef  EXTRA_SECTIONS
369
#define EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini
370
 
371
/* Override elfos.h definition.  */
372
#undef  EXTRA_SECTION_FUNCTIONS
373
#define EXTRA_SECTION_FUNCTIONS                                         \
374
  TOC_SECTION_FUNCTION                                                  \
375
  SDATA_SECTION_FUNCTION                                                \
376
  SDATA2_SECTION_FUNCTION                                               \
377
  SBSS_SECTION_FUNCTION                                                 \
378
  INIT_SECTION_FUNCTION                                                 \
379
  FINI_SECTION_FUNCTION
380
 
381
#define TOC_SECTION_FUNCTION                                            \
382
void                                                                    \
383
toc_section (void)                                                      \
384
{                                                                       \
385
  if (in_section != in_toc)                                             \
386
    {                                                                   \
387
      in_section = in_toc;                                              \
388
      if (DEFAULT_ABI == ABI_AIX                                        \
389
          && TARGET_MINIMAL_TOC                                         \
390
          && !TARGET_RELOCATABLE)                                       \
391
        {                                                               \
392
          if (! toc_initialized)                                        \
393
            {                                                           \
394
              toc_initialized = 1;                                      \
395
              fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);       \
396
              (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); \
397
              fprintf (asm_out_file, "\t.tc ");                         \
398
              ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \
399
              ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
400
              fprintf (asm_out_file, "\n");                             \
401
                                                                        \
402
              fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
403
              ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
404
              fprintf (asm_out_file, " = .+32768\n");                   \
405
            }                                                           \
406
          else                                                          \
407
            fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \
408
        }                                                               \
409
      else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE)           \
410
        fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);             \
411
      else                                                              \
412
        {                                                               \
413
          fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);   \
414
          if (! toc_initialized)                                        \
415
            {                                                           \
416
              ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \
417
              fprintf (asm_out_file, " = .+32768\n");                   \
418
              toc_initialized = 1;                                      \
419
            }                                                           \
420
        }                                                               \
421
    }                                                                   \
422
}                                                                       \
423
                                                                        \
424
extern int in_toc_section (void);                                       \
425
int in_toc_section (void)                                               \
426
{                                                                       \
427
  return in_section == in_toc;                                          \
428
}
429
 
430
#define SDATA_SECTION_FUNCTION                                          \
431
void                                                                    \
432
sdata_section (void)                                                    \
433
{                                                                       \
434
  if (in_section != in_sdata)                                           \
435
    {                                                                   \
436
      in_section = in_sdata;                                            \
437
      fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP);             \
438
    }                                                                   \
439
}
440
 
441
#define SDATA2_SECTION_FUNCTION                                         \
442
void                                                                    \
443
sdata2_section (void)                                                   \
444
{                                                                       \
445
  if (in_section != in_sdata2)                                          \
446
    {                                                                   \
447
      in_section = in_sdata2;                                           \
448
      fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP);            \
449
    }                                                                   \
450
}
451
 
452
#define SBSS_SECTION_FUNCTION                                           \
453
void                                                                    \
454
sbss_section (void)                                                     \
455
{                                                                       \
456
  if (in_section != in_sbss)                                            \
457
    {                                                                   \
458
      in_section = in_sbss;                                             \
459
      fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP);              \
460
    }                                                                   \
461
}
462
 
463
#define INIT_SECTION_FUNCTION                                           \
464
void                                                                    \
465
init_section (void)                                                     \
466
{                                                                       \
467
  if (in_section != in_init)                                            \
468
    {                                                                   \
469
      in_section = in_init;                                             \
470
      fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP);              \
471
    }                                                                   \
472
}
473
 
474
#define FINI_SECTION_FUNCTION                                           \
475
void                                                                    \
476
fini_section (void)                                                     \
477
{                                                                       \
478
  if (in_section != in_fini)                                            \
479
    {                                                                   \
480
      in_section = in_fini;                                             \
481
      fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP);              \
482
    }                                                                   \
483
}
484
 
485
/* Override default elf definitions.  */
486
#undef  TARGET_ASM_SELECT_RTX_SECTION
487
#define TARGET_ASM_SELECT_RTX_SECTION rs6000_elf_select_rtx_section
488
#undef  TARGET_ASM_SELECT_SECTION
489
#define TARGET_ASM_SELECT_SECTION  rs6000_elf_select_section
490
#define TARGET_ASM_UNIQUE_SECTION  rs6000_elf_unique_section
491
 
492
/* Return nonzero if this entry is to be written into the constant pool
493
   in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
494
   containing one of them.  If -mfp-in-toc (the default), we also do
495
   this for floating-point constants.  We actually can only do this
496
   if the FP formats of the target and host machines are the same, but
497
   we can't check that since not every file that uses
498
   GO_IF_LEGITIMATE_ADDRESS_P includes real.h.
499
 
500
   Unlike AIX, we don't key off of -mminimal-toc, but instead do not
501
   allow floating point constants in the TOC if -mrelocatable.  */
502
 
503
#undef  ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
504
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)                        \
505
  (TARGET_TOC                                                           \
506
   && (GET_CODE (X) == SYMBOL_REF                                       \
507
       || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS       \
508
           && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)             \
509
       || GET_CODE (X) == LABEL_REF                                     \
510
       || (GET_CODE (X) == CONST_INT                                    \
511
           && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))      \
512
       || (!TARGET_NO_FP_IN_TOC                                         \
513
           && !TARGET_RELOCATABLE                                       \
514
           && GET_CODE (X) == CONST_DOUBLE                              \
515
           && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT               \
516
           && BITS_PER_WORD == HOST_BITS_PER_INT)))
517
 
518
/* These macros generate the special .type and .size directives which
519
   are used to set the corresponding fields of the linker symbol table
520
   entries in an ELF object file under SVR4.  These macros also output
521
   the starting labels for the relevant functions/objects.  */
522
 
523
/* Write the extra assembler code needed to declare a function properly.
524
   Some svr4 assemblers need to also have something extra said about the
525
   function's return value.  We allow for that here.  */
526
 
527
extern int rs6000_pic_labelno;
528
 
529
/* Override elfos.h definition.  */
530
#undef  ASM_DECLARE_FUNCTION_NAME
531
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
532
  rs6000_elf_declare_function_name ((FILE), (NAME), (DECL))
533
 
534
/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore
535
   flag.  The LOCAL_LABEL_PREFIX variable is used by dbxelf.h.  */
536
 
537
#define LOCAL_LABEL_PREFIX "."
538
#define USER_LABEL_PREFIX ""
539
 
540
/* svr4.h overrides (*targetm.asm_out.internal_label).  */
541
 
542
#define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX)   \
543
  asm_fprintf (FILE, "%L%s", PREFIX)
544
 
545
/* Globalizing directive for a label.  */
546
#define GLOBAL_ASM_OP "\t.globl "
547
 
548
/* This says how to output assembler code to declare an
549
   uninitialized internal linkage data object.  Under SVR4,
550
   the linker seems to want the alignment of data objects
551
   to depend on their types.  We do exactly that here.  */
552
 
553
#define LOCAL_ASM_OP    "\t.local\t"
554
 
555
#define LCOMM_ASM_OP    "\t.lcomm\t"
556
 
557
/* Override elfos.h definition.  */
558
#undef  ASM_OUTPUT_ALIGNED_LOCAL
559
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)               \
560
do {                                                                    \
561
  if (rs6000_sdata != SDATA_NONE && (SIZE) > 0                           \
562
      && (SIZE) <= g_switch_value)                                      \
563
    {                                                                   \
564
      sbss_section ();                                                  \
565
      ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT));      \
566
      ASM_OUTPUT_LABEL (FILE, NAME);                                    \
567
      ASM_OUTPUT_SKIP (FILE, SIZE);                                     \
568
      if (!flag_inhibit_size_directive && (SIZE) > 0)                    \
569
        ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE);                   \
570
    }                                                                   \
571
  else                                                                  \
572
    {                                                                   \
573
      fprintf (FILE, "%s", LCOMM_ASM_OP);                               \
574
      assemble_name ((FILE), (NAME));                                   \
575
      fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",          \
576
               (SIZE), (ALIGN) / BITS_PER_UNIT);                        \
577
    }                                                                   \
578
  ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");                     \
579
} while (0)
580
 
581
/* Describe how to emit uninitialized external linkage items.  */
582
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)           \
583
do {                                                                    \
584
  ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);                   \
585
} while (0)
586
 
587
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
588
/* To support -falign-* switches we need to use .p2align so
589
   that alignment directives in code sections will be padded
590
   with no-op instructions, rather than zeroes.  */
591
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                    \
592
  if ((LOG) != 0)                                                        \
593
    {                                                                   \
594
      if ((MAX_SKIP) == 0)                                               \
595
        fprintf ((FILE), "\t.p2align %d\n", (LOG));                     \
596
      else                                                              \
597
        fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
598
    }
599
#endif
600
 
601
/* This is how to output code to push a register on the stack.
602
   It need not be very fast code.
603
 
604
   On the rs6000, we must keep the backchain up to date.  In order
605
   to simplify things, always allocate 16 bytes for a push (System V
606
   wants to keep stack aligned to a 16 byte boundary).  */
607
 
608
#define ASM_OUTPUT_REG_PUSH(FILE, REGNO)                                \
609
do {                                                                    \
610
  if (DEFAULT_ABI == ABI_V4)                                            \
611
    asm_fprintf (FILE,                                                  \
612
                 "\t{stu|stwu} %s,-16(%s)\n\t{st|stw} %s,12(%s)\n",     \
613
                 reg_names[1], reg_names[1], reg_names[REGNO],          \
614
                 reg_names[1]);                                         \
615
} while (0)
616
 
617
/* This is how to output an insn to pop a register from the stack.
618
   It need not be very fast code.  */
619
 
620
#define ASM_OUTPUT_REG_POP(FILE, REGNO)                                 \
621
do {                                                                    \
622
  if (DEFAULT_ABI == ABI_V4)                                            \
623
    asm_fprintf (FILE,                                                  \
624
                 "\t{l|lwz} %s,12(%s)\n\t{ai|addic} %s,%s,16\n",        \
625
                 reg_names[REGNO], reg_names[1], reg_names[1],          \
626
                 reg_names[1]);                                         \
627
} while (0)
628
 
629
/* Switch  Recognition by gcc.c.  Add -G xx support.  */
630
 
631
/* Override svr4.h definition.  */
632
#undef  SWITCH_TAKES_ARG
633
#define SWITCH_TAKES_ARG(CHAR)                                          \
634
  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o'                      \
635
   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u'                   \
636
   || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x'                   \
637
   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V'                   \
638
   || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'G')
639
 
640
extern int fixuplabelno;
641
 
642
/* Handle constructors specially for -mrelocatable.  */
643
#define TARGET_ASM_CONSTRUCTOR  rs6000_elf_asm_out_constructor
644
#define TARGET_ASM_DESTRUCTOR   rs6000_elf_asm_out_destructor
645
 
646
/* This is the end of what might become sysv4.h.  */
647
 
648
/* Use DWARF 2 debugging information by default.  */
649
#undef  PREFERRED_DEBUGGING_TYPE
650
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
651
 
652
/* Historically we have also supported stabs debugging.  */
653
#define DBX_DEBUGGING_INFO 1
654
 
655
#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO)
656
 
657
/* Map register numbers held in the call frame info that gcc has
658
   collected using DWARF_FRAME_REGNUM to those that should be output in
659
   .debug_frame and .eh_frame.  We continue to use gcc hard reg numbers
660
   for .eh_frame, but use the numbers mandated by the various ABIs for
661
   .debug_frame.  rs6000_emit_prologue has translated any combination of
662
   CR2, CR3, CR4 saves to a save of CR2.  The actual code emitted saves
663
   the whole of CR, so we map CR2_REGNO to the DWARF reg for CR.  */
664
#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH)     \
665
  ((FOR_EH) ? (REGNO)                           \
666
   : (REGNO) == CR2_REGNO ? 64                  \
667
   : DBX_REGISTER_NUMBER (REGNO))
668
 
669
#define TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
670
#define TARGET_IN_SMALL_DATA_P  rs6000_elf_in_small_data_p
671
#define TARGET_SECTION_TYPE_FLAGS  rs6000_elf_section_type_flags
672
 
673
/* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
674
 
675
#define RS6000_OUTPUT_BASENAME(FILE, NAME)      \
676
    assemble_name (FILE, NAME)
677
 
678
/* We have to output the stabs for the function name *first*, before
679
   outputting its label.  */
680
 
681
#define DBX_FUNCTION_FIRST
682
 
683
/* This is the end of what might become sysv4dbx.h.  */
684
 
685
#ifndef TARGET_VERSION
686
#define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
687
#endif
688
 
689
#define TARGET_OS_SYSV_CPP_BUILTINS()           \
690
  do                                            \
691
    {                                           \
692
      if (flag_pic == 1)                        \
693
        {                                       \
694
          builtin_define ("__pic__=1");         \
695
          builtin_define ("__PIC__=1");         \
696
        }                                       \
697
      else if (flag_pic == 2)                   \
698
        {                                       \
699
          builtin_define ("__pic__=2");         \
700
          builtin_define ("__PIC__=2");         \
701
        }                                       \
702
      if (target_flags_explicit                 \
703
          & MASK_RELOCATABLE)                   \
704
        builtin_define ("_RELOCATABLE");        \
705
    }                                           \
706
  while (0)
707
 
708
#ifndef TARGET_OS_CPP_BUILTINS
709
#define TARGET_OS_CPP_BUILTINS()                \
710
  do                                            \
711
    {                                           \
712
      builtin_define_std ("PPC");               \
713
      builtin_define_std ("unix");              \
714
      builtin_define ("__svr4__");              \
715
      builtin_assert ("system=unix");           \
716
      builtin_assert ("system=svr4");           \
717
      builtin_assert ("cpu=powerpc");           \
718
      builtin_assert ("machine=powerpc");       \
719
      TARGET_OS_SYSV_CPP_BUILTINS ();           \
720
    }                                           \
721
  while (0)
722
#endif
723
 
724
/* Pass various options to the assembler.  */
725
/* Override svr4.h definition.  */
726
#undef  ASM_SPEC
727
#define ASM_SPEC "%(asm_cpu) \
728
%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
729
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
730
%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
731
%{memb|msdata|msdata=eabi: -memb} \
732
%{mlittle|mlittle-endian:-mlittle; \
733
  mbig|mbig-endian      :-mbig;    \
734
  mcall-aixdesc |                  \
735
  mcall-freebsd |                  \
736
  mcall-netbsd  |                  \
737
  mcall-openbsd |                  \
738
  mcall-linux   |                  \
739
  mcall-gnu             :-mbig;    \
740
  mcall-i960-old        :-mlittle}"
741
 
742
#define CC1_ENDIAN_BIG_SPEC ""
743
 
744
#define CC1_ENDIAN_LITTLE_SPEC "\
745
%{!mstrict-align: %{!mno-strict-align: \
746
    %{!mcall-i960-old: \
747
        -mstrict-align \
748
    } \
749
}}"
750
 
751
#define CC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_big)"
752
 
753
#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
754
#define CC1_SECURE_PLT_DEFAULT_SPEC ""
755
#endif
756
 
757
/* Pass -G xxx to the compiler and set correct endian mode.  */
758
#define CC1_SPEC "%{G*} \
759
%{mlittle|mlittle-endian: %(cc1_endian_little);           \
760
  mbig   |mbig-endian   : %(cc1_endian_big);              \
761
  mcall-aixdesc |                                         \
762
  mcall-freebsd |                                         \
763
  mcall-netbsd  |                                         \
764
  mcall-openbsd |                                         \
765
  mcall-linux   |                                         \
766
  mcall-gnu             : -mbig %(cc1_endian_big);        \
767
  mcall-i960-old        : -mlittle %(cc1_endian_little);  \
768
                        : %(cc1_endian_default)}          \
769
%{meabi: %{!mcall-*: -mcall-sysv }} \
770
%{!meabi: %{!mno-eabi: \
771
    %{mrelocatable: -meabi } \
772
    %{mcall-freebsd: -mno-eabi } \
773
    %{mcall-i960-old: -meabi } \
774
    %{mcall-linux: -mno-eabi } \
775
    %{mcall-gnu: -mno-eabi } \
776
    %{mcall-netbsd: -mno-eabi } \
777
    %{mcall-openbsd: -mno-eabi }}} \
778
%{msdata: -msdata=default} \
779
%{mno-sdata: -msdata=none} \
780
%{!mbss-plt: %{!msecure-plt: %(cc1_secure_plt_default)}} \
781
%{profile: -p}"
782
 
783
/* Don't put -Y P,<path> for cross compilers.  */
784
#ifndef CROSS_COMPILE
785
#define LINK_PATH_SPEC "\
786
%{!R*:%{L*:-R %*}} \
787
%{!nostdlib: %{!YP,*: \
788
    %{compat-bsd: \
789
        %{p:-Y P,/usr/ucblib:/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
790
        %{!p:-Y P,/usr/ucblib:/usr/ccs/lib:/usr/lib}} \
791
        %{!R*: %{!L*: -R /usr/ucblib}} \
792
    %{!compat-bsd: \
793
        %{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
794
        %{!p:-Y P,/usr/ccs/lib:/usr/lib}}}}"
795
 
796
#else
797
#define LINK_PATH_SPEC ""
798
#endif
799
 
800
/* Default starting address if specified.  */
801
#define LINK_START_SPEC "\
802
%{mads         : %(link_start_ads)         ; \
803
  myellowknife : %(link_start_yellowknife) ; \
804
  mmvme        : %(link_start_mvme)        ; \
805
  msim         : %(link_start_sim)         ; \
806
  mwindiss     : %(link_start_windiss)     ; \
807
  mcall-freebsd: %(link_start_freebsd)     ; \
808
  mcall-linux  : %(link_start_linux)       ; \
809
  mcall-gnu    : %(link_start_gnu)         ; \
810
  mcall-netbsd : %(link_start_netbsd)      ; \
811
  mcall-openbsd: %(link_start_openbsd)     ; \
812
               : %(link_start_default)     }"
813
 
814
#define LINK_START_DEFAULT_SPEC ""
815
 
816
/* Override svr4.h definition.  */
817
#undef  LINK_SPEC
818
#define LINK_SPEC "\
819
%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
820
%{YP,*} %{R*} \
821
%{Qy:} %{!Qn:-Qy} \
822
%(link_shlib) \
823
%{!Wl,-T*: %{!T*: %(link_start) }} \
824
%(link_target) \
825
%(link_os)"
826
 
827
/* For now, turn off shared libraries by default.  */
828
#ifndef SHARED_LIB_SUPPORT
829
#define NO_SHARED_LIB_SUPPORT
830
#endif
831
 
832
#ifndef NO_SHARED_LIB_SUPPORT
833
/* Shared libraries are default.  */
834
#define LINK_SHLIB_SPEC "\
835
%{!static: %(link_path) %{!R*:%{L*:-R %*}}} \
836
%{mshlib: } \
837
%{static:-dn -Bstatic} \
838
%{shared:-G -dy -z text} \
839
%{symbolic:-Bsymbolic -G -dy -z text}"
840
 
841
#else
842
/* Shared libraries are not default.  */
843
#define LINK_SHLIB_SPEC "\
844
%{mshlib: %(link_path) } \
845
%{!mshlib: %{!shared: %{!symbolic: -dn -Bstatic}}} \
846
%{static: } \
847
%{shared:-G -dy -z text %(link_path) } \
848
%{symbolic:-Bsymbolic -G -dy -z text %(link_path) }"
849
#endif
850
 
851
/* Override the default target of the linker.  */
852
#define LINK_TARGET_SPEC "\
853
%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
854
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
855
    %{mcall-i960-old: --oformat elf32-powerpcle} \
856
  }}}}"
857
 
858
/* Any specific OS flags.  */
859
#define LINK_OS_SPEC "\
860
%{mads         : %(link_os_ads)         ; \
861
  myellowknife : %(link_os_yellowknife) ; \
862
  mmvme        : %(link_os_mvme)        ; \
863
  msim         : %(link_os_sim)         ; \
864
  mwindiss     : %(link_os_windiss)     ; \
865
  mcall-freebsd: %(link_os_freebsd)     ; \
866
  mcall-linux  : %(link_os_linux)       ; \
867
  mcall-gnu    : %(link_os_gnu)         ; \
868
  mcall-netbsd : %(link_os_netbsd)      ; \
869
  mcall-openbsd: %(link_os_openbsd)     ; \
870
               : %(link_os_default)     }"
871
 
872
#define LINK_OS_DEFAULT_SPEC ""
873
 
874
/* Override rs6000.h definition.  */
875
#undef  CPP_SPEC
876
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
877
%{mads         : %(cpp_os_ads)         ; \
878
  myellowknife : %(cpp_os_yellowknife) ; \
879
  mmvme        : %(cpp_os_mvme)        ; \
880
  msim         : %(cpp_os_sim)         ; \
881
  mwindiss     : %(cpp_os_windiss)     ; \
882
  mcall-freebsd: %(cpp_os_freebsd)     ; \
883
  mcall-linux  : %(cpp_os_linux)       ; \
884
  mcall-gnu    : %(cpp_os_gnu)         ; \
885
  mcall-netbsd : %(cpp_os_netbsd)      ; \
886
  mcall-openbsd: %(cpp_os_openbsd)     ; \
887
               : %(cpp_os_default)     }"
888
 
889
#define CPP_OS_DEFAULT_SPEC ""
890
 
891
/* Override svr4.h definition.  */
892
#undef  STARTFILE_SPEC
893
#define STARTFILE_SPEC "\
894
%{mads         : %(startfile_ads)         ; \
895
  myellowknife : %(startfile_yellowknife) ; \
896
  mmvme        : %(startfile_mvme)        ; \
897
  msim         : %(startfile_sim)         ; \
898
  mwindiss     : %(startfile_windiss)     ; \
899
  mcall-freebsd: %(startfile_freebsd)     ; \
900
  mcall-linux  : %(startfile_linux)       ; \
901
  mcall-gnu    : %(startfile_gnu)         ; \
902
  mcall-netbsd : %(startfile_netbsd)      ; \
903
  mcall-openbsd: %(startfile_openbsd)     ; \
904
               : %(startfile_default)     }"
905
 
906
#define STARTFILE_DEFAULT_SPEC ""
907
 
908
/* Override svr4.h definition.  */
909
#undef  LIB_SPEC
910
#define LIB_SPEC "\
911
%{mads         : %(lib_ads)         ; \
912
  myellowknife : %(lib_yellowknife) ; \
913
  mmvme        : %(lib_mvme)        ; \
914
  msim         : %(lib_sim)         ; \
915
  mwindiss     : %(lib_windiss)     ; \
916
  mcall-freebsd: %(lib_freebsd)     ; \
917
  mcall-linux  : %(lib_linux)       ; \
918
  mcall-gnu    : %(lib_gnu)         ; \
919
  mcall-netbsd : %(lib_netbsd)      ; \
920
  mcall-openbsd: %(lib_openbsd)     ; \
921
               : %(lib_default)     }"
922
 
923
#define LIB_DEFAULT_SPEC ""
924
 
925
/* Override svr4.h definition.  */
926
#undef  ENDFILE_SPEC
927
#define ENDFILE_SPEC "\
928
%{mads         : crtsavres.o%s        %(endfile_ads)         ; \
929
  myellowknife : crtsavres.o%s        %(endfile_yellowknife) ; \
930
  mmvme        : crtsavres.o%s        %(endfile_mvme)        ; \
931
  msim         : crtsavres.o%s        %(endfile_sim)         ; \
932
  mwindiss     :                      %(endfile_windiss)     ; \
933
  mcall-freebsd: crtsavres.o%s        %(endfile_freebsd)     ; \
934
  mcall-linux  : crtsavres.o%s        %(endfile_linux)       ; \
935
  mcall-gnu    : crtsavres.o%s        %(endfile_gnu)         ; \
936
  mcall-netbsd : crtsavres.o%s        %(endfile_netbsd)      ; \
937
  mcall-openbsd: crtsavres.o%s        %(endfile_openbsd)     ; \
938
               : %(crtsavres_default) %(endfile_default)     }"
939
 
940
#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
941
 
942
#define ENDFILE_DEFAULT_SPEC ""
943
 
944
/* Motorola ADS support.  */
945
#define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
946
 
947
#define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
948
 
949
#define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s"
950
 
951
#define LINK_START_ADS_SPEC "-T ads.ld%s"
952
 
953
#define LINK_OS_ADS_SPEC ""
954
 
955
#define CPP_OS_ADS_SPEC ""
956
 
957
/* Motorola Yellowknife support.  */
958
#define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
959
 
960
#define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
961
 
962
#define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s"
963
 
964
#define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s"
965
 
966
#define LINK_OS_YELLOWKNIFE_SPEC ""
967
 
968
#define CPP_OS_YELLOWKNIFE_SPEC ""
969
 
970
/* Motorola MVME support.  */
971
#define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
972
 
973
#define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s"
974
 
975
#define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s"
976
 
977
#define LINK_START_MVME_SPEC "-Ttext 0x40000"
978
 
979
#define LINK_OS_MVME_SPEC ""
980
 
981
#define CPP_OS_MVME_SPEC ""
982
 
983
/* PowerPC simulator based on netbsd system calls support.  */
984
#define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
985
 
986
#define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s"
987
 
988
#define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s"
989
 
990
#define LINK_START_SIM_SPEC ""
991
 
992
#define LINK_OS_SIM_SPEC "-m elf32ppcsim"
993
 
994
#define CPP_OS_SIM_SPEC ""
995
 
996
/* FreeBSD support.  */
997
 
998
#define CPP_OS_FREEBSD_SPEC     "\
999
  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
1000
  -Acpu=powerpc -Amachine=powerpc"
1001
 
1002
#define STARTFILE_FREEBSD_SPEC  FBSD_STARTFILE_SPEC
1003
#define ENDFILE_FREEBSD_SPEC    FBSD_ENDFILE_SPEC
1004
#define LIB_FREEBSD_SPEC        FBSD_LIB_SPEC
1005
#define LINK_START_FREEBSD_SPEC ""
1006
 
1007
#define LINK_OS_FREEBSD_SPEC "\
1008
  %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
1009
  %{v:-V} \
1010
  %{assert*} %{R*} %{rpath*} %{defsym*} \
1011
  %{shared:-Bshareable %{h*} %{soname*}} \
1012
  %{!shared: \
1013
    %{!static: \
1014
      %{rdynamic: -export-dynamic} \
1015
      %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
1016
    %{static:-Bstatic}} \
1017
  %{symbolic:-Bsymbolic}"
1018
 
1019
/* GNU/Linux support.  */
1020
#define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
1021
%{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
1022
%{!shared: %{profile:-lc_p} %{!profile:-lc}}}"
1023
 
1024
#ifdef HAVE_LD_PIE
1025
#define STARTFILE_LINUX_SPEC "\
1026
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
1027
%{mnewlib:ecrti.o%s;:crti.o%s} \
1028
%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
1029
#else
1030
#define STARTFILE_LINUX_SPEC "\
1031
%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
1032
%{mnewlib:ecrti.o%s;:crti.o%s} \
1033
%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
1034
#endif
1035
 
1036
#define ENDFILE_LINUX_SPEC "\
1037
%{shared|pie:crtendS.o%s;:crtend.o%s} \
1038
%{mnewlib:ecrtn.o%s;:crtn.o%s}"
1039
 
1040
#define LINK_START_LINUX_SPEC ""
1041
 
1042
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1043
  %{rdynamic:-export-dynamic} \
1044
  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1045
 
1046
#if defined(HAVE_LD_EH_FRAME_HDR)
1047
# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
1048
#endif
1049
 
1050
#define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
1051
%{!undef:                                                         \
1052
  %{!ansi:                                                        \
1053
    %{!std=*:-Dunix -D__unix -Dlinux -D__linux}                   \
1054
    %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}               \
1055
-Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1056
 
1057
/* GNU/Hurd support.  */
1058
#define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
1059
%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
1060
%{profile:-lc_p} %{!profile:-lc}}}"
1061
 
1062
#define STARTFILE_GNU_SPEC "\
1063
%{!shared: %{!static: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}} \
1064
%{static: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
1065
%{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \
1066
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1067
 
1068
#define ENDFILE_GNU_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1069
%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
1070
 
1071
#define LINK_START_GNU_SPEC ""
1072
 
1073
#define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
1074
  %{rdynamic:-export-dynamic} \
1075
  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
1076
 
1077
#define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__    \
1078
%{!undef:                                                       \
1079
  %{!ansi: -Dunix -D__unix}}                                    \
1080
-Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
1081
 
1082
/* NetBSD support.  */
1083
#define LIB_NETBSD_SPEC "\
1084
%{profile:-lgmon -lc_p} %{!profile:-lc}"
1085
 
1086
#define STARTFILE_NETBSD_SPEC "\
1087
ncrti.o%s crt0.o%s \
1088
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1089
 
1090
#define ENDFILE_NETBSD_SPEC "\
1091
%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
1092
ncrtn.o%s"
1093
 
1094
#define LINK_START_NETBSD_SPEC "\
1095
"
1096
 
1097
#define LINK_OS_NETBSD_SPEC "\
1098
%{!shared: %{!static: \
1099
  %{rdynamic:-export-dynamic} \
1100
  %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
1101
 
1102
#define CPP_OS_NETBSD_SPEC "\
1103
-D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
1104
 
1105
/* OpenBSD support.  */
1106
#ifndef LIB_OPENBSD_SPEC
1107
#define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
1108
#endif
1109
 
1110
#ifndef STARTFILE_OPENBSD_SPEC
1111
#define STARTFILE_OPENBSD_SPEC "\
1112
%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
1113
%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
1114
#endif
1115
 
1116
#ifndef ENDFILE_OPENBSD_SPEC
1117
#define ENDFILE_OPENBSD_SPEC "\
1118
%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
1119
#endif
1120
 
1121
#ifndef LINK_START_OPENBSD_SPEC
1122
#define LINK_START_OPENBSD_SPEC "-Ttext 0x400074"
1123
#endif
1124
 
1125
#ifndef LINK_OS_OPENBSD_SPEC
1126
#define LINK_OS_OPENBSD_SPEC ""
1127
#endif
1128
 
1129
#ifndef CPP_OS_OPENBSD_SPEC
1130
#define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
1131
#endif
1132
 
1133
/* WindISS support.  */
1134
 
1135
#define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group"
1136
 
1137
#define CPP_OS_WINDISS_SPEC "\
1138
-D__rtasim \
1139
-D__EABI__ \
1140
-D__ppc \
1141
%{!msoft-float: -D__hardfp} \
1142
"
1143
 
1144
#define STARTFILE_WINDISS_SPEC "crt0.o%s crtbegin.o%s"
1145
 
1146
#define ENDFILE_WINDISS_SPEC "crtend.o%s"
1147
 
1148
#define LINK_START_WINDISS_SPEC ""
1149
 
1150
#define LINK_OS_WINDISS_SPEC ""
1151
 
1152
/* Define any extra SPECS that the compiler needs to generate.  */
1153
/* Override rs6000.h definition.  */
1154
#undef  SUBTARGET_EXTRA_SPECS
1155
#define SUBTARGET_EXTRA_SPECS                                           \
1156
  { "crtsavres_default",        CRTSAVRES_DEFAULT_SPEC },               \
1157
  { "lib_ads",                  LIB_ADS_SPEC },                         \
1158
  { "lib_yellowknife",          LIB_YELLOWKNIFE_SPEC },                 \
1159
  { "lib_mvme",                 LIB_MVME_SPEC },                        \
1160
  { "lib_sim",                  LIB_SIM_SPEC },                         \
1161
  { "lib_freebsd",              LIB_FREEBSD_SPEC },                     \
1162
  { "lib_gnu",                  LIB_GNU_SPEC },                         \
1163
  { "lib_linux",                LIB_LINUX_SPEC },                       \
1164
  { "lib_netbsd",               LIB_NETBSD_SPEC },                      \
1165
  { "lib_openbsd",              LIB_OPENBSD_SPEC },                     \
1166
  { "lib_windiss",              LIB_WINDISS_SPEC },                     \
1167
  { "lib_default",              LIB_DEFAULT_SPEC },                     \
1168
  { "startfile_ads",            STARTFILE_ADS_SPEC },                   \
1169
  { "startfile_yellowknife",    STARTFILE_YELLOWKNIFE_SPEC },           \
1170
  { "startfile_mvme",           STARTFILE_MVME_SPEC },                  \
1171
  { "startfile_sim",            STARTFILE_SIM_SPEC },                   \
1172
  { "startfile_freebsd",        STARTFILE_FREEBSD_SPEC },               \
1173
  { "startfile_gnu",            STARTFILE_GNU_SPEC },                   \
1174
  { "startfile_linux",          STARTFILE_LINUX_SPEC },                 \
1175
  { "startfile_netbsd",         STARTFILE_NETBSD_SPEC },                \
1176
  { "startfile_openbsd",        STARTFILE_OPENBSD_SPEC },               \
1177
  { "startfile_windiss",        STARTFILE_WINDISS_SPEC },               \
1178
  { "startfile_default",        STARTFILE_DEFAULT_SPEC },               \
1179
  { "endfile_ads",              ENDFILE_ADS_SPEC },                     \
1180
  { "endfile_yellowknife",      ENDFILE_YELLOWKNIFE_SPEC },             \
1181
  { "endfile_mvme",             ENDFILE_MVME_SPEC },                    \
1182
  { "endfile_sim",              ENDFILE_SIM_SPEC },                     \
1183
  { "endfile_freebsd",          ENDFILE_FREEBSD_SPEC },                 \
1184
  { "endfile_gnu",              ENDFILE_GNU_SPEC },                     \
1185
  { "endfile_linux",            ENDFILE_LINUX_SPEC },                   \
1186
  { "endfile_netbsd",           ENDFILE_NETBSD_SPEC },                  \
1187
  { "endfile_openbsd",          ENDFILE_OPENBSD_SPEC },                 \
1188
  { "endfile_windiss",          ENDFILE_WINDISS_SPEC },                 \
1189
  { "endfile_default",          ENDFILE_DEFAULT_SPEC },                 \
1190
  { "link_path",                LINK_PATH_SPEC },                       \
1191
  { "link_shlib",               LINK_SHLIB_SPEC },                      \
1192
  { "link_target",              LINK_TARGET_SPEC },                     \
1193
  { "link_start",               LINK_START_SPEC },                      \
1194
  { "link_start_ads",           LINK_START_ADS_SPEC },                  \
1195
  { "link_start_yellowknife",   LINK_START_YELLOWKNIFE_SPEC },          \
1196
  { "link_start_mvme",          LINK_START_MVME_SPEC },                 \
1197
  { "link_start_sim",           LINK_START_SIM_SPEC },                  \
1198
  { "link_start_freebsd",       LINK_START_FREEBSD_SPEC },              \
1199
  { "link_start_gnu",           LINK_START_GNU_SPEC },                  \
1200
  { "link_start_linux",         LINK_START_LINUX_SPEC },                \
1201
  { "link_start_netbsd",        LINK_START_NETBSD_SPEC },               \
1202
  { "link_start_openbsd",       LINK_START_OPENBSD_SPEC },              \
1203
  { "link_start_windiss",       LINK_START_WINDISS_SPEC },              \
1204
  { "link_start_default",       LINK_START_DEFAULT_SPEC },              \
1205
  { "link_os",                  LINK_OS_SPEC },                         \
1206
  { "link_os_ads",              LINK_OS_ADS_SPEC },                     \
1207
  { "link_os_yellowknife",      LINK_OS_YELLOWKNIFE_SPEC },             \
1208
  { "link_os_mvme",             LINK_OS_MVME_SPEC },                    \
1209
  { "link_os_sim",              LINK_OS_SIM_SPEC },                     \
1210
  { "link_os_freebsd",          LINK_OS_FREEBSD_SPEC },                 \
1211
  { "link_os_linux",            LINK_OS_LINUX_SPEC },                   \
1212
  { "link_os_gnu",              LINK_OS_GNU_SPEC },                     \
1213
  { "link_os_netbsd",           LINK_OS_NETBSD_SPEC },                  \
1214
  { "link_os_openbsd",          LINK_OS_OPENBSD_SPEC },                 \
1215
  { "link_os_windiss",          LINK_OS_WINDISS_SPEC },                 \
1216
  { "link_os_default",          LINK_OS_DEFAULT_SPEC },                 \
1217
  { "cc1_endian_big",           CC1_ENDIAN_BIG_SPEC },                  \
1218
  { "cc1_endian_little",        CC1_ENDIAN_LITTLE_SPEC },               \
1219
  { "cc1_endian_default",       CC1_ENDIAN_DEFAULT_SPEC },              \
1220
  { "cc1_secure_plt_default",   CC1_SECURE_PLT_DEFAULT_SPEC },          \
1221
  { "cpp_os_ads",               CPP_OS_ADS_SPEC },                      \
1222
  { "cpp_os_yellowknife",       CPP_OS_YELLOWKNIFE_SPEC },              \
1223
  { "cpp_os_mvme",              CPP_OS_MVME_SPEC },                     \
1224
  { "cpp_os_sim",               CPP_OS_SIM_SPEC },                      \
1225
  { "cpp_os_freebsd",           CPP_OS_FREEBSD_SPEC },                  \
1226
  { "cpp_os_gnu",               CPP_OS_GNU_SPEC },                      \
1227
  { "cpp_os_linux",             CPP_OS_LINUX_SPEC },                    \
1228
  { "cpp_os_netbsd",            CPP_OS_NETBSD_SPEC },                   \
1229
  { "cpp_os_openbsd",           CPP_OS_OPENBSD_SPEC },                  \
1230
  { "cpp_os_windiss",           CPP_OS_WINDISS_SPEC },                  \
1231
  { "cpp_os_default",           CPP_OS_DEFAULT_SPEC },                  \
1232
  { "fbsd_dynamic_linker",      FBSD_DYNAMIC_LINKER },                  \
1233
  SUBSUBTARGET_EXTRA_SPECS
1234
 
1235
#define SUBSUBTARGET_EXTRA_SPECS
1236
 
1237
/* Define this macro as a C expression for the initializer of an
1238
   array of string to tell the driver program which options are
1239
   defaults for this target and thus do not need to be handled
1240
   specially when using `MULTILIB_OPTIONS'.
1241
 
1242
   Do not define this macro if `MULTILIB_OPTIONS' is not defined in
1243
   the target makefile fragment or if none of the options listed in
1244
   `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
1245
 
1246
#define MULTILIB_DEFAULTS { "mbig", "mcall-sysv" }
1247
 
1248
/* Define this macro if the code for function profiling should come
1249
   before the function prologue.  Normally, the profiling code comes
1250
   after.  */
1251
#define PROFILE_BEFORE_PROLOGUE 1
1252
 
1253
/* Function name to call to do profiling.  */
1254
#define RS6000_MCOUNT "_mcount"
1255
 
1256
/* Define this macro (to a value of 1) if you want to support the
1257
   Win32 style pragmas #pragma pack(push,<n>)' and #pragma
1258
   pack(pop)'.  The pack(push,<n>) pragma specifies the maximum
1259
   alignment (in bytes) of fields within a structure, in much the
1260
   same way as the __aligned__' and __packed__' __attribute__'s
1261
   do.  A pack value of zero resets the behavior to the default.
1262
   Successive invocations of this pragma cause the previous values to
1263
   be stacked, so that invocations of #pragma pack(pop)' will return
1264
   to the previous value.  */
1265
 
1266
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
1267
 
1268
/* Select a format to encode pointers in exception handling data.  CODE
1269
   is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
1270
   true if the symbol may be affected by dynamic relocations.  */
1271
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)                            \
1272
  ((flag_pic || TARGET_RELOCATABLE)                                          \
1273
   ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
1274
   : DW_EH_PE_absptr)
1275
 
1276
#define DOUBLE_INT_ASM_OP "\t.quad\t"
1277
 
1278
/* Generate entries in .fixup for relocatable addresses.  */
1279
#define RELOCATABLE_NEEDS_FIXUP 1
1280
 
1281
/* This target uses the sysv4.opt file.  */
1282
#define TARGET_USES_SYSV4_OPT 1

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.