diff options
| author | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2003-01-14 02:29:10 -0600 |
|---|---|---|
| committer | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2003-01-14 02:29:10 -0600 |
| commit | 1d411b80ee1849027d56f86fcf057f29eb4dbe0f (patch) | |
| tree | fa2fc70327b82592a6456f76093c2e3cd7fdc93d /scripts | |
| parent | 9552d6bcc66126252565555d137ff5e5e45cb959 (diff) | |
Module Sanity Check
This patch, based on Rusty's implementation, adds a special section
to vmlinux and all modules, which contain the kernel version
string, values of some particularly important config options
(SMP,preempt,proc family) and the gcc version.
When inserting a module, the version string is checked against the
kernel version string and loading is rejected if they don't match.
The version string is actually added to the modules during the
final .ko generation, so that a changed version string does only
cause relinking, not recompilation, which is a major performance
improvement over the old 2.4 way of doing things.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 2db7cc59c2bd..f5886c69a196 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -176,10 +176,15 @@ quiet_cmd_link_multi-y = LD $@ cmd_link_multi-y = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^) quiet_cmd_link_multi-m = LD [M] $@ -cmd_link_multi-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.ko=-objs))) $($(subst $(obj)/,,$(@:.ko=-y)))),$^) +cmd_link_multi-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.ko=-objs))) $($(subst $(obj)/,,$(@:.ko=-y)))),$^) init/vermagic.o quiet_cmd_link_single-m = LD [M] $@ -cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< +cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< init/vermagic.o + +# Don't rebuilt vermagic.o unless we actually are in the init/ dir +ifneq ($(obj),init) +init/vermagic.o: ; +endif # We would rather have a list of rules like # foo.o: $(foo-objs) @@ -188,10 +193,10 @@ cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< $(multi-used-y) : %.o: $(multi-objs-y) FORCE $(call if_changed,link_multi-y) -$(multi-used-m:.o=.ko) : %.ko: $(multi-objs-m) FORCE +$(multi-used-m:.o=.ko) : %.ko: $(multi-objs-m) init/vermagic.o FORCE $(call if_changed,link_multi-m) -$(single-used-m:.o=.ko) : %.ko: %.o FORCE +$(single-used-m:.o=.ko) : %.ko: %.o init/vermagic.o FORCE $(call if_changed,link_single-m) targets += $(multi-used-y) $(multi-used-m:.o=.ko) $(single-used-m:.o=.ko) |
