Reducing binary size


I’m working on opensbi with linux as payload. The currently binary size for fw_payload.bin is 160kB and I want to reduce it down to 64kB due to constraints in available flash memory space.

I’ve already tried out the compiler and linker optimisation flags and I was only able to shrink 16kB with the same.

Is it possible to remove some modules or disable any features which might not be required for running linux as payload and get some space back?
Are there any other methods or strategies I can work on to reduce the binary size.

Thanks in advance!

What’s the concern of using a >64KB payload.bin? You can try enable decompression support in U-Boot SPL, and compress the payload.bin to see if 64KB is achievable.