Displaying 3 results from an estimated 3 matches for "16ec710b".
2019 Jul 04
3
[nbdkit] [filter/nozero] large binary size with GCC 9
Hi all,
It seems GCC 9 does not put read-only zero-initialized variables into the BSS
section anymore; instead it is put into RODATA.
(See the thread at [0], especially [1])
In filter/nozero a 64M large, static, zeroed, read-only array is declared.
The new behavior of GCC puts this array as-is into the binary inflating the
size by a factor of around 10000.
(Clang 8 and older GCCs work
2019 Jul 05
0
Re: [nbdkit] [filter/nozero] large binary size with GCC 9
...ed that
sticking things in .rodata adds a bit more security against errant code
accidentally trying to corrupt the buffer; but as the buffer shouldn't
be escaping, it's already undefined behavior for such code to happen).
diff --git i/filters/nozero/nozero.c w/filters/nozero/nozero.c
index 16ec710b..21863707 100644
--- i/filters/nozero/nozero.c
+++ w/filters/nozero/nozero.c
@@ -45,7 +45,6 @@
#define MAX_WRITE (64 * 1024 * 1024)
-static const char buffer[MAX_WRITE];
static enum ZeroMode {
NONE,
EMULATE,
@@ -111,6 +110,8 @@ nozero_zero (struct nbdkit_next_ops *next_ops, void
*nxdata,...
2019 Jul 05
2
Re: [nbdkit] [filter/nozero] large binary size with GCC 9
...lugins.c.
I assumed that filter/nozero got somehow statically linked into the server
(which does not really make sense), so it would have been the same instance of
the problem. Then I forgot to confirm this afterwards.
> diff --git i/filters/nozero/nozero.c w/filters/nozero/nozero.c
> index 16ec710b..21863707 100644
> --- i/filters/nozero/nozero.c
> +++ w/filters/nozero/nozero.c
> ...
Nope, same thing.
Thomas