diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-10-11 19:40:10 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.(none)> | 2007-10-18 07:35:49 -0400 |
commit | 4b21960f90d4d011e49e386d0525b1e89f320658 (patch) | |
tree | 76ed26482c119857411fa589fc94a98fc877eb3c /scripts/mod/modpost.c | |
parent | 37ab7a269637086d56940c31968f3fb3389b6d68 (diff) |
kbuild: modpost problem when symbols move from one module to another
When part of build an external module tree, modpost first reads in the
kernel's and then the external tree's Module.symvers files. From these files
it establishes a symbol => module mapping. When it later reads in each module
built and processes the symbols it finds, it discovers the symbol=>module
mapping from Module.symvers and leaves it as it is.
The problem comes with a module has been re-named or a symbol has moved from
one module to another, since the Module.symvers file was generated. modpost
does not update the symbol=>module mapping when it finds the new location of
the symbol when scanning the newly built modules. This results in the module
containing incorrect dependency information and the new Module.symvers file
written by modpost will also contain the incorrect mappings, perpetuating the
problem to the next build, and so on.
When building the out of kernel development tree for kernel subsystem, like
v4l-dvb or ALSA, deleting the external Module.symvers file before building
(which the kernel build system doesn't do and shouldn't be necessary anyway),
won't fix the problem. modpost still reads the kernel's Module.symvers, and
since we a building a kernel subsystem, it will define the same symbols as the
external modules.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r-- | scripts/mod/modpost.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2ef9a193fcae..93ac52adb498 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -268,6 +268,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod, | |||
268 | "was in %s%s\n", mod->name, name, | 268 | "was in %s%s\n", mod->name, name, |
269 | s->module->name, | 269 | s->module->name, |
270 | is_vmlinux(s->module->name) ?"":".ko"); | 270 | is_vmlinux(s->module->name) ?"":".ko"); |
271 | } else { | ||
272 | /* In case Modules.symvers was out of date */ | ||
273 | s->module = mod; | ||
271 | } | 274 | } |
272 | } | 275 | } |
273 | s->preloaded = 0; | 276 | s->preloaded = 0; |