📄 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 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* Header files should be C++ aware in general. */#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;/* V.4/eabi switches. */#define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0. */#define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */#define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative. */#define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec. */#define MASK_LITTLE_ENDIAN 0x04000000 /* Target is little endian. */#define MASK_REGNAMES 0x02000000 /* Use alternate register names. */#define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args. */#define MASK_NO_BITFIELD_WORD 0x00800000 /* Bitfields cannot cross word boundaries */#define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE)#define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN)#define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE)#define TARGET_EABI (target_flags & MASK_EABI)#define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN)#define TARGET_REGNAMES (target_flags & MASK_REGNAMES)#define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE)#define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD)#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)/* Strings provided by SUBTARGET_OPTIONS */extern const char *rs6000_abi_name;extern const char *rs6000_sdata_name;extern const char *rs6000_tls_size_string; /* For -mtls-size= *//* Override rs6000.h definition. */#undef SUBTARGET_OPTIONS#define SUBTARGET_OPTIONS \ { "call-", &rs6000_abi_name, N_("Select ABI calling convention"), 0}, \ { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling"), 0}, \ { "tls-size=", &rs6000_tls_size_string, \ N_("Specify bit size of immediate TLS offsets"), 0 }#define SDATA_DEFAULT_SIZE 8/* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just the same as -mminimal-toc. *//* Override rs6000.h definition. */#undef SUBTARGET_SWITCHES#define SUBTARGET_SWITCHES \ { "bit-align", -MASK_NO_BITFIELD_TYPE, \ N_("Align to the base type of the bit-field") }, \ { "no-bit-align", MASK_NO_BITFIELD_TYPE, \ N_("Don't align to the base type of the bit-field") }, \ { "strict-align", MASK_STRICT_ALIGN, \ N_("Don't assume that unaligned accesses are handled by the system") }, \ { "no-strict-align", -MASK_STRICT_ALIGN, \ N_("Assume that unaligned accesses are handled by the system") }, \ { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ N_("Produce code relocatable at runtime") }, \ { "no-relocatable", -MASK_RELOCATABLE, \ N_("Don't produce code relocatable at runtime") }, \ { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ N_("Produce code relocatable at runtime") }, \ { "no-relocatable-lib", -MASK_RELOCATABLE, \ N_("Don't produce code relocatable at runtime") }, \ { "little-endian", MASK_LITTLE_ENDIAN, \ N_("Produce little endian code") }, \ { "little", MASK_LITTLE_ENDIAN, \ N_("Produce little endian code") }, \ { "big-endian", -MASK_LITTLE_ENDIAN, \ N_("Produce big endian code") }, \ { "big", -MASK_LITTLE_ENDIAN, \ N_("Produce big endian code") }, \ { "no-toc", 0, N_("no description yet") }, \ { "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ { "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ { "prototype", MASK_PROTOTYPE, N_("no description yet") }, \ { "no-prototype", -MASK_PROTOTYPE, N_("no description yet") }, \ { "no-traceback", 0, N_("no description yet") }, \ { "eabi", MASK_EABI, N_("Use EABI") }, \ { "no-eabi", -MASK_EABI, N_("Don't use EABI") }, \ { "bit-word", -MASK_NO_BITFIELD_WORD, "" }, \ { "no-bit-word", MASK_NO_BITFIELD_WORD, \ N_("Do not allow bit-fields to cross word boundaries") }, \ { "regnames", MASK_REGNAMES, \ N_("Use alternate register names") }, \ { "no-regnames", -MASK_REGNAMES, \ N_("Don't use alternate register names") }, \ { "sdata", 0, N_("no description yet") }, \ { "no-sdata", 0, N_("no description yet") }, \ { "sim", 0, \ N_("Link with libsim.a, libc.a and sim-crt0.o") }, \ { "ads", 0, \ N_("Link with libads.a, libc.a and crt0.o") }, \ { "yellowknife", 0, \ N_("Link with libyk.a, libc.a and crt0.o") }, \ { "mvme", 0, \ N_("Link with libmvme.a, libc.a and crt0.o") }, \ { "emb", 0, \ N_("Set the PPC_EMB bit in the ELF flags header") }, \ { "windiss", 0, N_("Use the WindISS simulator") }, \ { "shlib", 0, N_("no description yet") }, \ { "64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ N_("Generate 64-bit code") }, \ { "32", - (MASK_64BIT | MASK_POWERPC64), \ N_("Generate 32-bit code") }, \ EXTRA_SUBTARGET_SWITCHES \ { "newlib", 0, N_("no description yet") },/* This is meant to be redefined in the host dependent files. */#define EXTRA_SUBTARGET_SWITCHES/* 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"); \ } \ \ /* 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/* Size of the V.4 varargs area if needed. *//* Override rs6000.h definition. */#undef RS6000_VARARGS_AREA#define RS6000_VARARGS_AREA (current_function_stdarg ? RS6000_VARARGS_SIZE : 0)/* 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)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -