📄 xcoff.h
字号:
/* Definitions of target machine for GNU compiler, for some generic XCOFF file format Copyright (C) 2001, 2002 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. */#define TARGET_OBJECT_FORMAT OBJECT_XCOFF/* The RS/6000 uses the XCOFF format. */#define XCOFF_DEBUGGING_INFO/* Define if the object format being used is COFF or a superset. */#define OBJECT_FORMAT_COFF/* Define the magic numbers that we recognize as COFF. AIX 4.3 adds U803XTOCMAGIC (0757) for 64-bit objects and AIX V5 adds U64_TOCMAGIC (0767), but collect2.c does not include files in the correct order to conditionally define the symbolic name in this macro. The AIX linker accepts import/export files as object files, so accept "#!" (0x2321) magic number. */#define MY_ISCOFF(magic) \ ((magic) == U802WRMAGIC || (magic) == U802ROMAGIC \ || (magic) == U802TOCMAGIC || (magic) == 0757 || (magic) == 0767 \ || (magic) == 0x2321)/* We don't have GAS for the RS/6000 yet, so don't write out special .stabs in cc1plus. */#define FASCIST_ASSEMBLER/* We define this to prevent the name mangler from putting dollar signs into function names. */#define NO_DOLLAR_IN_LABEL/* We define this to 0 so that gcc will never accept a dollar sign in a variable name. This is needed because the AIX assembler will not accept dollar signs. */#define DOLLARS_IN_IDENTIFIERS 0/* Define the extra sections we need. We define three: one is the read-only data section which is used for constants. This is a csect whose name is derived from the name of the input file. The second is for initialized global variables. This is a csect whose name is that of the variable. The third is the TOC. */#define EXTRA_SECTIONS \ read_only_data, private_data, read_only_private_data, toc, bss/* Define the routines to implement these extra sections. BIGGEST_ALIGNMENT is 64, so align the sections that much. */#define EXTRA_SECTION_FUNCTIONS \ \void \read_only_data_section () \{ \ if (in_section != read_only_data) \ { \ fprintf (asm_out_file, "\t.csect %s[RO],3\n", \ xcoff_read_only_section_name); \ in_section = read_only_data; \ } \} \ \void \private_data_section () \{ \ if (in_section != private_data) \ { \ fprintf (asm_out_file, "\t.csect %s[RW],3\n", \ xcoff_private_data_section_name); \ in_section = private_data; \ } \} \ \void \read_only_private_data_section () \{ \ if (in_section != read_only_private_data) \ { \ fprintf (asm_out_file, "\t.csect %s[RO],3\n", \ xcoff_private_data_section_name); \ in_section = read_only_private_data; \ } \} \ \void \toc_section () \{ \ if (TARGET_MINIMAL_TOC) \ { \ /* toc_section is always called at least once from ASM_FILE_START, \ so this is guaranteed to always be defined once and only once \ in each file. */ \ if (! toc_initialized) \ { \ fputs ("\t.toc\nLCTOC..1:\n", asm_out_file); \ fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \ toc_initialized = 1; \ } \ \ if (in_section != toc) \ fprintf (asm_out_file, "\t.csect toc_table[RW]%s\n", \ (TARGET_32BIT ? "" : ",3")); \ } \ else \ { \ if (in_section != toc) \ fputs ("\t.toc\n", asm_out_file); \ } \ in_section = toc; \}/* Define the name of our readonly data section. */#define READONLY_DATA_SECTION read_only_data_section/* Select the section for an initialized data object. On the RS/6000, we have a special section for all variables except those that are static. */#define SELECT_SECTION(EXP,RELOC,ALIGN) \{ \ if ((TREE_CODE (EXP) == STRING_CST \ && ! flag_writable_strings) \ || (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'd' \ && TREE_READONLY (EXP) && ! TREE_THIS_VOLATILE (EXP) \ && DECL_INITIAL (EXP) \ && (DECL_INITIAL (EXP) == error_mark_node \ || TREE_CONSTANT (DECL_INITIAL (EXP))) \ && ! (RELOC))) \ { \ if (TREE_PUBLIC (EXP)) \ read_only_data_section (); \ else \ read_only_private_data_section (); \ } \ else \ { \ if (TREE_PUBLIC (EXP)) \ data_section (); \ else \ private_data_section (); \ } \}/* Return non-zero if this entry is to be written into the constant pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST containing one of them. If -mfp-in-toc (the default), we also do this for floating-point constants. We actually can only do this if the FP formats of the target and host machines are the same, but we can't check that since not every file that uses GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when we can write the entry into the TOC and the entry is not larger than a TOC entry. */#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ (TARGET_TOC \ && (GET_CODE (X) == SYMBOL_REF \ || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ || GET_CODE (X) == LABEL_REF \ || (GET_CODE (X) == CONST_INT \ && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ || (GET_CODE (X) == CONST_DOUBLE \ && (TARGET_POWERPC64 \ || TARGET_MINIMAL_TOC \ || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && ! TARGET_NO_FP_IN_TOC)))))/* Select section for constant in constant pool. On RS/6000, all constants are in the private read-only data area. However, if this is being placed in the TOC it must be output as a toc entry. */#define SELECT_RTX_SECTION(MODE, X, ALIGN) \{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE)) \ toc_section (); \ else \ read_only_private_data_section (); \}/* If we are referencing a function that is static or is known to be in this file, make the SYMBOL_REF special. We can use this to indicate that we can branch to this function without emitting a no-op after the call. Do not set this flag if the function is weakly defined. */#define ENCODE_SECTION_INFO(DECL) \ if (TREE_CODE (DECL) == FUNCTION_DECL \ && !TREE_PUBLIC (DECL) \ && !DECL_WEAK (DECL)) \ SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;/* FP save and restore routines. */#define SAVE_FP_PREFIX "._savef"#define SAVE_FP_SUFFIX ""#define RESTORE_FP_PREFIX "._restf"#define RESTORE_FP_SUFFIX ""/* Function name to call to do profiling. */#undef RS6000_MCOUNT#define RS6000_MCOUNT ".__mcount"/* Function names to call to do floating point truncation. */#undef RS6000_ITRUNC#define RS6000_ITRUNC "__itrunc"#undef RS6000_UITRUNC#define RS6000_UITRUNC "__uitrunc"/* This outputs NAME to FILE up to the first null or '['. */#define RS6000_OUTPUT_BASENAME(FILE, NAME) \ { \ const char *_p; \ \ STRIP_NAME_ENCODING (_p, (NAME)); \ assemble_name ((FILE), _p); \ }/* This is how to output the definition of a user-level label named NAME, such as the label on a static function or variable NAME. */#define ASM_OUTPUT_LABEL(FILE,NAME) \ do { RS6000_OUTPUT_BASENAME (FILE, NAME); fputs (":\n", FILE); } while (0)/* This is how to output a command to make the user-level label named NAME defined for reference from other files. */#define ASM_GLOBALIZE_LABEL(FILE,NAME) \ do { fputs ("\t.globl ", FILE); \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -