📄 i386-interix.h
字号:
/* A default list of other sections which we might be "in" at any given time. For targets that use additional sections (e.g. .tdesc) you should override this definition in the target-specific file which includes this file. */#undef EXTRA_SECTIONS#define EXTRA_SECTIONS in_const, in_ctors, in_dtors/* A default list of extra section function definitions. For targets that use additional sections (e.g. .tdesc) you should override this definition in the target-specific file which includes this file. */#undef EXTRA_SECTION_FUNCTIONS#define EXTRA_SECTION_FUNCTIONS \ CONST_SECTION_FUNCTION \ CTORS_SECTION_FUNCTION \ DTORS_SECTION_FUNCTION#undef READONLY_DATA_SECTION#define READONLY_DATA_SECTION() const_section ()extern void text_section ();#define CONST_SECTION_FUNCTION \void \const_section () \{ \ if (!USE_CONST_SECTION) \ text_section(); \ else if (in_section != in_const) \ { \ fprintf (asm_out_file, "%s\n", CONST_SECTION_ASM_OP); \ in_section = in_const; \ } \}#define CTORS_SECTION_FUNCTION \void \ctors_section () \{ \ if (in_section != in_ctors) \ { \ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ in_section = in_ctors; \ } \}#define DTORS_SECTION_FUNCTION \void \dtors_section () \{ \ if (in_section != in_dtors) \ { \ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ in_section = in_dtors; \ } \}#if 0/* Currently gas chokes on this; that's not too hard to fix, but there's not a lot of impeteus to do it, either. If it is done, gas will have to handle long section name escapes (which are defined in the COFF/PE document as /nnn where nnn is a string table index). The benefit: section attributes and -ffunction-sections, neither of which seem to be critical. *//* gas may have been fixed? bfd was. *//* Switch into a generic section. This is currently only used to support section attributes. We make the section read-only and executable for a function decl, read-only for a const data decl, and writable for a non-const data decl. */#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME) \ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, \ (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \ (DECL) && TREE_READONLY (DECL) ? "a" : "aw")#endif#define INT_ASM_OP ".long"/* The MS compilers take alignment as a number of bytes, so we do as well */#undef ASM_OUTPUT_ALIGN#define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG)!=0) fprintf ((FILE), "\t.balign %d\n", 1<<(LOG))/* A C statement (sans semicolon) to output an element in the table of global constructors. */#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ do { \ ctors_section (); \ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ assemble_name (FILE, NAME); \ fprintf (FILE, "\n"); \ } while (0)/* A C statement (sans semicolon) to output an element in the table of global destructors. */#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \ do { \ dtors_section (); \ fprintf (FILE, "\t%s\t ", INT_ASM_OP); \ assemble_name (FILE, NAME); \ fprintf (FILE, "\n"); \ } while (0)/* The linker will take care of this, and having them causes problems with ld -r (specifically -rU). */#define CTOR_LISTS_DEFINED_EXTERNALLY 1#define SET_ASM_OP ".set"/* Output a definition (implements alias) */#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \do \{ \ fprintf ((FILE), "\t%s\t", SET_ASM_OP); \ assemble_name (FILE, LABEL1); \ fprintf (FILE, ","); \ assemble_name (FILE, LABEL2); \ fprintf (FILE, "\n"); \ } \while (0)#define HOST_PTR_PRINTF "%p"#define HOST_PTR_AS_INT unsigned long#define PCC_BITFIELD_TYPE_MATTERS 1#define PCC_BITFIELD_TYPE_TEST TYPE_NATIVE(rec)#define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)/* The following two flags are usually "off" for i386, because some non-gnu tools (for the i386) don't handle them. However, we don't have that problem, so.... *//* Forward references to tags are allowed. */#define SDB_ALLOW_FORWARD_REFERENCES/* Unknown tags are also allowed. */#define SDB_ALLOW_UNKNOWN_REFERENCES/* The integer half of this list needs to be constant. However, there's a lot of disagreement about what the floating point adjustments should be. We pick one that works with gdb. (The underlying problem is what to do about the segment registers. Since we have access to them from /proc, we'll allow them to be accessed in gdb, even tho the gcc compiler can't generate them. (There's some evidence that MSVC does, but possibly only for certain special "canned" sequences.) */#undef DBX_REGISTER_NUMBER#define DBX_REGISTER_NUMBER(n) \((n) == 0 ? 0 \ : (n) == 1 ? 2 \ : (n) == 2 ? 1 \ : (n) == 3 ? 3 \ : (n) == 4 ? 6 \ : (n) == 5 ? 7 \ : (n) == 6 ? 5 \ : (n) == 7 ? 4 \ : ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+8 \ : (-1))/* Define this macro if references to a symbol must be treated differently depending on something about the variable or function named by the symbol (such as what section it is in). Apply stddef, handle (as yet unimplemented) pic. stddef renaming does NOT apply to Alpha. */char *gen_stdcall_suffix ();#undef ENCODE_SECTION_INFO#define ENCODE_SECTION_INFO(DECL) \do \ { \ if (flag_pic) \ { \ rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \ SYMBOL_REF_FLAG (XEXP (rtl, 0)) \ = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ || ! TREE_PUBLIC (DECL)); \ } \ if (TREE_CODE (DECL) == FUNCTION_DECL) \ if (lookup_attribute ("stdcall", \ TYPE_ATTRIBUTES (TREE_TYPE (DECL)))) \ XEXP (DECL_RTL (DECL), 0) = \ gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (DECL)); \ } \while (0)/* This macro gets just the user-specified name out of the string in a SYMBOL_REF. Discard trailing @[NUM] encoded by ENCODE_SECTION_INFO. */#undef STRIP_NAME_ENCODING#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \do { \ char *_p; \ char *_name = SYMBOL_NAME; \ for (_p = _name; *_p && *_p != '@'; ++_p) \ ; \ if (*_p == '@') \ { \ int _len = _p - _name; \ (VAR) = (char *) alloca (_len + 1); \ strncpy ((VAR), _name, _len); \ (VAR)[_len] = '\0'; \ } \ else \ (VAR) = _name; \} while (0) #if 0 /* Turn this back on when the linker is updated to handle grouped .data$ sections correctly. See corresponding note in i386/interix.c. MK. *//* Define this macro if in some cases global symbols from one translation unit may not be bound to undefined symbols in another translation unit without user intervention. For instance, under Microsoft Windows symbols must be explicitly imported from shared libraries (DLLs). */#define MULTIPLE_SYMBOL_SPACES#define UNIQUE_SECTION_P(DECL) DECL_ONE_ONLY (DECL)extern void i386_pe_unique_section ();#define UNIQUE_SECTION(DECL,RELOC) i386_pe_unique_section (DECL, RELOC)#define SUPPORTS_ONE_ONLY 1/* A C statement to output something to the assembler file to switch to section NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or NULL_TREE. Some target formats do not support arbitrary sections. Do not define this macro in such cases. */#undef ASM_OUTPUT_SECTION_NAME#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \do { \ static struct section_info \ { \ struct section_info *next; \ char *name; \ enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \ } *sections; \ struct section_info *s; \ char *mode; \ enum sect_enum type; \ \ for (s = sections; s; s = s->next) \ if (!strcmp (NAME, s->name)) \ break; \ \ if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \ type = SECT_EXEC, mode = "x"; \ else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \ type = SECT_RO, mode = "r"; \ else \ type = SECT_RW, mode = "w"; \ \ if (s == 0) \ { \ s = (struct section_info *) xmalloc (sizeof (struct section_info)); \ s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \ strcpy (s->name, NAME); \ s->type = type; \ s->next = sections; \ sections = s; \ fprintf (STREAM, ".section\t%s,\"%s\"\n", NAME, mode); \ /* Functions may have been compiled at various levels of \ optimization so we can't use `same_size' here. Instead, \ have the linker pick one. */ \ if ((DECL) && DECL_ONE_ONLY (DECL)) \ fprintf (STREAM, "\t.linkonce %s\n", \ TREE_CODE (DECL) == FUNCTION_DECL \ ? "discard" : "same_size"); \ } \ else \ { \ fprintf (STREAM, ".section\t%s,\"%s\"\n", NAME, mode); \ } \} while (0)#endif /* 0 *//* DWARF2 Unwinding doesn't work with exception handling yet. */#define DWARF2_UNWIND_INFO 0/* Don't assume anything about the header files. */#define NO_IMPLICIT_EXTERN_C
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -