Go to file
Igor Tsimbalist 6a10fff4e2 Add Intel CET support for EH in libgcc.
Control-flow Enforcement Technology (CET), published by Intel,
introduces the Shadow Stack feature, which ensures a return from a
function is done to exactly the same location from where the function
was called. When EH is present the control-flow transfer may skip some
stack frames and the shadow stack has to be adjusted not to signal a
violation of a control-flow transfer. It's done by counting a number
of skiping frames and adjasting shadow stack pointer by this number.

Having new semantic of the 'ret' instruction if CET is supported in HW
the 'ret' instruction cannot be generated in ix86_expand_epilogue when
we are returning after EH is processed. Added a code in
ix86_expand_epilogue to adjust Shadow Stack pointer and to generate an
indirect jump instead of 'ret'. As sp register is used during this
adjustment thus the argument in pro_epilogue_adjust_stack is changed
to update cfa_reg based on whether control-flow instrumentation is set.
Without updating the cfa_reg field there is an assert later in dwarf2
pass related to mismatch the stack register and cfa_reg value.

gcc/
	* config/i386/i386.c (ix86_expand_epilogue): Change simple
	return to indirect jump for EH return if control-flow protection
	is enabled. Change explicit 'false' argument in
	pro_epilogue_adjust_stack with a value of flag_cf_protection.
	* config/i386/i386.md (simple_return_indirect_internal): Remove
	SImode restriction to support 64-bit.

libgcc/
	* config/i386/linux-unwind.h: Include
	config/i386/shadow-stack-unwind.h.
	* config/i386/shadow-stack-unwind.h: New file.
	* unwind-dw2.c: (uw_install_context): Add a frame parameter and
	pass it to _Unwind_Frames_Extra.
	* unwind-generic.h (_Unwind_Frames_Extra): New.
	* unwind.inc (_Unwind_RaiseException_Phase2): Add frames_p
	parameter. Add local variable frames to count number of frames.
	(_Unwind_ForcedUnwind_Phase2): Likewise.
	(_Unwind_RaiseException): Add local variable frames to count
	number of frames, pass it to _Unwind_RaiseException_Phase2 and
	uw_install_context.
	(_Unwind_ForcedUnwind): Likewise.
	(_Unwind_Resume): Likewise.
	(_Unwind_Resume_or_Rethrow): Likewise.

From-SVN: r254876
2017-11-17 16:21:23 +01:00
INSTALL README: Do not mention CVS. 2014-10-12 15:05:28 +00:00
config Enable building libgcc with CET options. 2017-11-17 14:34:39 +01:00
contrib analyze_brprob.py: fix SI units 2017-11-08 07:24:14 +00:00
fixincludes fixinc.in (dirname): Change sed from 's|[^/]*/||' to 's|[^/]*//*||'. 2017-10-13 09:28:41 -06:00
gcc Add Intel CET support for EH in libgcc. 2017-11-17 16:21:23 +01:00
gnattools re PR ada/81878 (--disable-bootstrap --enable-languages=ada fails) 2017-08-17 13:39:58 +00:00
gotools Makefile.am (check-go-tool): Output colon after ${fl}. 2017-10-25 22:00:50 +00:00
include Add plugin API for processing plugin-added input files. 2017-11-10 22:10:05 +00:00
intl Require ngettext in test of system gettext implementation 2017-11-07 15:24:01 +10:30
libada re PR ada/80921 (cross compiling fails to build Ada shared libraries) 2017-06-01 10:51:15 +00:00
libatomic [arm] Fix architecture selection when building libatomic with automatic FPU selection 2017-10-20 12:33:39 +00:00
libbacktrace ztest.c (test_large): Pass unsigned long *, not size_t *, to zlib uncompress function. 2017-10-06 13:37:20 +00:00
libcc1 Makefile.am: Remove references to c-compiler-name.h and cp-compiler-name.h 2017-11-16 11:15:33 -07:00
libcilkrts os-unix-sysdep.c (__cilkrts_getticks): Adjust preprocessor test for SPARC/Linux. 2017-06-23 17:33:43 +00:00
libcpp Implement __VA_OPT__ 2017-11-13 20:17:42 +00:00
libdecnumber bid2dpd_dpd2bid.c (_bid_to_dpd32): Fix whitespace. 2017-06-29 11:35:03 -06:00
libffi Import from libffi master repository. 2017-10-03 14:26:31 -04:00
libgcc Add Intel CET support for EH in libgcc. 2017-11-17 16:21:23 +01:00
libgfortran re PR libfortran/81938 (valgrind error message and heap-buffer-overflow on address sanitized libgfortran.so) 2017-10-27 17:50:22 +00:00
libgo Adapt Solaris 12 references 2017-11-14 18:31:01 +00:00
libgomp Add libgomp.oacc-c-c++-common/f-asyncwait-{1,2,3}.c 2017-11-15 13:40:58 +00:00
libhsail-rt [BRIGFE] Improved support for function and module scope group 2017-09-27 15:40:24 +00:00
libiberty re PR lto/82757 (r251560 causes: plugin needed to handle lto object) 2017-10-30 12:48:53 +00:00
libitm PR c++/80560 - warn on undefined memory operations involving non-trivial types 2017-06-15 21:48:59 -06:00
libmpx * mpxrt/mpxrt-utils.h (__mpxrt_stop): New prototype. 2017-01-30 15:26:24 +01:00
libobjc [2/77] Add an E_ prefix to case statements 2017-08-30 11:08:28 +00:00
liboffloadmic libgomp: Provide prototypes for functions implemented by libgomp plugins 2017-01-31 15:32:58 +01:00
libquadmath [libquadmath] Remove semicolon after do {} while (0) in MPN_MUL_N_RECURSE 2017-11-05 09:57:30 +00:00
libsanitizer re PR bootstrap/82670 (UBSAN bootstrap broken after recent libsanitizer merge) 2017-11-08 09:17:02 +01:00
libssp ssp.c (__guard_setup): Suppress unused variable warning. 2017-04-02 00:35:58 +00:00
libstdc++-v3 PR libstdc++/83025 fix constraints for path overloads in <fstream> 2017-11-17 14:07:58 +00:00
libvtv re PR other/79046 (g++ -print-file-name=plugin uses full version number in path) 2017-01-21 09:47:11 +01:00
lto-plugin re PR lto/81487 ([mingw32] ld.exe: error: asprintf failed) 2017-07-21 15:58:14 +00:00
maintainer-scripts update_version_svn: Ignore the GCC 5 branch. 2017-10-10 15:10:28 +02:00
zlib re PR bootstrap/79771 (in-tree zlib breaks build) 2017-03-14 23:01:23 -06:00
.dir-locals.el * .dir-locals.el: Add. 2013-10-16 18:25:31 +00:00
.gitattributes add basic .gitattributes files to notice whitespace issues 2016-04-23 02:37:43 +00:00
.gitignore .gitignore: Ignore in-tree prerequisites. 2016-09-09 17:20:55 -04:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog RISC-V: Add Jim Wilson as a maintainer 2017-11-15 15:58:52 +00:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
ChangeLog.tree-ssa
MAINTAINERS RISC-V: Add Jim Wilson as a maintainer 2017-11-15 15:58:52 +00:00
Makefile.def re PR bootstrap/81217 (Makefile:22754: warning: overriding recipe for target 'profiledbootstrap') 2017-06-28 07:54:14 +00:00
Makefile.in Fix profiledbootstrap. 2017-10-27 13:13:05 +00:00
Makefile.tpl Fix profiledbootstrap. 2017-10-27 13:13:05 +00:00
README
compile Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
config-ml.in config-ml.in: Remove references to GCJ. 2016-11-15 16:34:02 +00:00
config.guess * config.guess: Import latest from upstream. 2017-03-18 18:22:06 +00:00
config.rpath
config.sub * config.sub: Import latest version. 2016-12-29 22:04:53 +11:00
configure configure.ac (target-libffi): Don't disable for AIX. 2017-07-28 14:56:28 -04:00
configure.ac configure.ac (target-libffi): Don't disable for AIX. 2017-07-28 14:56:28 -04:00
depcomp Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
install-sh Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
libtool-ldflags re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (missing -lasan)) 2014-04-17 14:23:28 +02:00
libtool.m4 * libtool.m4 (export_symbols_cmds) [AIX]: Add global TLS "L" symbols. 2015-11-26 08:20:59 -05:00
ltgcc.m4
ltmain.sh Ensure libgcc_s unwinder is always used on 64-bit Solaris 10+/x86 (PR target/59788) 2014-02-04 09:31:38 +00:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
mkdep
mkinstalldirs Update from upstream Automake files. 2014-11-16 14:07:13 +00:00
move-if-change Update move-if-change from gnulib 2014-11-16 16:12:44 +00:00
symlink-tree
ylwrap Update from upstream Automake files. 2014-11-16 14:07:13 +00:00

README

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.