Module Name: src Committed By: christos Date: Wed Jul 18 22:22:26 UTC 2012
Modified Files: src/lib/libc/ssp: __builtin_object_size.3 Log Message: Explain what's going on with fortify being disabled when the optimizer is off: http://gcc.gnu.org/ml/gcc-patches/2012-06/msg00174.html To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/ssp/__builtin_object_size.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/ssp/__builtin_object_size.3 diff -u src/lib/libc/ssp/__builtin_object_size.3:1.8 src/lib/libc/ssp/__builtin_object_size.3:1.9 --- src/lib/libc/ssp/__builtin_object_size.3:1.8 Sun Dec 19 04:33:52 2010 +++ src/lib/libc/ssp/__builtin_object_size.3 Wed Jul 18 18:22:26 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: __builtin_object_size.3,v 1.8 2010/12/19 09:33:52 jruoho Exp $ +.\" $NetBSD: __builtin_object_size.3,v 1.9 2012/07/18 22:22:26 christos Exp $ .\" .\" Copyright (c) 2007 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -28,7 +28,7 @@ .\" POSSIBILITY OF SUCH DAMAGE. .\" .\" -.Dd December 19, 2010 +.Dd July 18, 2012 .Dt __BUILTIN_OBJECT_SIZE 3 .Os .Sh NAME @@ -88,3 +88,14 @@ appeared in .Tn GCC 4.1 . .Sh CAVEATS This is a non-standard, compiler-specific extension. +.Pp +Note that currently the object size calculation pass is only done at -O1 +or above, meaning that this function always returns -1 when the optimizer +is off. +.Pp +There are some discussions about always doing the object size pass, but +the issue is that without the optimization pass data sizes are not going +to be correct. +.Pp +For that reason currently code fortification (size-checked replacement +functions) is disabled when optimization is off.