tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kernel libraries and dead code in MODULAR kernels



On Fri, Sep 04, 2015 at 06:39:46PM -0700, Dennis Ferguson wrote:
> > 
> > Yes, finding unused functions is hard.  Not only in libkern, but also
> > libc, or variables in abandaned `Makefile.kern.inc'.  Removing one
> > needs so much mental energy (especially when those picky wandering).
> 
> I'm not so interested in ridding the kernel of all unused code (though
> I suspect someone clever might be able to use the -ffunction-sections and
> -fdata-sections compiler flags plus the ld --gc-sections option to
> find some of it).  I'd be happy if modular and non-modular kernels
> had the same unused stuff, and that libkern.a could be used when
> building either.

Just parse the xref list from ld.

I don't think you should assume that all kernel modulrs are built
at the same time as the main kernel.
So functions thst loadable modules might need have to be present.
Hence the inclusion of all of libkern.


	David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index