linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Insmod gives unsresolved symbol
@ 2001-11-06  8:17 Amit Kulkarni
  2001-11-06 14:59 ` Tommy Reynolds
  0 siblings, 1 reply; 4+ messages in thread
From: Amit Kulkarni @ 2001-11-06  8:17 UTC (permalink / raw)
  To: linux-kernel

Hi 

I am trying to write a device driver which calls
certain functions/variables from the kernel 
(e.g. ipv4_explicit_null from
/usr/src/linux/net/mpls/mpls_init.c )

But when I try to insert the module using insmod it
gives me an error saying unresolved symbol
ipv4_explicit_null

thinking the kernel did not export the said symbol  I
added EXPORT_SYMBOL(ipv4_explicit_null) in the file
mpls_init.c 
Now I can see the symbol in System.map
but my problem still persists. 

Am I exporting symbols properly or is there anything
else that needs to be done .

please advise 
thanks in anticipation,
amit

__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Insmod gives unsresolved symbol
  2001-11-06  8:17 Insmod gives unsresolved symbol Amit Kulkarni
@ 2001-11-06 14:59 ` Tommy Reynolds
  2001-11-06 19:00   ` Amit Kulkarni
  0 siblings, 1 reply; 4+ messages in thread
From: Tommy Reynolds @ 2001-11-06 14:59 UTC (permalink / raw)
  To: Amit Kulkarni; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]

It was a dark and stormy night.  Suddenly "Amit Kulkarni" <amitncsu@yahoo.com> wrote:

> Hi 
> 
> I am trying to write a device driver which calls
> certain functions/variables from the kernel 
> (e.g. ipv4_explicit_null from
> /usr/src/linux/net/mpls/mpls_init.c )
> 
> But when I try to insert the module using insmod it
> gives me an error saying unresolved symbol
> ipv4_explicit_null
> 
> thinking the kernel did not export the said symbol  I
> added EXPORT_SYMBOL(ipv4_explicit_null) in the file
> mpls_init.c 
> Now I can see the symbol in System.map
> but my problem still persists. 
> 
> Am I exporting symbols properly or is there anything
> else that needs to be done .

I assume that you're trying to build a module outside the regular kernel build
system.  You can do this if you are carefull.

Look carefully at the symbol in the System.map file.  Is it EXACTLY the
"ipv4_explicit_null" symbol? Are the extra characters after the "...null" part
of the name?  Any extra characters mean that you've got module versioning turned
on in your kernel, so exported symbols have their name mangled somewhat as C++
would do (this is to implement some protection since modules from one kernel
version probably won't work with another kernel version).  The easiest solution
to this is to recompile your kernel with module versioning turned off.

---------------------------------------------+-----------------------------
Tommy Reynolds                               | mailto: <reynolds@redhat.com>
Red Hat, Inc., Embedded Development Services | Phone:  +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA  | FAX:    +1.256.837.3839
Senior Software Developer                    | Mobile: +1.919.641.2923

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Insmod gives unsresolved symbol
  2001-11-06 14:59 ` Tommy Reynolds
@ 2001-11-06 19:00   ` Amit Kulkarni
  0 siblings, 0 replies; 4+ messages in thread
From: Amit Kulkarni @ 2001-11-06 19:00 UTC (permalink / raw)
  To: Tommy Reynolds; +Cc: linux-kernel

In system.map there are no other charachters except
ipv4_explicit_null the line is 
c03c4900 B ipv4_explicit_null
same is true for all other symbols I added.

I am not sure what B indicates




--- Tommy Reynolds <reynolds@redhat.com> wrote:
> It was a dark and stormy night.  Suddenly "Amit
> Kulkarni" <amitncsu@yahoo.com> wrote:
> 
> > Hi 
> > 
> > I am trying to write a device driver which calls
> > certain functions/variables from the kernel 
> > (e.g. ipv4_explicit_null from
> > /usr/src/linux/net/mpls/mpls_init.c )
> > 
> > But when I try to insert the module using insmod
> it
> > gives me an error saying unresolved symbol
> > ipv4_explicit_null
> > 
> > thinking the kernel did not export the said symbol
>  I
> > added EXPORT_SYMBOL(ipv4_explicit_null) in the
> file
> > mpls_init.c 
> > Now I can see the symbol in System.map
> > but my problem still persists. 
> > 
> > Am I exporting symbols properly or is there
> anything
> > else that needs to be done .
> 
> I assume that you're trying to build a module
> outside the regular kernel build
> system.  You can do this if you are carefull.
> 
> Look carefully at the symbol in the System.map file.
>  Is it EXACTLY the
> "ipv4_explicit_null" symbol? Are the extra
> characters after the "...null" part
> of the name?  Any extra characters mean that you've
> got module versioning turned
> on in your kernel, so exported symbols have their
> name mangled somewhat as C++
> would do (this is to implement some protection since
> modules from one kernel
> version probably won't work with another kernel
> version).  The easiest solution
> to this is to recompile your kernel with module
> versioning turned off.
> 
>
---------------------------------------------+-----------------------------
> Tommy Reynolds                               |
> mailto: <reynolds@redhat.com>
> Red Hat, Inc., Embedded Development Services |
> Phone:  +1.256.704.9286
> 307 Wynn Drive NW, Huntsville, AL 35805 USA  | FAX: 
>   +1.256.837.3839
> Senior Software Developer                    |
> Mobile: +1.919.641.2923
> 

> ATTACHMENT part 2 application/pgp-signature 



__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Insmod gives unsresolved symbol
       [not found] <sbe7b36f.021@MAIL-SMTP.uvsc.edu>
@ 2001-11-06 19:04 ` Amit Kulkarni
  0 siblings, 0 replies; 4+ messages in thread
From: Amit Kulkarni @ 2001-11-06 19:04 UTC (permalink / raw)
  To: Tyler BIRD, linux-kernel

these functions are defined in /net/mpls.h as extern
variables. 
I don't think there is a mpls_init.h
I have included mpls.h and hence it compiles w/o error
but only at the time of linking  it gives this error



--- Tyler BIRD <BIRDTY@uvsc.edu> wrote:
> Well you still much include the header file for the
> link
> whatever it might be.  #include
> <include/mpls_init.h>
> for example.  Only some functions such as printk
> don't need such headers.
> 
> Tyler
> 
> 
> >>> Amit Kulkarni <amitncsu@yahoo.com> 11/06/01
> 01:17AM >>>
> Hi 
> 
> I am trying to write a device driver which calls
> certain functions/variables from the kernel 
> (e.g. ipv4_explicit_null from
> /usr/src/linux/net/mpls/mpls_init.c )
> 
> But when I try to insert the module using insmod it
> gives me an error saying unresolved symbol
> ipv4_explicit_null
> 
> thinking the kernel did not export the said symbol 
> I
> added EXPORT_SYMBOL(ipv4_explicit_null) in the file
> mpls_init.c 
> Now I can see the symbol in System.map
> but my problem still persists. 
> 
> Am I exporting symbols properly or is there anything
> else that needs to be done .
> 
> please advise 
> thanks in anticipation,
> amit
> 
> __________________________________________________
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-11-06 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-06  8:17 Insmod gives unsresolved symbol Amit Kulkarni
2001-11-06 14:59 ` Tommy Reynolds
2001-11-06 19:00   ` Amit Kulkarni
     [not found] <sbe7b36f.021@MAIL-SMTP.uvsc.edu>
2001-11-06 19:04 ` Amit Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).