GWP-ASan's AllocatorState was recently extended with a
AllocatorVersionMagic structure required so that GWP-ASan bug reports
can be understood by tools at different versions.
On Fuchsia, this in included in the scudo::Allocator structure, and
by having non-zero initializers, this effectively moved the static
allocator structure from the .bss segment to the .data segment, thus
increasing (significantly) the size of the libc.
This CL proposes to initialize the structure with its magic numbers at
runtime, allowing for the allocator to go back into the .bss segment.
I will work on adding a test on the Scudo side to ensure that this type
of changes get detected early on. Additional work is also needed to
reduce the footprint of the (large) memory-tagging related structures
that are currently part of the allocator.
Can you hoist these inside the struct (next to their declarations), and add a note that the values are copied into the struct at runtime, during GuardedPoolAllocator::initialize() so that GWP-ASan remains completely in the .bss segment?