* [PATCH] Get modpost to work properly with vmlinux in a different directory
@ 2003-12-17 21:56 Bryan O'Sullivan
2003-12-22 1:43 ` Rusty Russell
0 siblings, 1 reply; 2+ messages in thread
From: Bryan O'Sullivan @ 2003-12-17 21:56 UTC (permalink / raw)
To: kai, sam; +Cc: Andrew Morton, linux-kernel
This is pretty trivial. 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.
Since it's not critical, I'd call it a contender for -mm and 2.6.1.
<b
scripts/modpost.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1509 -> 1.1510
# scripts/modpost.c 1.15 -> 1.16
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/12/17 bos@serpentine.pathscale.com 1.1510
# Make detection of whether a module is really vmlinux work regardless of its location.
# --------------------------------------------
#
diff -Nru a/scripts/modpost.c b/scripts/modpost.c
--- a/scripts/modpost.c Wed Dec 17 13:51:25 2003
+++ b/scripts/modpost.c Wed Dec 17 13:51:25 2003
@@ -324,6 +324,19 @@
}
}
+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 @@
/* 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 @@
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 @@
}
for (mod = modules; mod; mod = mod->next) {
- if (strcmp(mod->name, "vmlinux") == 0)
+ if (is_vmlinux(mod->name))
continue;
buf.pos = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Get modpost to work properly with vmlinux in a different directory
2003-12-17 21:56 [PATCH] Get modpost to work properly with vmlinux in a different directory Bryan O'Sullivan
@ 2003-12-22 1:43 ` Rusty Russell
0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2003-12-22 1:43 UTC (permalink / raw)
To: Bryan O'Sullivan; +Cc: kai, sam, akpm, linux-kernel
On Wed, 17 Dec 2003 13:56:27 -0800
Bryan O'Sullivan <bos@pathscale.com> wrote:
> This is pretty trivial. 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.
Thanks, I've taken it. I'll push to Andrew once things have calmed down.
Thanks,
Rusty.
--
there are those who do and those who hang on and you don't see too
many doers quoting their contemporaries. -- Larry McVoy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-12-22 1:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-17 21:56 [PATCH] Get modpost to work properly with vmlinux in a different directory Bryan O'Sullivan
2003-12-22 1:43 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome