Make smaller binary (disable .debug_info etc)


Martin Kozusky
 
Edited

Hi,
I am trying to figure out how to make the binary for nrf52dk_nrf52832 smaller, so I tried to look at zepyr.map with AMap and I am seeing so much .debug_info, .debug_line etc stuff in .map file.
I started playing with  hello_world and added
CONFIG_DEBUG=n
CONFIG_DEBUG_INFO=n
into prj.conf (nothing else there). But .debug_info etc. lines are still there, the only change is in size of modules (and the final binary, but I think debug data are not still completely removed)

ie. - with DEBUG=y, the biggest one is .debug_info for zephyr/kernel/libkernel.a module called from sched.c.obj) - 23 360B, with DEBUG=n, the size of module is 22 641 B
Why are .debug_info etc still included even with CONFIG_DEBUG=n ?

Is it possible to disable debug info completely? Or is it always removed when converting .elf into .bin ? If yes, can I get .map file, which will tell me exactly what is just in .bin file?

Thanks,
Martin

Join users@lists.zephyrproject.org to automatically receive all group messages.