> On Wed, 13 Sep 2017, Miod Vallat wrote:
> >
> > > Forcing uextraloc into .data via
> > > int uextraloc __attribute__ ((section(".data"))) = 0;
> > > avoids the crashes.
> >
> > Regardless of this bug, the in-tree gcc was modified to default to put
> > explicitly zero initialized data in .data rather than .bss, i.e. default
> > to -fno-zero-initialized-in-bss.
> >
> > It might be wise to make the default configuration of clang follow this
> > behaviour as well.
>
> Anyone recall the issues that it was originally changed to fix?
>
> If it was the kernel config stuff, maybe we should just pass the option
> explicitly in the kernel Makefiles and not push it on all of userland.
I also don't like it much, because it changes the underlying ABI in such
a subtle way.
How about initializing the variable to some 'illegal' value,
recognizing that value when using it, and resetting it to 0 before
use. Then it doesn't need to rely some crazy ABI tweak.