Shrinking the kernel with link-time garbage collection
Shrinking the kernel with link-time garbage collection
One of the keys to fitting the Linux kernel into a small system is to remove any code that is not needed. The kernel's configuration system allows that to be done on a large scale, but it still results in the building of a kernel containing many smaller chunks of unused code and data. With a bit of work, though, the compiler and linker can be made to work together to garbage-collect much of that unused code and recover the wasted space for more important uses.
Click below (subscribers only) for a detailed article from Nicolas Pitre on how to use link-time garbage collection to create a smaller kernel image.