memory problem

Hi everybody,
I'm compiling a new program for a LeonardoETH board and code is too big, about 31kb.
I could avoid to use the bootloader saving about 4kB of flash memory, so this code would fit ATmega32U4 processor. Using IDE 1.8.2 there is an option "Export compiled sketch" who allow to save HEX file in both version with or without bootloader. Unfortunely the compiler consider a 28kB memory limit even for the second option.
Does anybody can help me to overcome the problem?
Thanks in advance for any suggestion.

You may be able to hack the boards.txt file :

leonardoeth.upload.maximum_size=28672

But post your code any maybe someone can suggest ways to slim it down.

Thanks 6v6gt,
the code is quite big to post and I think isn't really possible to slim it enough.
Hacking the boards.txt file seems a good solution.

Can you build your project with just avr-gcc? How big is the hex file then?
If you burn that with avrdude, I'm pretty sure it will write over your bootloader.