aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-12-29 05:44:50 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2003-12-29 05:44:50 -0800
commite5d9d44e1f8a0c387ae5ef43e902e1ffe39107ce (patch)
treec6d71b01a2a2f606ba7624f7334ff543e6a60e27 /scripts
parent67fbc53420040fa77de4190c14e37863f307f6c8 (diff)
downloadhistory-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.c23
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;