kernprof
[Top] [All Lists]

Re: 2.4.16 kernel, 0.10.3 profiler, 2.96 gcc, insmod -> unresolved symbo

To: John Hawkes <hawkes@xxxxxxx>
Subject: Re: 2.4.16 kernel, 0.10.3 profiler, 2.96 gcc, insmod -> unresolved symbol mcount
From: Gary Hade <garyhade@xxxxxxxxxx>
Date: Tue, 5 Mar 2002 13:00:36 -0800
Cc: "Cameron, Steve" <Steve.Cameron@xxxxxxxxxx>, kernprof@xxxxxxxxxxx
In-reply-to: <006501c17925$eaa690e0$6801a8c0@wrlarun>; from hawkes@xxxxxxx on Thu, Nov 29, 2001 at 02:33:49PM -0800
References: <45B36A38D959B44CB032DA427A6E10640167CF00@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <006501c17925$eaa690e0$6801a8c0@wrlarun>
Sender: owner-kernprof@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Thu, Nov 29, 2001 at 02:33:49PM -0800, John Hawkes wrote:
> From: "Cameron, Steve" <Steve.Cameron@xxxxxxxxxx>
> > Doing "insmod anymodule" I get
> >
> > unresolved symbol mcount
> >
> > (Though all my looking through the code, I can't see how
> > mcount can possibly be unresolved,
> > (e.g. nm vmlinux shows it as "T", in the text)
> >
> > I have patched 2.4.16 with the profiler patch 0.10.3,(for 2.4.14)
> > (small mismatch in sched.c, but no big deal to fix, and some
> > rejects in ia64 and sparc land that I ignored, as I'm
> > in i386 land.)
> 
> I've just done pretty much the same thing -- 0.10.4 massaged to patch
> 2.4.16 -- and I'm not seeing this same insmod problem.  Are you sure you
> compiled your kernel with CONFIG_MCOUNT?
> 
> John Hawkes
> hawkes@xxxxxxx
> 
> 

John,
I encountered this problem using the 2.4.17 patch.  It happens when 
module version support is enabled (CONFIG_MODVERSIONS=y). 
e.g.
    Script started on Tue Mar  5 10:49:37 2002
    %
    % /sbin/insmod eepro100
    Using /lib/modules/2.4.17/kernel/drivers/net/eepro100.o
    /lib/modules/2.4.17/kernel/drivers/net/eepro100.o: unresolved symbol mcount
    %
    % nm /lib/modules/2.4.17/kernel/drivers/net/eepro100.o | grep mcount
             U mcount
    %
    % grep mcount /proc/ksyms
    c02076a0 mcount_R__ver_mcount
    c024242c mcount_hook_R7370f89d
    c0242434 prof_have_mcount_Rdd6f69db
    %
    % exit
    exit
    
    Script done on Tue Mar      5 10:50:41 2002

A fix is included below.

Gary

-- 
Gary Hade
IBM Linux Technology Center
503-578-4503  IBM T/L: 775-4503
garyhade@xxxxxxxxxx
http://www.ibm.com/linux/ltc


--- arch/i386/kernel/i386_ksyms.c.orig  Mon Mar  4 15:16:28 2002
+++ arch/i386/kernel/i386_ksyms.c       Tue Mar  5 11:19:52 2002
@@ -170,7 +170,7 @@
 
 #if defined(CONFIG_MCOUNT)
 extern void mcount(void);
-EXPORT_SYMBOL(mcount);
+EXPORT_SYMBOL_NOVERS(mcount);
 #endif /*  CONFIG_MCOUNT */
 
 #ifdef CONFIG_HAVE_DEC_LOCK
--- arch/ia64/kernel/ia64_ksyms.c.orig  Tue Mar  5 11:09:19 2002
+++ arch/ia64/kernel/ia64_ksyms.c       Tue Mar  5 11:19:52 2002
@@ -150,5 +150,5 @@
 
 #if defined(CONFIG_MCOUNT)
 extern void _mcount(void);
-EXPORT_SYMBOL(_mcount);
+EXPORT_SYMBOL_NOVERS(_mcount);
 #endif
--- arch/mips64/kernel/mips64_ksyms.c.orig      Tue Mar  5 11:10:30 2002
+++ arch/mips64/kernel/mips64_ksyms.c   Tue Mar  5 11:19:52 2002
@@ -122,5 +122,5 @@
 
 #if defined(CONFIG_MCOUNT)
 extern void _mcount(void);
-EXPORT_SYMBOL(_mcount);
+EXPORT_SYMBOL_NOVERS(_mcount);
 #endif
--- arch/sparc64/kernel/sparc64_ksyms.c.orig    Tue Mar  5 11:11:30 2002
+++ arch/sparc64/kernel/sparc64_ksyms.c Tue Mar  5 11:19:52 2002
@@ -139,7 +139,7 @@
 EXPORT_SYMBOL(setup_profiling_timer);
 #if defined(CONFIG_MCOUNT)
 extern void mcount(void);
-EXPORT_SYMBOL(mcount);
+EXPORT_SYMBOL_NOVERS(mcount);
 #endif
 #endif
 


<Prev in Thread] Current Thread [Next in Thread>