This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -z bndplt documentation in GCC manual


On 01/19/2016 03:24 AM, Ilya Enkovich wrote:
2016-01-19 5:25 GMT+03:00 Sandra Loosemore <sandra@codesourcery.com>:
I think the documentation relating to '-z bndplt' in the GCC manual
description of -fcheck-pointer-bounds is incorrect.  It looks like, as of
r225862, the GCC driver is supposed to emit an error message if GCC was
configured with a linker that doesn't support this option and you pass -mmpx
without -static.  Is that right?  I'll fix the documentation once I'm clear
on what the actual behavior is.

Compiler just emits a note where user is warned that GCC configuration may
lead to decreased instrumentation coverage.

OK. Is the attached patch accurate? The existing text has several markup/grammatical/spelling errors and I'd like to simplify it to make it less repetitive and more direct and user-friendly.

(BTW, part of the problem I had parsing the code is that the manual doesn't document the %n spec file syntax, or several other % escapes. I opened PR69367 for that since I have too many other things in my pile to get to it any time soon.)

-Sandra
2016-01-19  Sandra Loosemore <sandra@codesourcery.com>

	gcc/
	* doc/invoke.texi (Instrumentation Options): Clarify -mmpx linking
	requirements.
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 232583)
+++ gcc/doc/invoke.texi	(working copy)
@@ -9919,22 +9919,22 @@ is instrumented with checks of the point
 bounds associated with that pointer.  
 
 Currently there
-is only an implementation for Intel MPX available, thus x86 target
+is only an implementation for Intel MPX available, thus x86 GNU/Linux target
 and @option{-mmpx} are required to enable this feature.  
 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 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
+links against the @file{libmpx} and @file{libmpxwrappers} libraries.
+Bounds checking on calls to dynamic libraries requires a linker
+with @option{-z bndplt} support; if GCC was configured with a linker
+without support for this option (including the Gold linker and older
+versions of ld), a warning is given if you link with @option{-mmpx}
+without also specifying @option{-static}, since the overall effectiveness
+of the bounds checking protection is reduced.
+See also @option{-static-libmpxwrappers}.
+
+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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]