[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    Re: [RFC] [PATCH] Implement -ffortify for C/C++
From:       Jakub Jelinek <jakub () redhat ! com>
Date:       2007-01-30 17:05:56
Message-ID: 20070130170555.GQ29911 () devserv ! devel ! redhat ! com
[Download RAW message or body]

On Tue, Jan 30, 2007 at 06:00:40PM +0100, Dirk Mueller wrote:
> > In glibc headers (as well as libssp headers) -D_FORTIFY_SOURCE=2
> > disallows str*/stp* etc. to cross structure field boundaries,
> > while mem* still can cross them
> 
> You're referring to __builtin_object_size(.., 0) vs __builtin_object_size(.., 
> 1), right?
> 
> I'm trying to do that via 
> 
> +      fn = build_bos_call (TREE_VALUE (params),
> +                          bos && flag_fortify > 1 
> +                          ? integer_one_node : integer_zero_node);
> 
> so it produces __builtin_object_size(.., 1) if it is a str*/stp* related 
> function and fortify level is > 1. This is how I understood it from reading 
> the glibc header file (I admit it was late and I was drunk). 

Oops, yeah, your patch is correct, I must have missed the bos && there,
sorry.  Still, the *.texi documentation needs fixing to actually describe
what the option really does.

	Jakub

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic