-
Hugo Grostabussiat authored
This commit reduces the size of the output binary by the following means: 1) enabling compiler optimization and requesting it to optimize for size 2) using the -ffunction-sections and -fdata-sections compiler options in addition to the --gc-sections linker option. The -ffunction-sections and -fdata-sections compiler options causes the compiler to generate a new section for every function and object. Doing this enables the linker to move around individual function instead of full compilation units. The --gc-sections option instructs the linker to discard input sections which are not referenced by other sections in the output. Those two features combined allow the linker to discard all the functions which are unused, which can save a lot of space in the resulting binary. To know which sections are unused, the linker needs to be told at least one section it should keep, otherwise it would discard all the sections since the firmware does not have a standard entry p...
4380f79c