public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/105043: Object Size Checking docs cleanup
@ 2022-12-15 19:25 Siddhesh Poyarekar
  2022-12-27 18:25 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Siddhesh Poyarekar @ 2022-12-15 19:25 UTC (permalink / raw)
  To: gcc-patches

Break the _FORTIFY_SOURCE-specific builtins out into a separate
subsection from Object Size Checking built-ins and mention
_FORTIFY_SOURCE in there so that the link between the object size
checking builtins, the helper builtins (e.g. __builtin___memcpy_chk) and
_FORTIFY_SOURCE is clearer.

gcc/ChangeLog:

	PR tree-optimization/105043
	* doc/extend.texi (Object Size Checking): Split out into two
	subsections and mention _FORTIFY_SOURCE.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
---
 gcc/doc/extend.texi | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 608ff54f845..8cff7dd65dd 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -12796,7 +12796,9 @@ __atomic_store_n(&lockvar, 0, __ATOMIC_RELEASE|__ATOMIC_HLE_RELEASE);
 @end smallexample
 
 @node Object Size Checking
-@section Object Size Checking Built-in Functions
+@section Object Size Checking
+
+@subsection Object Size Checking Built-in Functions
 @findex __builtin_object_size
 @findex __builtin_dynamic_object_size
 @findex __builtin___memcpy_chk
@@ -12878,11 +12880,17 @@ which objects @var{ptr} points to at compile time are the same as in the case
 of @code{__builtin_object_size}.
 @end deftypefn
 
-There are built-in functions added for many common string operation
-functions, e.g., for @code{memcpy} @code{__builtin___memcpy_chk}
-built-in is provided.  This built-in has an additional last argument,
-which is the number of bytes remaining in the object the @var{dest}
-argument points to or @code{(size_t) -1} if the size is not known.
+@subsection Object Size Checking and Source Fortification
+
+Hardening of function calls using the @code{_FORTIFY_SOURCE} macro is
+one of the key uses of the object size checking built-in functions.  To
+make implementation of these features more convenient and improve
+optimization and diagnostics, there are built-in functions added for
+many common string operation functions, e.g., for @code{memcpy}
+@code{__builtin___memcpy_chk} built-in is provided.  This built-in has
+an additional last argument, which is the number of bytes remaining in
+the object the @var{dest} argument points to or @code{(size_t) -1} if
+the size is not known.
 
 The built-in functions are optimized into the normal string functions
 like @code{memcpy} if the last argument is @code{(size_t) -1} or if
-- 
2.38.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tree-optimization/105043: Object Size Checking docs cleanup
  2022-12-15 19:25 [PATCH] tree-optimization/105043: Object Size Checking docs cleanup Siddhesh Poyarekar
@ 2022-12-27 18:25 ` Jeff Law
  2023-01-03 16:42   ` Siddhesh Poyarekar
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2022-12-27 18:25 UTC (permalink / raw)
  To: Siddhesh Poyarekar, gcc-patches



On 12/15/22 12:25, Siddhesh Poyarekar wrote:
> Break the _FORTIFY_SOURCE-specific builtins out into a separate
> subsection from Object Size Checking built-ins and mention
> _FORTIFY_SOURCE in there so that the link between the object size
> checking builtins, the helper builtins (e.g. __builtin___memcpy_chk) and
> _FORTIFY_SOURCE is clearer.
> 
> gcc/ChangeLog:
> 
> 	PR tree-optimization/105043
> 	* doc/extend.texi (Object Size Checking): Split out into two
> 	subsections and mention _FORTIFY_SOURCE.
OK
jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tree-optimization/105043: Object Size Checking docs cleanup
  2022-12-27 18:25 ` Jeff Law
@ 2023-01-03 16:42   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 3+ messages in thread
From: Siddhesh Poyarekar @ 2023-01-03 16:42 UTC (permalink / raw)
  To: Jeff Law, gcc-patches

On 2022-12-27 13:25, Jeff Law wrote:
> 
> 
> On 12/15/22 12:25, Siddhesh Poyarekar wrote:
>> Break the _FORTIFY_SOURCE-specific builtins out into a separate
>> subsection from Object Size Checking built-ins and mention
>> _FORTIFY_SOURCE in there so that the link between the object size
>> checking builtins, the helper builtins (e.g. __builtin___memcpy_chk) and
>> _FORTIFY_SOURCE is clearer.
>>
>> gcc/ChangeLog:
>>
>>     PR tree-optimization/105043
>>     * doc/extend.texi (Object Size Checking): Split out into two
>>     subsections and mention _FORTIFY_SOURCE.
> OK
> jeff
> 

Thanks, pushed.

Sid

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-03 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15 19:25 [PATCH] tree-optimization/105043: Object Size Checking docs cleanup Siddhesh Poyarekar
2022-12-27 18:25 ` Jeff Law
2023-01-03 16:42   ` Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).