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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [config/] [rs6000/] [sysv4.h] - Blame information for rev 282

Details | Compare with Previous | View Log

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