X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gcc%2Fdoc%2Ftm.texi;h=4f4be2380db412b22d68ea630e35491ede6fd9ae;hb=a4d0554781f4aa5af93b620984c91df51dbe87ba;hp=fbf5cd1bf85a800a1dcb243e63ad68630bb486c7;hpb=f62c8a5c7996b97c736e3242de0d5527ec299a34;p=gcc.git diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index fbf5cd1bf85..4f4be2380db 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -2716,6 +2716,7 @@ This describes the stack layout and calling conventions. * Function Entry:: * Profiling:: * Tail Calls:: +* Stack Smashing Protection:: @end menu @node Frame Layout @@ -2752,7 +2753,7 @@ which is often wrong. @end defmac @defmac FRAME_GROWS_DOWNWARD -Define this macro to non-zero value if the addresses of local variable slots +Define this macro to nonzero value if the addresses of local variable slots are at negative offsets from the frame pointer. @end defmac @@ -4379,6 +4380,31 @@ as the @code{sibcall} md pattern can not fail, or fall over to a may vary greatly between different architectures. @end deftypefn +@node Stack Smashing Protection +@subsection Stack smashing protection +@cindex stack smashing protection + +@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_GUARD (void) +This hook returns a @code{DECL} node for the external variable to use +for the stack protection guard. This variable is initialized by the +runtime to some random value and is used to initialize the guard value +that is placed at the top of the local stack frame. The type of this +variable must be @code{ptr_type_node}. + +The default version of this hook creates a variable called +@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}. +@end deftypefn + +@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_FAIL (void) +This hook returns a tree expression that alerts the runtime that the +stack protect guard variable has been modified. This expression should +involve a call to a @code{noreturn} function. + +The default version of this hook invokes a function called +@samp{__stack_chk_fail}, taking no arguments. This function is +normally defined in @file{libgcc2.c}. +@end deftypefn + @node Varargs @section Implementing the Varargs Macros @cindex varargs implementation @@ -6095,22 +6121,6 @@ Define this macro if the register defined by this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined. @end defmac -@defmac FINALIZE_PIC -By generating position-independent code, when two different programs (A -and B) share a common library (libC.a), the text of the library can be -shared whether or not the library is linked at the same address for both -programs. In some of these environments, position-independent code -requires not only the use of different addressing modes, but also -special code to enable the use of these addressing modes. - -The @code{FINALIZE_PIC} macro serves as a hook to emit these special -codes once the function is being compiled into assembly code, but not -before. (It is not done before, because in the case of compiling an -inline function, it would lead to multiple PIC prologues being -included in functions which used inline functions and were compiled to -assembly language.) -@end defmac - @defmac LEGITIMATE_PIC_OPERAND_P (@var{x}) A C expression that is nonzero if @var{x} is a legitimate immediate operand on the target machine when generating position independent code. @@ -7622,6 +7632,11 @@ Define this macro if your target has ABI specified unwind tables. Usually these will be output by @code{TARGET_UNWIND_EMIT}. @end defmac +@deftypevar {Target Hook} bool TARGET_UNWID_TABLES_DEFAULT +This variable should be set to @code{true} if the target ABI requires unwinding +tables even when exceptions are not used. +@end deftypevar + @defmac MUST_USE_SJLJ_EXCEPTIONS This macro need only be defined if @code{DWARF2_UNWIND_INFO} is runtime-variable. In that case, @file{except.h} cannot correctly @@ -7672,6 +7687,20 @@ register in Dwarf. Otherwise, this hook should return @code{NULL_RTX}. If not defined, the default is to return @code{NULL_RTX}. @end deftypefn +@deftypefn {Target Hook} bool TARGET_ASM_TTYPE (rtx @var{sym}) +This hook is used to output a reference from a frame unwinding table to +the type_info object identified by @var{sym}. It should return @code{true} +if the reference was output. Returning @code{false} will cause the +reference to be output using the normal Dwarf2 routines. +@end deftypefn + +@deftypefn {Target Hook} bool TARGET_ARM_EABI_UNWINDER +This hook should be set to @code{true} on targets that use an ARM EABI +based unwinding library, and @code{false} on other targets. This effects +the format of unwinding tables, and how the unwinder in entered after +running a cleanup. The default is @code{false}. +@end deftypefn + @node Alignment Output @subsection Assembler Commands for Alignment @@ -8638,56 +8667,6 @@ is in effect. The default is to return false to use @code{__cxa_atexit}. @c prevent bad page break with this line Here are several miscellaneous parameters. -@defmac PREDICATE_CODES -Define this if you have defined special-purpose predicates in the file -@file{@var{machine}.c}. This macro is called within an initializer of an -array of structures. The first field in the structure is the name of a -predicate and the second field is an array of rtl codes. For each -predicate, list all rtl codes that can be in expressions matched by the -predicate. The list should have a trailing comma. Here is an example -of two entries in the list for a typical RISC machine: - -@smallexample -#define PREDICATE_CODES \ - @{"gen_reg_rtx_operand", @{SUBREG, REG@}@}, \ - @{"reg_or_short_cint_operand", @{SUBREG, REG, CONST_INT@}@}, -@end smallexample - -Defining this macro does not affect the generated code (however, -incorrect definitions that omit an rtl code that may be matched by the -predicate can cause the compiler to malfunction). Instead, it allows -the table built by @file{genrecog} to be more compact and efficient, -thus speeding up the compiler. The most important predicates to include -in the list specified by this macro are those used in the most insn -patterns. - -For each predicate function named in @code{PREDICATE_CODES}, a -declaration will be generated in @file{insn-codes.h}. - -Use of this macro is deprecated; use @code{define_predicate} instead. -@xref{Defining Predicates}. -@end defmac - -@defmac SPECIAL_MODE_PREDICATES -Define this if you have special predicates that know special things -about modes. Genrecog will warn about certain forms of -@code{match_operand} without a mode; if the operand predicate is -listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be -suppressed. - -Here is an example from the IA-32 port (@code{ext_register_operand} -specially checks for @code{HImode} or @code{SImode} in preparation -for a byte extraction from @code{%ah} etc.). - -@smallexample -#define SPECIAL_MODE_PREDICATES \ - "ext_register_operand", -@end smallexample - -Use of this macro is deprecated; use @code{define_special_predicate} -instead. @xref{Defining Predicates}. -@end defmac - @defmac HAS_LONG_COND_BRANCH Define this boolean macro to indicate whether or not your architecture has conditional branches that can span all of memory. It is used in @@ -8976,7 +8955,7 @@ this macro. @end defmac @defmac VECTOR_STORE_FLAG_VALUE (@var{mode}) -A C expression that gives a rtx representing the non-zero true element +A C expression that gives a rtx representing the nonzero true element for vector comparisons. The returned rtx should be valid for the inner mode of @var{mode} which is guaranteed to be a vector mode. Define this macro on machines that have vector comparison operations that @@ -9246,12 +9225,13 @@ You need only define this macro if the default of @samp{"LIBRARY_PATH"} is wrong. @end defmac -@defmac TARGET_HAS_F_SETLKW -Define this macro if the target supports file locking with fcntl / F_SETLKW@. -Note that this functionality is part of POSIX@. -Defining @code{TARGET_HAS_F_SETLKW} will enable the test coverage code +@defmac TARGET_POSIX_IO +Define this macro if the target supports the following POSIX@ file +functions, access, mkdir and file locking with fcntl / F_SETLKW@. +Defining @code{TARGET_POSIX_IO} will enable the test coverage code to use file locking when exiting a program, which avoids race conditions -if the program has forked. +if the program has forked. It will also create directories at run-time +for cross-profiling. @end defmac @defmac MAX_CONDITIONAL_EXECUTE @@ -9400,14 +9380,21 @@ filling of delay slots can result in branches being redirected, and this may in turn cause a branch offset to overflow. @end defmac -@defmac ALLOCATE_INITIAL_VALUE (@var{hard_reg}) +@deftypefn {Target Hook} bool TARGET_COMMUTATIVE_P (rtx @var{x}, @var{outer_code}) +This target hook returns @code{true} if @var{x} is considered to be commutative. +Usually, this is just COMMUTATIVE_P (@var{x}), but the HP PA doesn't consider +PLUS to be commutative inside a MEM. @var{outer_code} is the rtx code +of the enclosing rtl, if known, otherwise it is UNKNOWN. +@end deftypefn + +@deftypefn {Target Hook} rtx TARGET_ALLOCATE_INITIAL_VALUE (rtx @var{hard_reg}) When the initial value of a hard register has been copied in a pseudo register, it is often not necessary to actually allocate another register to this pseudo register, because the original hard register or a stack slot -it has been saved into can be used. @code{ALLOCATE_INITIAL_VALUE}, if -defined, is called at the start of register allocation once for each -hard register that had its initial value copied by using +it has been saved into can be used. @code{TARGET_ALLOCATE_INITIAL_VALUE} +is called at the start of register allocation once for each hard register +that had its initial value copied by using @code{get_func_hard_reg_initial_val} or @code{get_hard_reg_initial_val}. Possible values are @code{NULL_RTX}, if you don't want to do any special allocation, a @code{REG} rtx---that would typically be @@ -9415,10 +9402,12 @@ the hard register itself, if it is known not to be clobbered---or a @code{MEM}. If you are returning a @code{MEM}, this is only a hint for the allocator; it might decide to use another register anyways. -You may use @code{current_function_leaf_function} in the definition of the -macro, functions that use @code{REG_N_SETS}, to determine if the hard +You may use @code{current_function_leaf_function} in the hook, functions +that use @code{REG_N_SETS}, to determine if the hard register in question will not be clobbered. -@end defmac +The default value of this hook is @code{NULL}, which disables any special +allocation. +@end deftypefn @defmac TARGET_OBJECT_SUFFIX Define this macro to be a C string representing the suffix for object @@ -9561,6 +9550,26 @@ illegal to pass argument @var{val} to function @var{funcdecl} with prototype @var{typelist}. @end deftypefn +@deftypefn {Target Hook} {const char *} TARGET_INVALID_CONVERSION (tree @var{fromtype}, tree @var{totype}) +If defined, this macro returns the diagnostic message when it is +invalid to convert from @var{fromtype} to @var{totype}, or @code{NULL} +if validity should be determined by the front end. +@end deftypefn + +@deftypefn {Target Hook} {const char *} TARGET_INVALID_UNARY_OP (int @var{op}, tree @var{type}) +If defined, this macro returns the diagnostic message when it is +invalid to apply operation @var{op} (where unary plus is denoted by +@code{CONVERT_EXPR}) to an operand of type @var{type}, or @code{NULL} +if validity should be determined by the front end. +@end deftypefn + +@deftypefn {Target Hook} {const char *} TARGET_INVALID_BINARY_OP (int @var{op}, tree @var{type1}, tree @var{type2}) +If defined, this macro returns the diagnostic message when it is +invalid to apply operation @var{op} to operands of types @var{type1} +and @var{type2}, or @code{NULL} if validity should be determined by +the front end. +@end deftypefn + @defmac TARGET_USE_JCR_SECTION This macro determines whether to use the JCR section to register Java classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both