I am using the latest WinAVR GCC, and want to minimize my program space usage.
I have files with many functions, but I would like it if the linker wouldn't link in those functions to which nobody refers.
So if I have a foo.c which defines:
and my main.c only calls function_2, I'd like it if the linker would just not include function_1 and function_3.
I thought if I put the module foo.c into a library, and then linked against that library, it would only pull in function_2. But it appears to grab function_1 and function_3.
Is there a way to do what I want to do?
In my case I have a uart.c which defines a lot of different uart functions (like printing a float, printing a U16, etc.) I don't use many of them, but they all get linked in and take up FLASH space.