📄 sysv4.h
字号:
#define BIGGEST_ALIGNMENT ((TARGET_EABI && !TARGET_ALTIVEC) ? 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)/* Define this macro as an expression for the alignment of a type (given by TYPE as a tree node) if the alignment computed in the usual way is COMPUTED and the alignment explicitly specified was SPECIFIED. */#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED) \ ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) \ ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \ : MAX (COMPUTED, SPECIFIED))#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) ? "\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_const, in_toc, in_sdata, in_sdata2, in_sbss, in_init, in_fini/* Override elfos.h definition. */#undef EXTRA_SECTION_FUNCTIONS#define EXTRA_SECTION_FUNCTIONS \ CONST_SECTION_FUNCTION \ 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 () \{ \ 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); \ ASM_OUTPUT_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 PARAMS ((void)); \int in_toc_section () \{ \ return in_section == in_toc; \}#define SDATA_SECTION_FUNCTION \void \sdata_section () \{ \ if (in_section != in_sdata) \ { \ in_section = in_sdata; \ fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ } \}#define SDATA2_SECTION_FUNCTION \void \sdata2_section () \{ \ if (in_section != in_sdata2) \ { \ in_section = in_sdata2; \ fprintf (asm_out_file, "%s\n", SDATA2_SECTION_ASM_OP); \ } \}#define SBSS_SECTION_FUNCTION \void \sbss_section () \{ \ if (in_section != in_sbss) \ { \ in_section = in_sbss; \ fprintf (asm_out_file, "%s\n", SBSS_SECTION_ASM_OP); \ } \}#define INIT_SECTION_FUNCTION \void \init_section () \{ \ if (in_section != in_init) \ { \ in_section = in_init; \ fprintf (asm_out_file, "%s\n", INIT_SECTION_ASM_OP); \ } \}#define FINI_SECTION_FUNCTION \void \fini_section () \{ \ if (in_section != in_fini) \ { \ in_section = in_fini; \ fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP); \ } \}/* A C statement or statements to switch to the appropriate section for output of RTX in mode MODE. You can assume that RTX is some kind of constant in RTL. The argument MODE is redundant except in the case of a `const_int' rtx. Select the section by calling `text_section' or one of the alternatives for other sections. Do not define this macro if you put all constants in the read-only data section. *//* Override elfos.h definition. */#undef SELECT_RTX_SECTION#define SELECT_RTX_SECTION(MODE, X, ALIGN) rs6000_select_rtx_section (MODE, X)/* A C statement or statements to switch to the appropriate section for output of DECL. DECL is either a `VAR_DECL' node or a constant of some sort. RELOC indicates whether forming the initial value of DECL requires link-time relocations. *//* Override elfos.h definition. */#undef SELECT_SECTION#define SELECT_SECTION(DECL, RELOC, ALIGN) rs6000_select_section (DECL, RELOC)/* A C statement to build up a unique section name, expressed as a STRING_CST node, and assign it to DECL_SECTION_NAME (decl). RELOC indicates whether the initial value of EXP requires link-time relocations. If you do not define this macro, GCC will use the symbol name prefixed by `.' as the section name. Note - this macro can now be called for uninitialized data items as well as initialised data and functions. *//* Override elfos.h definition. */#undef UNIQUE_SECTION#define UNIQUE_SECTION(DECL, RELOC) rs6000_unique_section (DECL, RELOC)/* 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. Unlike AIX, we don't key off of -mminimal-toc, but instead do not allow floating point constants in the TOC if -mrelocatable. */#undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P#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)) \ || (!TARGET_NO_FP_IN_TOC \ && !TARGET_RELOCATABLE \ && GET_CODE (X) == CONST_DOUBLE \ && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && BITS_PER_WORD == HOST_BITS_PER_INT)))/* These macros generate the special .type and .size directives which are used to set the corresponding fields of the linker symbol table entries in an ELF object file under SVR4. These macros also output the starting labels for the relevant functions/objects. *//* Write the extra assembler code needed to declare a function properly. Some svr4 assemblers need to also have something extra said about the function's return value. We allow for that here. */extern int rs6000_pic_labelno;/* Override elfos.h definition. */#undef ASM_DECLARE_FUNCTION_NAME#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ do { \ const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \ \ if (TARGET_RELOCATABLE \ && (get_pool_size () != 0 || current_function_profile) \ && uses_TOC()) \ { \ char buf[256]; \ \ ASM_OUTPUT_INTERNAL_LABEL (FILE, "LCL", rs6000_pic_labelno); \ \ ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 1); \ fprintf (FILE, "\t%s ", init_ptr); \ assemble_name (FILE, buf); \ putc ('-', FILE); \ ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); \ assemble_name (FILE, buf); \ putc ('\n', FILE); \ } \ \ fprintf (FILE, "%s", TYPE_ASM_OP); \ assemble_name (FILE, NAME); \ putc (',', FILE); \ fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ putc ('\n', FILE); \ ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ \ if (DEFAULT_ABI == ABI_AIX) \ { \ const char *desc_name, *orig_name; \ \ STRIP_NAME_ENCODING (orig_name, NAME); \ desc_name = orig_name; \ while (*desc_name == '.') \ desc_name++; \ \ if (TREE_PUBLIC (DECL)) \ fprintf (FILE, "\t.globl %s\n", desc_name); \ \ fprintf (FILE, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); \ fprintf (FILE, "%s:\n", desc_name); \ fprintf (FILE, "\t%s %s\n", init_ptr, orig_name); \ fprintf (FILE, "\t%s _GLOBAL_OFFSET_TABLE_\n", init_ptr); \ if (DEFAULT_ABI == ABI_AIX) \ fprintf (FILE, "\t%s 0\n", init_ptr); \ fprintf (FILE, "\t.previous\n"); \ } \ ASM_OUTPUT_LABEL (FILE, NAME); \ } while (0)/* A C compound statement that outputs the assembler code for a thunk function, used to implement C++ virtual function calls with multiple inheritance. The thunk acts as a wrapper around a virtual function, adjusting the implicit object parameter before handing control off to the real function. First, emit code to add the integer DELTA to the location that contains the incoming first argument. Assume that this argument contains a pointer, and is the one used to pass the this' pointer in C++. This is the incoming argument *before* the function prologue, e.g. %o0' on a sparc. The addition must preserve the values of all other incoming arguments. After the addition, emit code to jump to FUNCTION, which is a FUNCTION_DECL'. This is a direct pure jump, not a call, and does not touch the return address. Hence returning from FUNCTION will return to whoever called the current thunk'. The effect must be as if FUNCTION had been called directly with the adjusted first argument. This macro is responsible for emitting all of the code for a thunk function; FUNCTION_PROLOGUE' and FUNCTION_EPILOGUE' are not invoked. The THUNK_FNDECL is redundant. (DELTA and FUNCTION have already been extracted from it.) It might possibly be useful on some targets, but probably not. If you do not define this macro, the target-independent code in the C++ frontend will generate a less efficient heavyweight thunk that calls FUNCTION instead of jumping to it. The generic approach does not support varargs. */#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ output_mi_thunk (FILE, THUNK_FNDECL, DELTA, FUNCTION)/* The USER_LABEL_PREFIX stuff is affected by the -fleading-underscore flag. The LOCAL_LABEL_PREFIX variable is used by dbxelf.h. */#define LOCAL_LABEL_PREFIX "."#define USER_LABEL_PREFIX ""/* svr4.h overrides ASM_OUTPUT_INTERNAL_LABEL. */#define ASM_OUTPUT_INTERNAL_LABEL_PREFIX(FILE,PREFIX) \ asm_fprintf (FILE, "%L%s", PREFIX)#define ASM_OUTPUT_LABEL(FILE,NAME) \ (assemble_name (FILE, NAME), fputs (":\n", FILE))/* 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); \ assemble_name (FILE, NAME); putc ('\n', FILE);} while (0)/* This says how to output assembler code to declare an uninitialized internal linkage data object. Under SVR4, the linker seems to want the alignment of data objects to depend on their types. We do exactly that here. */#define LOCAL_ASM_OP "\t.local\t"#define LCOMM_ASM_OP "\t.lcomm\t"/* Override elfos.h definition. */#undef ASM_OUTPUT_ALIGNED_LOCAL#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \do { \ if (rs6000_sdata != SDATA_NONE && (SIZE) > 0 \ && (SIZE) <= g_switch_value) \ { \ sbss_section (); \ ASM_OUTPUT_ALIGN (FILE, exact_log2 (ALIGN / BITS_PER_UNIT)); \ ASM_OUTPUT_LABEL (FILE, NAME); \ ASM_OUTPUT_SKIP (FILE, SIZE); \ if (!flag_inhibit_size_directive && (SIZE) > 0) \ { \ fprintf (FILE, "%s", SIZE_ASM_OP); \ assemble_name (FILE, NAME); \ fprintf (FILE, ",%d\n", SIZE); \ } \ } \ else \ { \ fprintf (FILE, "%s", LCOMM_ASM_OP); \ assemble_name ((FILE), (NAME)); \ fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \ } \} while (0)/* Describe how to emit uninitialized external linkage items. */#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \do { \ ASM_GLOBALIZE_LABEL (FILE, NAME); \ ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN); \} while (0)/* This is how to output code to push a register on the stack. It need not be very fast code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -