objcopy of vmlinux is very large starting with linux5.7

Laurentiu-Cristian Duca laurentiu.duca at gmail.com
Thu Oct 28 05:50:54 PDT 2021

Hello riscv community,

Starting from a working config for linux-5.0 riscv32,
I built linux kernels and observed an undesired size difference of final output,
starting with linux 5.7.

Here is what I do:

cp ../linux-5.0/.config .
make -j5 ARCH=riscv CROSS_COMPILE=riscv32-buildroot-linux-gnu- oldconfig
- accept defaults for oldconfig
make -j5 ARCH=riscv CROSS_COMPILE=riscv32-buildroot-linux-gnu- vmlinux

riscv32-buildroot-linux-gnu-strip -o vmlinuxstr vmlinux
riscv32-buildroot-linux-gnu-objcopy -O binary vmlinuxstr kernel-riscv32.bin

before and up to linux5.6.19
-rwxrwxr-x 1 laur laur 4009312 oct 28 15:22 kernel-riscv32.bin
-rwxrwxr-x 1 laur laur 4777584 oct 28 15:22 vmlinux
-rwxrwxr-x 1 laur laur 4014356 oct 28 15:34 vmlinuxstr
starting with linux5.7
-rwxrwxr-x 1 laur laur 16923752 oct 28 15:26 kernel-riscv32.bin
-rwxrwxr-x 1 laur laur 4599284 oct 28 15:26 vmlinux
-rwxrwxr-x 1 laur laur 3829884 oct 28 15:34 vmlinuxstr

It's worth mentioning that all kernels work ok in simulator.
Does anybody know why is kernel-riscv32.bin so big in 5.7 and above?
I appreciate any idea.

Thank you,

More information about the linux-riscv mailing list