mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
c05b5e5d8cb660ed43159d66fd669c20746d6bea
Add a new target hook, stack_protect_guard_symbol_p, to support the user provided stack protection guard as a global symbol. If the hook returns true, 1. Declare __stack_chk_guard as a global uintptr_t variable so that it can be initialized as an integer. 2. If the user declared variable matches __stack_chk_guard, merge it with __stack_chk_guard, including its visibility attribute. gcc/ PR c/121911 * target.def (stack_protect_guard_symbol_p): New target hook. * targhooks.cc (default_stack_protect_guard): Use the type of uintptr_t, instead of ptr_type_node, if the stack_protect_guard_symbol_p hook returns true. * config/i386/i386.cc (ix86_stack_protect_guard_symbol_p): New. (TARGET_STACK_PROTECT_GUARD_SYMBOL_P): Likewise. * doc/tm.texi: Regenerated. * doc/tm.texi.in (TARGET_STACK_PROTECT_GUARD_SYMBOL_P): New. gcc/c-family/ PR c/121911 * c-common.cc (c_common_nodes_and_builtins): If the stack_protect_guard_symbol_p hook returns true, declare a global symbol for stack protection guard. gcc/testsuite/ PR c/121911 * g++.target/i386/ssp-global-1.C: New test. * g++.target/i386/ssp-global-2.C: Likewise. * g++.target/i386/ssp-global-3.C: Likewise. * g++.target/i386/ssp-global-hidden-1.C: Likewise. * g++.target/i386/ssp-global-hidden-2.C: Likewise. * g++.target/i386/ssp-global-hidden-3.C: Likewise. * gcc.target/i386/ssp-global-2.c: Likewise. * gcc.target/i386/ssp-global-3.c: Likewise. * gcc.target/i386/ssp-global-4.c: Likewise. * gcc.target/i386/ssp-global-hidden-1.c: Likewise. * gcc.target/i386/ssp-global-hidden-2.c: Likewise. * gcc.target/i386/ssp-global-hidden-3.c: Likewise. * gcc.target/i386/ssp-global.c: Include <stdint.h>. (__stack_chk_guard): Change its type to uintptr_t. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.
Description
Languages
C++
30.7%
C
30.2%
Ada
14.4%
D
6.1%
Go
5.7%
Other
12.4%