Re: [PATCH] vmlinux.lds.h: Force-align ELF notes section to four bytes

From: Joan Bruguera Micó
Date: Thu Apr 27 2023 - 01:14:26 EST


PS: As additional information for posterity, there are various conditions that
explain why this is/was only a problem on some specific distributions:

* In addition to dwarves/pahole 1.24, binutils 2.40 seems to also be required
for the problem to occur (in Arch, downgrading to binutils 2.39 fixes it).
* Debian (and thus derived distributions) configures binutils with
`--disable-x86-used-note`, which by default disables emitting the GNU notes
which ultimately cause the .notes section to be aligned to 8 bytes.

On Debian Bookworm & Ubuntu 23.04, the problem reproduces when building like:
```
export KCFLAGS="-Xassembler -mx86-used-note=yes"
export KAFLAGS="-Xassembler -mx86-used-note=yes"
make
```

Finally, here's a smaller .config to reproduce the problem on affected systems:
https://zealcharm.com/20230416-btf-dedup-bug-sample-configs/minimal-repro