Re: External Modules: undefined symbol problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Lukas Ruf <ruf@xxxxxxxxx> [2006-01-26 14:40]:
>
> However, there is "cosmetic" issue that annoys me:  when I reference a
> symbol of another external module, an 'undefined' warning message is
> returned.  Why?
>
>
>     module_1
>         - resides in its own directory structure
>         - EXPORT_SYMBOL_GPL(a_required_function)
>         - defines in module_1.h
>             extern unsigned a_required_function(struct sk_buff *skb);
>
>     module_2 resides in its own directory structure
>         - resides in its own directory structure
>         - requires "a_required_function"
>         - includes "module_1.h"
>
> Compiling does not result in any error/warning.
>
> Linking module_1 does not result in any error/warning.
>
> Linking module_2 returns the warning:
>     MODPOST
>   *** Warning: "a_required_function" [path_to/module_2.ko] undefined!
>

I assume to have found the problem:

    Defining the object files in Kbuild makes the Linux 2.6 Makefile
    system run the modpost over all the object files defined there:

    scripts/mod/modpost -m  -i \
      <path_to_linux>/Module.symvers vmlinux \
      <path_to_module>/module_2.o \
      <path_to_module>/module_2a.o \
      <path_to_module>/module_2b.o

    Since Kbuild includes only those objects in one directory, it
    cannot find the symbol defined elsewhere.

    Thus, it reports the problem because it cannot find the other
    symbols.

    If there was any possibility to include other objects the target
    module depends on, the problem would be solved.


Can anyone confirm my "assumption"?

Thanks!

wbr,
Lukas
-- 
Lukas Ruf   <http://www.lpr.ch> | Ad Personam
rbacs      <http://wiki.lpr.ch> | Restaurants, Bars and Clubs
Raw IP   <http://www.rawip.org> | Low Level Network Programming
Style  <http://email.rawip.org> | How to write emails

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux