diff options
author | Andrew Morton <akpm@osdl.org> | 2003-12-29 05:44:50 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-12-29 05:44:50 -0800 |
commit | e5d9d44e1f8a0c387ae5ef43e902e1ffe39107ce (patch) | |
tree | c6d71b01a2a2f606ba7624f7334ff543e6a60e27 /scripts | |
parent | 67fbc53420040fa77de4190c14e37863f307f6c8 (diff) | |
download | history-e5d9d44e1f8a0c387ae5ef43e902e1ffe39107ce.tar.gz |
[PATCH] Get modpost to work properly with vmlinux in a different directory
From: "Bryan O'Sullivan" <bos@pathscale.com>
The current version of modpost breaks if invoked from outside the build
tree. This patch fixes that, and simplifies the code a bit while it's at
it.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/modpost.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/scripts/modpost.c b/scripts/modpost.c index 5f8629d3425d3..0b6d7dfffab69 100644 --- a/scripts/modpost.c +++ b/scripts/modpost.c @@ -324,6 +324,19 @@ handle_modversions(struct module *mod, struct elf_info *info, } } +int +is_vmlinux(const char *modname) +{ + const char *myname; + + if ((myname = strrchr(modname, '/'))) + myname++; + else + myname = modname; + + return strcmp(myname, "vmlinux") == 0; +} + void read_symbols(char *modname) { @@ -335,8 +348,7 @@ read_symbols(char *modname) /* When there's no vmlinux, don't print warnings about * unresolved symbols (since there'll be too many ;) */ - if (strcmp(modname, "vmlinux") == 0) - have_vmlinux = 1; + have_vmlinux = is_vmlinux(modname); parse_elf(&info, modname); @@ -460,10 +472,7 @@ add_depends(struct buffer *b, struct module *mod, struct module *modules) int first = 1; for (m = modules; m; m = m->next) { - if (strcmp(m->name, "vmlinux") == 0) - m->seen = 1; - else - m->seen = 0; + m->seen = is_vmlinux(m->name); } buf_printf(b, "\n"); @@ -543,7 +552,7 @@ main(int argc, char **argv) } for (mod = modules; mod; mod = mod->next) { - if (strcmp(mod->name, "vmlinux") == 0) + if (is_vmlinux(mod->name)) continue; buf.pos = 0; |