osfrose.h
来自「gcc3.2.1源代码」· C头文件 代码 · 共 721 行 · 第 1/2 页
H
721 行
/* Definitions of target machine for GNU compiler. Intel 386 (OSF/1 with OSF/rose) version. Copyright (C) 1991, 1992, 1993, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING. If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA. */#include "halfpic.h"#include "i386/gstabs.h"#define OSF_OS#undef WORD_SWITCH_TAKES_ARG#define WORD_SWITCH_TAKES_ARG(STR) \ (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) || !strcmp (STR, "pic-names"))/* This defines which switch letters take arguments. On svr4, most of the normal cases (defined in gcc.c) apply, and we also have -h* and -z* options (for the linker). */#define SWITCH_TAKES_ARG(CHAR) \ (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ || (CHAR) == 'h' \ || (CHAR) == 'z')#define MASK_HALF_PIC 010000000000 /* Mask for half-pic code */#define MASK_HALF_PIC_DEBUG 004000000000 /* Debug flag */#define MASK_ELF 002000000000 /* ELF not rose */#define MASK_NO_UNDERSCORES 000400000000 /* suppress leading _ */#define MASK_LARGE_ALIGN 000200000000 /* align to >word boundaries */#define MASK_NO_MCOUNT 000100000000 /* profiling uses mcount_ptr */#define TARGET_HALF_PIC (target_flags & MASK_HALF_PIC)#define TARGET_DEBUG (target_flags & MASK_HALF_PIC_DEBUG)#define HALF_PIC_DEBUG TARGET_DEBUG#define TARGET_ELF (target_flags & MASK_ELF)#define TARGET_ROSE ((target_flags & MASK_ELF) == 0)#define TARGET_UNDERSCORES ((target_flags & MASK_NO_UNDERSCORES) == 0)#define TARGET_LARGE_ALIGN (target_flags & MASK_LARGE_ALIGN)#define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0)#undef SUBTARGET_SWITCHES#define SUBTARGET_SWITCHES \ { "half-pic", MASK_HALF_PIC, \ N_("Emit half-PIC code") }, \ { "no-half-pic", -MASK_HALF_PIC, "" }, \ { "debug-half-pic", MASK_HALF_PIC_DEBUG, \ 0 /* intentionally undoc */ }, \ { "debugb", MASK_HALF_PIC_DEBUG, \ 0 /* intentionally undoc */ }, \ { "elf", MASK_ELF, \ N_("Emit ELF object code") }, \ { "rose", -MASK_ELF, \ N_("Emit ROSE object code") }, \ { "underscores", -MASK_NO_UNDERSCORES, \ N_("Symbols have a leading underscore") }, \ { "no-underscores", MASK_NO_UNDERSCORES, "" }, \ { "large-align", MASK_LARGE_ALIGN, \ N_("Align to >word boundaries") }, \ { "no-large-align", -MASK_LARGE_ALIGN, "" }, \ { "mcount", -MASK_NO_MCOUNT, \ N_("Use mcount for profiling") }, \ { "mcount-ptr", MASK_NO_MCOUNT, \ N_("Use mcount_ptr for profiling") }, \ { "no-mcount", MASK_NO_MCOUNT, "" },/* OSF/rose uses stabs, not dwarf. */#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG#ifndef DWARF_DEBUGGING_INFO#define DWARF_DEBUGGING_INFO /* enable dwarf debugging for testing */#endif/* Handle #pragma weak and #pragma pack. */#define HANDLE_SYSV_PRAGMA#define SUPPORTS_WEAK TARGET_ELF/* Change default predefines. */#undef CPP_PREDEFINES#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem=xpg4"#undef CPP_SPEC#define CPP_SPEC "%(cpp_cpu) \%{!melf: -D__ROSE__ %{!pic-none: -D__SHARED__}} \%{melf: -D__ELF__ %{fpic: -D__SHARED__}} \%{mno-underscores: -D__NO_UNDERSCORES__} \%{melf: %{!munderscores: -D__NO_UNDERSCORES__}} \%{.S: %{!ansi:%{!traditional:%{!traditional-cpp:%{!ftraditional: -traditional}}}}} \%{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \%{.cc: -D__LANGUAGE_C_PLUS_PLUS} \%{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \%{.C: -D__LANGUAGE_C_PLUS_PLUS} \%{.m: -D__LANGUAGE_OBJECTIVE_C} \%{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}"/* Turn on -pic-extern by default for OSF/rose, -fpic for ELF. */#undef CC1_SPEC#define CC1_SPEC "%(cc1_cpu) \%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \%{!melf: %{!mrose: -mrose }} \%{melf: %{!munderscores: %{!mno-underscores: -mno-underscores }} \ %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount-ptr }}}} \%{!melf: %{!munderscores: %{!mno-underscores: -munderscores }} \ %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount }}} \ %{pic-extern: -mhalf-pic } %{pic-lib: -mhalf-pic } \ %{!pic-extern: %{!pic-lib: %{pic-none: -mno-half-pic} %{!pic-none: -mhalf-pic}}} \ %{pic-calls: } %{pic-names*: }}"#undef ASM_SPEC#define ASM_SPEC "%{v*: -v}"#undef LINK_SPEC#define LINK_SPEC "%{v*: -v} \%{!melf: %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \ %{nostdlib} %{noshrlib} %{glue}} \%{melf: %{dy} %{dn} %{glue: } \ %{h*} %{z*} \ %{static:-dn -Bstatic} \ %{shared:-G -dy} \ %{symbolic:-Bsymbolic -G -dy} \ %{G:-G} \ %{!dy: %{!dn: %{!static: %{!shared: %{!symbolic: \ %{noshrlib: -dn } %{pic-none: -dn } \ %{!noshrlib: %{!pic-none: -dy}}}}}}}}"#undef LIB_SPEC#define LIB_SPEC "-lc"#undef LIBG_SPEC#define LIBG_SPEC ""#undef STARTFILE_SPEC#define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"#undef TARGET_VERSION_INTERNAL#undef TARGET_VERSION#define I386_VERSION " 80386, OSF/rose objects"#define TARGET_VERSION_INTERNAL(STREAM) fputs (I386_VERSION, STREAM)#define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)#undef MD_EXEC_PREFIX#define MD_EXEC_PREFIX "/usr/ccs/gcc/"#undef MD_STARTFILE_PREFIX#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"/* Specify size_t, ptrdiff_t, and wchar_t types. */#undef SIZE_TYPE#undef PTRDIFF_TYPE#undef WCHAR_TYPE#undef WCHAR_TYPE_SIZE#define SIZE_TYPE "long unsigned int"#define PTRDIFF_TYPE "int"#define WCHAR_TYPE "unsigned int"#define WCHAR_TYPE_SIZE BITS_PER_WORD/* Define this macro if the system header files support C++ as well as C. This macro inhibits the usual method of using system header files in C++, which is to pretend that the file's contents are enclosed in `extern "C" {...}'. */#define NO_IMPLICIT_EXTERN_C/* Turn off long double being 96 bits. */#undef LONG_DOUBLE_TYPE_SIZE#define LONG_DOUBLE_TYPE_SIZE 64#define OSF_PROFILE_BEFORE_PROLOGUE \ (!TARGET_MCOUNT \ && !current_function_needs_context \ && (!flag_pic \ || !frame_pointer_needed \ || (!current_function_uses_pic_offset_table \ && !current_function_uses_const_pool)))/* A C statement or compound statement to output to FILE some assembler code to call the profiling subroutine `mcount'. Before calling, the assembler code must load the address of a counter variable into a register where `mcount' expects to find the address. The name of this variable is `LP' followed by the number LABELNO, so you would generate the name using `LP%d' in a `fprintf'. The details of how the address should be passed to `mcount' are determined by your operating system environment, not by GNU CC. To figure them out, compile a small program for profiling using the system's installed C compiler and look at the assembler code that results. */#undef FUNCTION_PROFILER#define FUNCTION_PROFILER(FILE, LABELNO) \do \ { \ if (!OSF_PROFILE_BEFORE_PROLOGUE) \ { \ const char *const prefix = (TARGET_UNDERSCORES) ? "_" : ""; \ const char *const lprefix = LPREFIX; \ int labelno = LABELNO; \ \ /* Note that OSF/rose blew it in terms of calling mcount, \ since OSF/rose prepends a leading underscore, but mcount's \ doesn't. At present, we keep this kludge for ELF as well \ to allow old kernels to build profiling. */ \ \ if (flag_pic \ && !current_function_uses_pic_offset_table \ && !current_function_uses_const_pool) \ abort (); \ \ if (TARGET_MCOUNT && flag_pic) \ { \ fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ lprefix, labelno); \ fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \ } \ \ else if (TARGET_MCOUNT && HALF_PIC_P ()) \ { \ rtx symdef; \ \ HALF_PIC_EXTERNAL ("mcount"); \ symdef = HALF_PIC_PTR (gen_rtx_SYMBOL_REF (Pmode, "mcount")); \ fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ fprintf (FILE, "\tcall *%s%s\n", prefix, XSTR (symdef, 0)); \ } \ \ else if (TARGET_MCOUNT) \ { \ fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ fprintf (FILE, "\tcall %smcount\n", prefix); \ } \ \ else if (flag_pic && frame_pointer_needed) \ { \ fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \ fprintf (FILE, "\tpushl %%ecx\n"); \ fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ lprefix, labelno); \ fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \ fprintf (FILE, "\tcall *(%%eax)\n"); \ fprintf (FILE, "\tpopl %%eax\n"); \ } \ \ else if (frame_pointer_needed) \ { \ fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \ fprintf (FILE, "\tpushl %%ecx\n"); \ fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ fprintf (FILE, "\tcall *_mcount_ptr\n"); \ fprintf (FILE, "\tpopl %%eax\n"); \ } \ \ else \ abort (); \ } \ } \while (0)/* A C function or functions which are needed in the library to support block profiling. When support goes into libc, undo the #if 0. */#if 0#undef BLOCK_PROFILING_CODE#define BLOCK_PROFILING_CODE#endif/* Prefix for internally generated assembler labels. If we aren't using underscores, we are using prefix `.'s to identify labels that should be ignored, as in `i386/gas.h' --karl@cs.umb.edu */#undef LPREFIX#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L")/* This is how to store into the string BUF the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. This is suitable for output with `assemble_name'. */#undef ASM_GENERATE_INTERNAL_LABEL#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ sprintf ((BUF), "*%s%s%ld", (TARGET_UNDERSCORES) ? "" : ".", \ (PREFIX), (long)(NUMBER))/* This is how to output an internal numbered label where PREFIX is the class of label and NUM is the number within the class. */#undef ASM_OUTPUT_INTERNAL_LABEL#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ fprintf (FILE, "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \ PREFIX, NUM)/* The prefix to add to user-visible assembler symbols. *//* target_flags is not accessible by the preprocessor */#undef USER_LABEL_PREFIX#define USER_LABEL_PREFIX "_"/* This is how to output a reference to a user-level label named NAME. */#undef ASM_OUTPUT_LABELREF#define ASM_OUTPUT_LABELREF(FILE,NAME) \ fprintf (FILE, "%s%s", (TARGET_UNDERSCORES) ? "_" : "", NAME)/* This is how to output an element of a case-vector that is relative. This is only used for PIC code. See comments by the `casesi' insn in i386.md for an explanation of the expression this outputs. */#undef ASM_OUTPUT_ADDR_DIFF_ELT#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)/* Output a definition */#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \do \{ \ fprintf ((FILE), "%s", SET_ASM_OP); \ assemble_name (FILE, LABEL1); \ fprintf (FILE, ","); \ assemble_name (FILE, LABEL2); \ fprintf (FILE, "\n"); \ } \while (0)/* A C expression to output text to align the location counter in the way that is desirable at a point in the code that is reached only by jumping. This macro need not be defined if you don't want any special alignment to be done at such a time. Most machine descriptions do not currently define the macro. */#undef LABEL_ALIGN_AFTER_BARRIER#define LABEL_ALIGN_AFTER_BARRIER(LABEL) \ ((!TARGET_LARGE_ALIGN && i386_align_jumps > 2) ? 2 : i386_align_jumps)/* A C expression to output text to align the location counter in the way that is desirable at the beginning of a loop. This macro need not be defined if you don't want any special alignment to be done at such a time. Most machine descriptions do not currently define the macro. */#undef LOOP_ALIGN#define LOOP_ALIGN(LABEL) (i386_align_loops)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?