📄 sysv4.h
字号:
/* Target definitions for GNU compiler for PowerPC running System V.4 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Cygnus Support. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *//* Header files should be C++ aware in general. */#undef NO_IMPLICIT_EXTERN_C#define NO_IMPLICIT_EXTERN_C/* Yes! We are ELF. */#define TARGET_OBJECT_FORMAT OBJECT_ELF/* Default ABI to compile code for. */#define DEFAULT_ABI rs6000_current_abi/* Default ABI to use. */#define RS6000_ABI_NAME "sysv"/* Override rs6000.h definition. */#undef ASM_DEFAULT_SPEC#define ASM_DEFAULT_SPEC "-mppc"/* Small data support types. */enum rs6000_sdata_type { SDATA_NONE, /* No small data support. */ SDATA_DATA, /* Just put data in .sbss/.sdata, don't use relocs. */ SDATA_SYSV, /* Use r13 to point to .sdata/.sbss. */ SDATA_EABI /* Use r13 like above, r2 points to .sdata2/.sbss2. */};extern enum rs6000_sdata_type rs6000_sdata;#define TARGET_TOC ((target_flags & MASK_64BIT) \ || ((target_flags & (MASK_RELOCATABLE \ | MASK_MINIMAL_TOC)) \ && flag_pic > 1) \ || DEFAULT_ABI == ABI_AIX)#define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE)#define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)#define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE)#define TARGET_NO_TOC (! TARGET_TOC)#define TARGET_NO_EABI (! TARGET_EABI)#ifdef HAVE_AS_REL16#undef TARGET_SECURE_PLT#define TARGET_SECURE_PLT secure_plt#endifextern const char *rs6000_abi_name;extern const char *rs6000_sdata_name;extern const char *rs6000_tls_size_string; /* For -mtls-size= */#define SDATA_DEFAULT_SIZE 8/* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if defined, is executed once just after all the command options have been parsed. The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to get control. */#define SUBTARGET_OVERRIDE_OPTIONS \do { \ if (!g_switch_set) \ g_switch_value = SDATA_DEFAULT_SIZE; \ \ if (rs6000_abi_name == NULL) \ rs6000_abi_name = RS6000_ABI_NAME; \ \ if (!strcmp (rs6000_abi_name, "sysv")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \ { \ rs6000_current_abi = ABI_V4; \ target_flags &= ~ MASK_EABI; \ } \ else if (!strcmp (rs6000_abi_name, "sysv-eabi") \ || !strcmp (rs6000_abi_name, "eabi")) \ { \ rs6000_current_abi = ABI_V4; \ target_flags |= MASK_EABI; \ } \ else if (!strcmp (rs6000_abi_name, "aixdesc")) \ rs6000_current_abi = ABI_AIX; \ else if (!strcmp (rs6000_abi_name, "freebsd")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "linux")) \ { \ if (TARGET_64BIT) \ rs6000_current_abi = ABI_AIX; \ else \ rs6000_current_abi = ABI_V4; \ } \ else if (!strcmp (rs6000_abi_name, "gnu")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "netbsd")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "openbsd")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "i960-old")) \ { \ rs6000_current_abi = ABI_V4; \ target_flags |= (MASK_LITTLE_ENDIAN | MASK_EABI \ | MASK_NO_BITFIELD_WORD); \ target_flags &= ~MASK_STRICT_ALIGN; \ } \ else \ { \ rs6000_current_abi = ABI_V4; \ error ("bad value for -mcall-%s", rs6000_abi_name); \ } \ \ if (rs6000_sdata_name) \ { \ if (!strcmp (rs6000_sdata_name, "none")) \ rs6000_sdata = SDATA_NONE; \ else if (!strcmp (rs6000_sdata_name, "data")) \ rs6000_sdata = SDATA_DATA; \ else if (!strcmp (rs6000_sdata_name, "default")) \ rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \ else if (!strcmp (rs6000_sdata_name, "sysv")) \ rs6000_sdata = SDATA_SYSV; \ else if (!strcmp (rs6000_sdata_name, "eabi")) \ rs6000_sdata = SDATA_EABI; \ else \ error ("bad value for -msdata=%s", rs6000_sdata_name); \ } \ else if (DEFAULT_ABI == ABI_V4) \ { \ rs6000_sdata = SDATA_DATA; \ rs6000_sdata_name = "data"; \ } \ else \ { \ rs6000_sdata = SDATA_NONE; \ rs6000_sdata_name = "none"; \ } \ \ if (TARGET_RELOCATABLE && \ (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ { \ rs6000_sdata = SDATA_DATA; \ error ("-mrelocatable and -msdata=%s are incompatible", \ rs6000_sdata_name); \ } \ \ else if (flag_pic && DEFAULT_ABI != ABI_AIX \ && (rs6000_sdata == SDATA_EABI \ || rs6000_sdata == SDATA_SYSV)) \ { \ rs6000_sdata = SDATA_DATA; \ error ("-f%s and -msdata=%s are incompatible", \ (flag_pic > 1) ? "PIC" : "pic", \ rs6000_sdata_name); \ } \ \ if ((rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4) \ || (rs6000_sdata == SDATA_EABI && !TARGET_EABI)) \ { \ rs6000_sdata = SDATA_NONE; \ error ("-msdata=%s and -mcall-%s are incompatible", \ rs6000_sdata_name, rs6000_abi_name); \ } \ \ targetm.have_srodata_section = rs6000_sdata == SDATA_EABI; \ \ if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \ { \ target_flags |= MASK_MINIMAL_TOC; \ error ("-mrelocatable and -mno-minimal-toc are incompatible"); \ } \ \ if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX) \ { \ target_flags &= ~MASK_RELOCATABLE; \ error ("-mrelocatable and -mcall-%s are incompatible", \ rs6000_abi_name); \ } \ \ if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi == ABI_AIX) \ { \ flag_pic = 0; \ error ("-fPIC and -mcall-%s are incompatible", \ rs6000_abi_name); \ } \ \ if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \ { \ target_flags &= ~MASK_LITTLE_ENDIAN; \ error ("-mcall-aixdesc must be big endian"); \ } \ \ if (TARGET_SECURE_PLT != secure_plt) \ { \ error ("-msecure-plt not supported by your assembler"); \ } \ \ if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128 \ && rs6000_explicit_options.long_double) \ warning (0, "-msoft-float and -mlong-double-128 not supported"); \ \ /* Treat -fPIC the same as -mrelocatable. */ \ if (flag_pic > 1 && DEFAULT_ABI != ABI_AIX) \ target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \ \ else if (TARGET_RELOCATABLE) \ flag_pic = 2; \} while (0)#ifndef RS6000_BI_ARCH# define SUBSUBTARGET_OVERRIDE_OPTIONS \do { \ if ((TARGET_DEFAULT ^ target_flags) & MASK_64BIT) \ error ("-m%s not supported in this configuration", \ (target_flags & MASK_64BIT) ? "64" : "32"); \} while (0)#endif/* Override rs6000.h definition. */#undef TARGET_DEFAULT#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)/* Override rs6000.h definition. */#undef PROCESSOR_DEFAULT#define PROCESSOR_DEFAULT PROCESSOR_PPC750/* SVR4 only defined for PowerPC, so short-circuit POWER patterns. */#undef TARGET_POWER#define TARGET_POWER 0#define FIXED_R2 1/* System V.4 uses register 13 as a pointer to the small data area, so it is not available to the normal user. */#define FIXED_R13 1/* Override default big endianism definitions in rs6000.h. */#undef BYTES_BIG_ENDIAN#undef WORDS_BIG_ENDIAN#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)/* Define this to set the endianness to use in libgcc2.c, which can not depend on target_flags. */#if !defined(__LITTLE_ENDIAN__) && !defined(__sun__)#define LIBGCC2_WORDS_BIG_ENDIAN 1#else#define LIBGCC2_WORDS_BIG_ENDIAN 0#endif/* Define cutoff for using external functions to save floating point. Currently on V.4, always use inline stores. */#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)/* Put jump tables in read-only memory, rather than in .text. */#define JUMP_TABLES_IN_TEXT_SECTION 0/* Prefix and suffix to use to saving floating point. */#define SAVE_FP_PREFIX "_savefpr_"#define SAVE_FP_SUFFIX "_l"/* Prefix and suffix to use to restoring floating point. */#define RESTORE_FP_PREFIX "_restfpr_"#define RESTORE_FP_SUFFIX "_l"/* Type used for ptrdiff_t, as a string used in a declaration. */#define PTRDIFF_TYPE "int"/* Type used for wchar_t, as a string used in a declaration. *//* Override svr4.h definition. */#undef WCHAR_TYPE#define WCHAR_TYPE "long int"/* Width of wchar_t in bits. *//* Override svr4.h definition. */#undef WCHAR_TYPE_SIZE#define WCHAR_TYPE_SIZE 32/* Make int foo : 8 not cause structures to be aligned to an int boundary. *//* Override elfos.h definition. */#undef PCC_BITFIELD_TYPE_MATTERS#define PCC_BITFIELD_TYPE_MATTERS (TARGET_BITFIELD_TYPE)#undef BITFIELD_NBYTES_LIMITED#define BITFIELD_NBYTES_LIMITED (TARGET_NO_BITFIELD_WORD)/* Define this macro to be the value 1 if instructions will fail to work if given data not on the nominal alignment. If instructions will merely go slower in that case, define this macro as 0. */#undef STRICT_ALIGNMENT#define STRICT_ALIGNMENT (TARGET_STRICT_ALIGN)/* Define this macro if you wish to preserve a certain alignment for the stack pointer, greater than what the hardware enforces. The definition is a C expression for the desired alignment (measured in bits). This macro must evaluate to a value equal to or larger than STACK_BOUNDARY. For the SYSV ABI and variants the alignment of the stack pointer is usually controlled manually in rs6000.c. However, to maintain alignment across alloca () in all circumstances, PREFERRED_STACK_BOUNDARY needs to be set as well. This has the additional advantage of allowing a bigger maximum alignment of user objects on the stack. */#undef PREFERRED_STACK_BOUNDARY#define PREFERRED_STACK_BOUNDARY 128/* Real stack boundary as mandated by the appropriate ABI. */#define ABI_STACK_BOUNDARY \ ((TARGET_EABI && !TARGET_ALTIVEC && !TARGET_ALTIVEC_ABI) ? 64 : 128)/* An expression for the alignment of a structure field FIELD if the alignment computed in the usual way is COMPUTED. */#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE) \ ? 128 : COMPUTED)#undef BIGGEST_FIELD_ALIGNMENT/* Use ELF style section commands. */#define TEXT_SECTION_ASM_OP "\t.section\t\".text\""#define DATA_SECTION_ASM_OP "\t.section\t\".data\""#define BSS_SECTION_ASM_OP "\t.section\t\".bss\""/* Override elfos.h definition. */#undef INIT_SECTION_ASM_OP#define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""/* Override elfos.h definition. */#undef FINI_SECTION_ASM_OP#define FINI_SECTION_ASM_OP "\t.section\t\".fini\",\"ax\""#define TOC_SECTION_ASM_OP "\t.section\t\".got\",\"aw\""/* Put PC relative got entries in .got2. */#define MINIMAL_TOC_SECTION_ASM_OP \ (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI != ABI_AIX) \ ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")#define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""#define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""#define SBSS_SECTION_ASM_OP "\t.section\t\".sbss\",\"aw\",@nobits"/* Besides the usual ELF sections, we need a toc section. *//* Override elfos.h definition. */#undef EXTRA_SECTIONS#define EXTRA_SECTIONS in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini/* Override elfos.h definition. */#undef EXTRA_SECTION_FUNCTIONS#define EXTRA_SECTION_FUNCTIONS \ TOC_SECTION_FUNCTION \ SDATA_SECTION_FUNCTION \ SDATA2_SECTION_FUNCTION \ SBSS_SECTION_FUNCTION \ INIT_SECTION_FUNCTION \ FINI_SECTION_FUNCTION#define TOC_SECTION_FUNCTION \void \toc_section (void) \{ \ if (in_section != in_toc) \ { \ in_section = in_toc; \ if (DEFAULT_ABI == ABI_AIX \ && TARGET_MINIMAL_TOC \ && !TARGET_RELOCATABLE) \ { \ if (! toc_initialized) \ { \ toc_initialized = 1; \ fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); \ fprintf (asm_out_file, "\t.tc "); \ ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); \ ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ fprintf (asm_out_file, "\n"); \ \ fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ fprintf (asm_out_file, " = .+32768\n"); \ } \ else \ fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ } \ else if (DEFAULT_ABI == ABI_AIX && !TARGET_RELOCATABLE) \ fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); \ else \ { \ fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ if (! toc_initialized) \ { \ ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); \ fprintf (asm_out_file, " = .+32768\n"); \ toc_initialized = 1; \ } \ } \ } \} \ \extern int in_toc_section (void); \int in_toc_section (void) \{ \ return in_section == in_toc; \}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -