diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2015-04-02 08:15:49 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-04-02 08:15:49 +0000 |
commit | 512470bb907b267e6cf5b990215dd4d22425d95d (patch) | |
tree | bd4f3ce6c25d8977eb5decebecb83a4ec07c4ca3 /gcc | |
parent | a8caf3514910c6d8513910e9c9d4c8e6b1b3ad0f (diff) | |
download | gcc-512470bb907b267e6cf5b990215dd4d22425d95d.zip gcc-512470bb907b267e6cf5b990215dd4d22425d95d.tar.gz gcc-512470bb907b267e6cf5b990215dd4d22425d95d.tar.bz2 |
re PR driver/65444 (-z bndplt isn't passed to linker for -mmpx when building dynamic objects)
gcc/
PR driver/65444
* config/i386/linux-common.h (MPX_SPEC): New.
(CHKP_SPEC): Add MPX_SPEC.
* doc/invoke.texi (-fcheck-pointer-boudns): Document
possible issues with '-z bndplt' support in linker.
libmpx/
PR driver/65444
* configure.ac: Add check for '-z bndplt' support
by linker. Add link_mpx output variable.
* libmpx.spec.in (link_mpx): New.
* configure: Regenerate.
From-SVN: r221831
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/i386/linux-common.h | 7 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 11 |
3 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 937d5cd..4c832e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-04-02 Ilya Enkovich <ilya.enkovich@intel.com> + + PR driver/65444 + * config/i386/linux-common.h (MPX_SPEC): New. + (CHKP_SPEC): Add MPX_SPEC. + * doc/invoke.texi (-fcheck-pointer-boudns): Document + possible issues with '-z bndplt' support in linker. + 2015-04-02 Uros Bizjak <ubizjak@gmail.com> * config/i386/sync.md (UNSPEC_FILD_ATOMIC, UNSPEC_FIST_ATOMIC): New. diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h index 9c6560b..dd79ec6 100644 --- a/gcc/config/i386/linux-common.h +++ b/gcc/config/i386/linux-common.h @@ -59,6 +59,11 @@ along with GCC; see the file COPYING3. If not see %:include(libmpx.spec)%(link_libmpx)" #endif +#ifndef MPX_SPEC +#define MPX_SPEC "\ + %{mmpx:%{fcheck-pointer-bounds:%{!static:%:include(libmpx.spec)%(link_mpx)}}}" +#endif + #ifndef LIBMPX_SPEC #if defined(HAVE_LD_STATIC_DYNAMIC) #define LIBMPX_SPEC "\ @@ -89,5 +94,5 @@ along with GCC; see the file COPYING3. If not see #ifndef CHKP_SPEC #define CHKP_SPEC "\ -%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC LIBMPXWRAPPERS_SPEC "}}" +%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC LIBMPXWRAPPERS_SPEC "}}" MPX_SPEC #endif diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index bf8afad..c058710 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -5857,7 +5857,16 @@ MPX-based instrumentation requires a runtime library to enable MPX in hardware and handle bounds violation signals. By default when @option{-fcheck-pointer-bounds} and @option{-mmpx} options are used to link a program, the GCC driver -links against the @file{libmpx} runtime library. MPX-based instrumentation +links against the @file{libmpx} runtime library and @file{libmpxwrappers} +library. It also passes '-z bndplt' to a linker in case it supports this +option (which is checked on libmpx configuration). Note that old versions +of linker may ignore option. Gold linker doesn't support '-z bndplt' +option. With no '-z bndplt' support in linker all calls to dynamic libraries +lose passed bounds reducing overall protection level. It's highly +recommended to use linker with '-z bndplt' support. In case such linker +is not available it is adviced to always use @option{-static-libmpxwrappers} +for better protection level or use @option{-static} to completely avoid +external calls to dynamic libraries. MPX-based instrumentation may be used for debugging and also may be included in production code to increase program security. Depending on usage, you may have different requirements for the runtime library. The current version |