vmlinux.o: warning: objtool: elf_update: invalid section alignment

From: Chris Packham
Date: Sun Nov 02 2025 - 15:12:40 EST


Hi,

I'm investigating bringing ONIE[1] up to date with respect to kernel and
toolchain versions.

I've updated the toolchain and things seem happy with linux-5.4.86. But
when I try linux-6.12.55 I hit the following error from objtool

vmlinux.o: warning: objtool: elf_update: invalid section alignment
make[3]: *** [scripts/Makefile.vmlinux_o:65: vmlinux.o] Error 255
make[3]: *** Deleting file 'vmlinux.o'
make[2]: ***
[/home/chrisp/src/onie/build/alliedtelesis_x980_32cq-r0/kernel/linux-6.12.55/Makefile:1161:
vmlinux_o] Error 2
make[1]: *** [Makefile:224: __sub-make] Error 2
make[1]: Leaving directory
'/home/chrisp/src/onie/build/alliedtelesis_x980_32cq-r0/kernel/linux-6.12.55'
make: *** [make/kernel.make:120:
/home/chrisp/src/onie/build/alliedtelesis_x980_32cq-r0/stamp/kernel-build]
Error 2

I also tried 6.6.115 and get the same error

Does this ring any bells?

I'm building inside a docker container based on debian 11.

PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/";
SUPPORT_URL="https://www.debian.org/support";
BUG_REPORT_URL="https://bugs.debian.org/";

I'm able to reproduce the issue building the kernel using the ONIE built
cross-compiler (using crosstool-ng under the hood) but not with the
native one. However I don't see an issue in another crosstool-ng
environment building the same tools (based on debian 12 so it might not
be a fair comparison).

Thanks,
Chris

--

[1] - https://github.com/opencomputeproject/onie/