Dan Malek writes:
> This is the way the kernel used to be, with the kernel objects
> as *.a files instead of *.o files.
I'm definitely with you on this one. Using ld -r in intermediate stages is
defeating the linker's natural ability to exclude unused objects. My patch
achieves a similar effect by allowing the linker to exclude unused functions,
but it does so in a very torturous way. I'd prefer to have both .a's for
wholesale dead object elimination _and_ -ffunction-sections for elimination of
any remaining dead functions.
> The response I received was the change was due to loadable modules, that
> when you link the kernel as a bunch of *.a files the result is usually
> missing lots of functions that a loadable module may want to call.
Like you, I don't understand the logic behind this either. Any symbol
accessible from a loadable module will have a magic reference thanks to
EXPORT_SYMBOL that will drag it in from the archive.
The only use I can see for using ld -r is while building the loadable modules
themselves, to simplify things for the user by combining modules which would
otherwise contain multiple objects. And I guess this is simply so "insmod"
doesn't have to handle archives directly.
> > I think/hope we're getting close to something that could be accepted into
> > the official kernel now.
> Who gave you that indication? I wouldn't even try to check any of
> this into the kernel sources based upon past discussions.
I can't check it in myself, but I can ask as many people as possible to test
it. If it works OK, it's got a chance of inclusion in 2.4/2.5. Embedded
systems people who want it can use it as-is on 2.2 too.
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909 Fax: +61 2 9805 2929