This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] Do without on-stack variable length arrays.
- From: Chih-Hung Hsieh <chh at google dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 08 Sep 2015 14:10:45 -0700
- Subject: Re: [PATCH] Do without on-stack variable length arrays.
I have replaced this patch with a new one that does not use one element
arrays.
Please take a look of
[PATCH] Do without union of variable length arrays.
Thanks.
On Fri, Sep 4, 2015 at 3:14 PM, Roland McGrath <roland@hack.frob.com> wrote:
> > Is there some simple way that I can test elfutils with fortify or bound
> > checking tools?
>
> Depending on your system and build setup, _FORTIFY_SOURCE might be the
> default. It's easy enough to enable it with CPPFLAGS=-D_FORTIFY_SOURCE=2
> to configure AFAIK.
>
> > How about using pointers and malloc or alloca, and indexing through the
> > pointers? That should avoid complaints from stronger bound checkers,
> > although static bound checking probably won't find bound error either.
>
> Right, that's what I think it will have to be. The cleanest way to do the
> 32/64 variant switching is not immediately clear to me in the abstract,
> though in each particular instance you'll probably be able to decide easily
> enough what feels clean.
>
> > Or is there other pattern preferred by elfutils?
>
> I don't think we've figured anything out.
>
I have replaced this patch with a new one that does not use one element arrays.
Please take a look of
  [PATCH] Do without union of variable length arrays.
Thanks.
On Fri, Sep 4, 2015 at 3:14 PM, Roland McGrath
<roland@hack.frob.com> wrote:
> Is there some simple way that I can test elfutils with fortify or bound
> checking tools?
Depending on your system and build setup, _FORTIFY_SOURCE might be the
default. It's easy enough to enable it with CPPFLAGS=-D_FORTIFY_SOURCE=2
to configure AFAIK.
> How about using pointers and malloc or alloca, and indexing through the
> pointers? That should avoid complaints from stronger bound checkers,
> although static bound checking probably won't find bound error either.
Right, that's what I think it will have to be. The cleanest way to do the
32/64 variant switching is not immediately clear to me in the abstract,
though in each particular instance you'll probably be able to decide easily
enough what feels clean.
> Or is there other pattern preferred by elfutils?
I don't think we've figured anything out.