CONFIG_RANDOMIZE_BASE enables KASLR. It doesn't increase the size of the
kernel image for OpenWrt One (technically it increases .text size by 256
bytes, but that was cancelled out by alignment padding). Set this to y on
arm64. The other architectures are not modified (arm doesn't support it,
and mips only supports it for some targets).
CONFIG_ARM64_PTR_AUTH is enabled by default by the kernel and enables
pointer authentication instructions at entry and exit of most kernel
functions. However, none of our targets support pointer authentication,
so these instructions are just taking up space for no purpose. Set this
one to n, which reduces OpenWrt One kernel image size by 24KB.
At least on OpenWrt One, the kernel default of
CONFIG_HIGH_RES_TIMERS=n causes slow SPI NAND access speeds. See:
https://lore.kernel.org/all/CAPQLkRit9bRH2gnSpvt60evu31T=1YNFdTFH2emS6RSsY=eDJQ@mail.gmail.com/
Since this doesn't seem to be an inherently device-specific issue,
and leaving it disabled may cause other performance problems that are
difficult to debug, enable it in the default config.
We just need -S here which removes non-SHF_ALLOC sections. SHF_ALLOC
sections are generally required to be in the kernel image, and can't be
removed (in the sense of shrinking the binary) by a tool like objcopy
because that would alter the section layout which is fixed by the
linker. objcopy was "removing" these sections by replacing them with
zeros, so this wasn't reducing the size of the kernel anyway.
In particular, this command was removing the .notes section containing
the build ID which is readable from userspace via /sys/kernel/notes and
may be used for symbolization on the host.