To: None <firstname.lastname@example.org>
From: Matt Thomas <email@example.com>
Date: 02/19/2003 01:26:49
One of the problems with some of the PPC ports is due to linker
limitations, you can't do LKMs with doing "hacks" to the kernel.
This has always annoyed me since I felt the problem the problem
was in the toolchain.
Using readelf(1) and ld(1)'s --wrap, I've cobbled a small shell
script which given a LKM file as input will emit a new file
which can be used as LKM.
It works by finding all the unresolved branches and creates
trampolines for them. Then by using --wrap symbol ld will changes
references to symbol to __wrap_symbol and then any references to
__real_symbol to symbol. So for each symbol it emits a small
It emits a single .S with all the trampolines, assembles it,
and merges it into the LKM object. Now you have a LKM object
which can be put anywhere.
Now to figure out how to get bsd.kmod.mk to do for PPC automatically.
Matt Thomas Internet: firstname.lastname@example.org
3am Software Foundry WWW URL: http://www.3am-software.com/bio/matt/
Cupertino, CA Disclaimer: I avow all knowledge of this message