* [Kernel-janitors] reference_init.pl for Linux 2.6
@ 2004-02-19 2:23 ` Randy.Dunlap
0 siblings, 0 replies; 8+ messages in thread
From: Randy.Dunlap @ 2004-02-19 2:23 UTC (permalink / raw)
To: kjo; +Cc: lkml, kaos
I have updated Keith Owens "reference_init.pl" script for
Linux 2.6. It searches for code that refers to other code
sections that they should not reference, such as init code
calling exit code or v.v.
The script searches all .o (non-MODULE) files in the current
directory and sub-directories. To restrict its scope, just
'cd drivers/video', e.g., to run it.
Notes: __devinit and __devexit don't mean/do anything if
CONFIG_HOTPLUG=y, so setting CONFIG_HOTPLUG=n and doing a
'make allyesconfig && make all' finds the most possible
problems. I say 'possible' because there are probably some
false positives reported.
script for Linux 2.6 is at:
http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
and output from Linux 2.6.3 is at:
http://developer.osdl.org/rddunlap/scripts/badrefs.out
Comments/corrections welcome.
--
~Randy
kernel-janitors project: http://janitor.kernelnewbies.org/
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 8+ messages in thread
* reference_init.pl for Linux 2.6
@ 2004-02-19 2:23 ` Randy.Dunlap
0 siblings, 0 replies; 8+ messages in thread
From: Randy.Dunlap @ 2004-02-19 2:23 UTC (permalink / raw)
To: kjo; +Cc: lkml, kaos
I have updated Keith Owens "reference_init.pl" script for
Linux 2.6. It searches for code that refers to other code
sections that they should not reference, such as init code
calling exit code or v.v.
The script searches all .o (non-MODULE) files in the current
directory and sub-directories. To restrict its scope, just
'cd drivers/video', e.g., to run it.
Notes: __devinit and __devexit don't mean/do anything if
CONFIG_HOTPLUG=y, so setting CONFIG_HOTPLUG=n and doing a
'make allyesconfig && make all' finds the most possible
problems. I say 'possible' because there are probably some
false positives reported.
script for Linux 2.6 is at:
http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
and output from Linux 2.6.3 is at:
http://developer.osdl.org/rddunlap/scripts/badrefs.out
Comments/corrections welcome.
--
~Randy
kernel-janitors project: http://janitor.kernelnewbies.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Kernel-janitors] Re: reference_init.pl for Linux 2.6
2004-02-19 2:23 ` Randy.Dunlap
@ 2004-02-19 2:51 ` Dave Jones
-1 siblings, 0 replies; 8+ messages in thread
From: Dave Jones @ 2004-02-19 2:51 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: kjo, lkml, Andrew Morton, Linus Torvalds
On Wed, Feb 18, 2004 at 06:23:13PM -0800, Randy.Dunlap wrote:
> and output from Linux 2.6.3 is at:
> http://developer.osdl.org/rddunlap/scripts/badrefs.out
Error: ./arch/i386/kernel/cpu/cpufreq/longhaul.o .text refers to 00000358 R_386_PC32 .init.text
Error: ./arch/i386/kernel/cpu/cpufreq/longhaul.o .text refers to 000003ac R_386_PC32 .init.text
Error: ./arch/i386/kernel/cpu/cpufreq/longrun.o .text refers to 0000019b R_386_PC32 .init.text
Here come the cpufreq fixes..
(Linus: also at bk://linux-dj.bkbits.net/cpufreq, with 2 other trivial bits)
Dave
# 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.1635 -> 1.1636
# arch/i386/kernel/cpu/cpufreq/longhaul.c 1.52 -> 1.53
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/19 davej@redhat.com 1.1636
# [CPUFREQ] Add extra __init markers to longhaul driver.
# Caught by Randy Dunlap.
# longhaul_cpu_init only gets called during startup, and calls
# other __init routines.
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c Thu Feb 19 02:49:01 2004
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c Thu Feb 19 02:49:01 2004
@@ -186,6 +186,7 @@
return target;
}
+
static int guess_fsb(int maxmult)
{
int speed = (cpu_khz/1000);
@@ -203,7 +204,6 @@
}
-
static int __init longhaul_get_ranges (void)
{
struct cpuinfo_x86 *c = cpu_data;
@@ -359,7 +359,7 @@
return 0;
}
-static int longhaul_cpu_init (struct cpufreq_policy *policy)
+static int __init longhaul_cpu_init (struct cpufreq_policy *policy)
{
struct cpuinfo_x86 *c = cpu_data;
char *cpuname=NULL;
# 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.1636 -> 1.1637
# arch/i386/kernel/cpu/cpufreq/longrun.c 1.17 -> 1.18
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/19 davej@redhat.com 1.1637
# [CPUFREQ] Add extra __init markers to longrun driver.
# Caught by Randy Dunlap.
# longrun_cpu_init() only gets called during startup, and calls
# other __init routines.
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c
--- a/arch/i386/kernel/cpu/cpufreq/longrun.c Thu Feb 19 02:49:08 2004
+++ b/arch/i386/kernel/cpu/cpufreq/longrun.c Thu Feb 19 02:49:08 2004
@@ -220,7 +220,7 @@
}
-static int longrun_cpu_init(struct cpufreq_policy *policy)
+static int __init longrun_cpu_init(struct cpufreq_policy *policy)
{
int result = 0;
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: reference_init.pl for Linux 2.6
@ 2004-02-19 2:51 ` Dave Jones
0 siblings, 0 replies; 8+ messages in thread
From: Dave Jones @ 2004-02-19 2:51 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: kjo, lkml, Andrew Morton, Linus Torvalds
On Wed, Feb 18, 2004 at 06:23:13PM -0800, Randy.Dunlap wrote:
> and output from Linux 2.6.3 is at:
> http://developer.osdl.org/rddunlap/scripts/badrefs.out
Error: ./arch/i386/kernel/cpu/cpufreq/longhaul.o .text refers to 00000358 R_386_PC32 .init.text
Error: ./arch/i386/kernel/cpu/cpufreq/longhaul.o .text refers to 000003ac R_386_PC32 .init.text
Error: ./arch/i386/kernel/cpu/cpufreq/longrun.o .text refers to 0000019b R_386_PC32 .init.text
Here come the cpufreq fixes..
(Linus: also at bk://linux-dj.bkbits.net/cpufreq, with 2 other trivial bits)
Dave
# 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.1635 -> 1.1636
# arch/i386/kernel/cpu/cpufreq/longhaul.c 1.52 -> 1.53
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/19 davej@redhat.com 1.1636
# [CPUFREQ] Add extra __init markers to longhaul driver.
# Caught by Randy Dunlap.
# longhaul_cpu_init only gets called during startup, and calls
# other __init routines.
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c Thu Feb 19 02:49:01 2004
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c Thu Feb 19 02:49:01 2004
@@ -186,6 +186,7 @@
return target;
}
+
static int guess_fsb(int maxmult)
{
int speed = (cpu_khz/1000);
@@ -203,7 +204,6 @@
}
-
static int __init longhaul_get_ranges (void)
{
struct cpuinfo_x86 *c = cpu_data;
@@ -359,7 +359,7 @@
return 0;
}
-static int longhaul_cpu_init (struct cpufreq_policy *policy)
+static int __init longhaul_cpu_init (struct cpufreq_policy *policy)
{
struct cpuinfo_x86 *c = cpu_data;
char *cpuname=NULL;
# 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.1636 -> 1.1637
# arch/i386/kernel/cpu/cpufreq/longrun.c 1.17 -> 1.18
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/19 davej@redhat.com 1.1637
# [CPUFREQ] Add extra __init markers to longrun driver.
# Caught by Randy Dunlap.
# longrun_cpu_init() only gets called during startup, and calls
# other __init routines.
# --------------------------------------------
#
diff -Nru a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c
--- a/arch/i386/kernel/cpu/cpufreq/longrun.c Thu Feb 19 02:49:08 2004
+++ b/arch/i386/kernel/cpu/cpufreq/longrun.c Thu Feb 19 02:49:08 2004
@@ -220,7 +220,7 @@
}
-static int longrun_cpu_init(struct cpufreq_policy *policy)
+static int __init longrun_cpu_init(struct cpufreq_policy *policy)
{
int result = 0;
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Kernel-janitors] Re: reference_init.pl for Linux 2.6
2004-02-19 2:23 ` Randy.Dunlap
@ 2004-02-19 12:00 ` Keith Owens
-1 siblings, 0 replies; 8+ messages in thread
From: Keith Owens @ 2004-02-19 12:00 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: kjo, lkml
On Wed, 18 Feb 2004 18:23:13 -0800,
"Randy.Dunlap" <rddunlap@osdl.org> wrote:
>I have updated Keith Owens "reference_init.pl" script for
>Linux 2.6. It searches for code that refers to other code
>sections that they should not reference, such as init code
>calling exit code or v.v.
>script for Linux 2.6 is at:
>http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
You added '$from !~ /\.data/'. Any references from the .data section
to .init or .exit text should be checked. It is usually a struct
containing a pointer to code that will be discarded, and is dangerous.
There is also a spurious comment line,
# $from !~ $line && $line !~ $from &&
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: reference_init.pl for Linux 2.6
@ 2004-02-19 12:00 ` Keith Owens
0 siblings, 0 replies; 8+ messages in thread
From: Keith Owens @ 2004-02-19 12:00 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: kjo, lkml
On Wed, 18 Feb 2004 18:23:13 -0800,
"Randy.Dunlap" <rddunlap@osdl.org> wrote:
>I have updated Keith Owens "reference_init.pl" script for
>Linux 2.6. It searches for code that refers to other code
>sections that they should not reference, such as init code
>calling exit code or v.v.
>script for Linux 2.6 is at:
>http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
You added '$from !~ /\.data/'. Any references from the .data section
to .init or .exit text should be checked. It is usually a struct
containing a pointer to code that will be discarded, and is dangerous.
There is also a spurious comment line,
# $from !~ $line && $line !~ $from &&
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Kernel-janitors] Re: reference_init.pl for Linux 2.6
2004-02-19 12:00 ` Keith Owens
@ 2004-02-19 17:35 ` Randy.Dunlap
-1 siblings, 0 replies; 8+ messages in thread
From: Randy.Dunlap @ 2004-02-19 17:35 UTC (permalink / raw)
To: Keith Owens; +Cc: kernel-janitors, linux-kernel
On Thu, 19 Feb 2004 23:00:48 +1100 Keith Owens <kaos@ocs.com.au> wrote:
| On Wed, 18 Feb 2004 18:23:13 -0800,
| "Randy.Dunlap" <rddunlap@osdl.org> wrote:
| >I have updated Keith Owens "reference_init.pl" script for
| >Linux 2.6. It searches for code that refers to other code
| >sections that they should not reference, such as init code
| >calling exit code or v.v.
| >script for Linux 2.6 is at:
| >http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
|
| You added '$from !~ /\.data/'. Any references from the .data section
| to .init or .exit text should be checked. It is usually a struct
| containing a pointer to code that will be discarded, and is dangerous.
|
| There is also a spurious comment line,
| # $from !~ $line && $line !~ $from &&
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Both fixed and reposted.
The output probably has a bit more false positives reported now.
script:
http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
output on linux-2.6.3 with CONFIG_HOTPLUG=n and very few modules:
http://developer.osdl.org/rddunlap/scripts/badrefs.out
Thanks, Keith.
--
~Randy
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: reference_init.pl for Linux 2.6
@ 2004-02-19 17:35 ` Randy.Dunlap
0 siblings, 0 replies; 8+ messages in thread
From: Randy.Dunlap @ 2004-02-19 17:35 UTC (permalink / raw)
To: Keith Owens; +Cc: kernel-janitors, linux-kernel
On Thu, 19 Feb 2004 23:00:48 +1100 Keith Owens <kaos@ocs.com.au> wrote:
| On Wed, 18 Feb 2004 18:23:13 -0800,
| "Randy.Dunlap" <rddunlap@osdl.org> wrote:
| >I have updated Keith Owens "reference_init.pl" script for
| >Linux 2.6. It searches for code that refers to other code
| >sections that they should not reference, such as init code
| >calling exit code or v.v.
| >script for Linux 2.6 is at:
| >http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
|
| You added '$from !~ /\.data/'. Any references from the .data section
| to .init or .exit text should be checked. It is usually a struct
| containing a pointer to code that will be discarded, and is dangerous.
|
| There is also a spurious comment line,
| # $from !~ $line && $line !~ $from &&
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Both fixed and reposted.
The output probably has a bit more false positives reported now.
script:
http://developer.osdl.org/rddunlap/scripts/reference_init26.pl
output on linux-2.6.3 with CONFIG_HOTPLUG=n and very few modules:
http://developer.osdl.org/rddunlap/scripts/badrefs.out
Thanks, Keith.
--
~Randy
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-02-19 17:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 2:23 [Kernel-janitors] reference_init.pl for Linux 2.6 Randy.Dunlap
2004-02-19 2:23 ` Randy.Dunlap
2004-02-19 2:51 ` [Kernel-janitors] " Dave Jones
2004-02-19 2:51 ` Dave Jones
2004-02-19 12:00 ` [Kernel-janitors] " Keith Owens
2004-02-19 12:00 ` Keith Owens
2004-02-19 17:35 ` [Kernel-janitors] " Randy.Dunlap
2004-02-19 17:35 ` Randy.Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.