Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 1 May 2018 16:19:21 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: Some questions

* Patrick Oppenlander <patrick.oppenlander@...il.com> [2018-05-01 10:10:45 +1000]:
> On Mon, Apr 30, 2018 at 1:16 PM, Rich Felker <dalias@...c.org> wrote:
> > On Mon, Apr 30, 2018 at 12:52:06PM +1000, Patrick Oppenlander wrote:
> >> - sigisemptyset uses bss. Could be implemented in a similar fashion to
> >> sigemptyset, save bss & would probably be faster.
> >
> > Ahh, yes. I wonder if gcc has any way to force const zero objects into
> > rodata rather than bss..? In any case memcmp is not an efficient way
> > to implement this, so maybe it should be changed.
> 
> Doing this:
> -       static const unsigned long zeroset[_NSIG/8/sizeof(long)];
> +       static const unsigned long zeroset[_NSIG/8/sizeof(long)] = {};
> 
> Makes it go into rodata.

{} is invalid initializer in c, use {0}.

it was a bug in gcc that it treated

 static const int x;

and

 static const int x = {0};

differently, they are completely equivalent in c,
it seems to me that gcc-trunk fixed it and clang
was never broken.

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ