[PATCH] RFC: garbage collect unused code/data?
Rob Landley
rob at landley.net
Thu Apr 6 16:56:24 UTC 2006
On Wednesday 05 April 2006 4:19 am, Denis Vlasenko wrote:
> On Wednesday 05 April 2006 10:32, Bernhard Fischer wrote:
> > 2) I think that we would be better off to just delete the unused
> > functions instead of relying on the toolchain to catch them all.
> > As already stated here, it really looks like networking/* could need
> > some love..
>
> gc-sections deals with functions which are unused _with particular
> .config_, not just stray dead code.
>
> Without gc-sections, we need to split source into gazillion tiny .c files
> to achieve the same result.
Actually this is why we do
#if ENABLE_BLAH
static void blah(blah)
{
thingy();
}
#else
void blah(blah);
#endif
Which is ugly and it would be nice if the compiler could do that for us at
least inside the same .c file when we mark blah "static".
I think this is a nice technique and we should definitely be able to enable
this as an option. But unfortunately, it doesn't work for people on embedded
systems making flat execute-in-pace files.
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list