We rely on the linker to create arrays for a number of things including
kernel parameters and device-tree-match entries.
The stride of these linker-section arrays obviously needs to match the
expectations of the code accessing them or bad things will happen.
One thing to watch out for is that gcc is known to increase the
alignment of larger objects with static extent as an optimisation (on
x86), but this can be suppressed by using the aligned attribute when
declaring entries.
We've been relying on this behaviour for 16 years for kernel parameters
(and other structures) and it indeed hasn't changed since the
introduction of the aligned attribute in gcc 3.1 (see align_variable()
in [1]).
Occasionally this gcc optimisation do cause problems which have instead
been worked around in various creative ways including using indirection
through an array of pointers. This was originally done for tracepoints
[2] after a number of failed attempts to create properly aligned arrays,
and the approach was later reused for module-version attributes [3] and
earlycon entries.
[2] https://lore.kernel.org/lkml/20110126222622.GA10794@Krystal/