3

I am porting a Linux module (PageMgrMod) to a more recent kernel, but now the functions are not visible to other modules. For example, loading a module that uses PageMgrMod gives the error

    no symbol version for init_pgmgr
    Unknown symbol init_pgmgr

But reading /proc/kallsyms shows the symbol exists

    ffffffff81883c0d T x86_init_pgd_noop
    ffffffffa012a5c0 r __ksymtab_init_pgmgr [PageMgrMod]
    ffffffffa012a669 r __kstrtab_init_pgmgr [PageMgrMod]
    ffffffffa012a600 r __kcrctab_init_pgmgr [PageMgrMod]
    ffffffffa012a380 T init_pgmgr   [PageMgrMod]

This functionality worked on a 2.6.18 kernel but fails on a 2.6.32-24 kernel.

I have seen similar questions, but those solutions do not help due to the fact I cannot modify the other modules.

If it makes a difference, the module sources are in different folders.

ctuffli
  • 3,559
  • 4
  • 31
  • 43
user973523
  • 31
  • 2
  • Did you use Module.symvers file from `PageMgrMod` module when you were building the module that uses `PageMgrMod`? Using incorrect .symvers file (or no file at all) may cause the errors you described. – Eugene Oct 04 '11 at 07:48

1 Answers1

0

To make init_pgmgr visible to other modules, add

EXPORT_SYMBOL(init_pgmgr);

to the PageMgrMod module. Without the above declaration, the symbol is available to any code built into the kernel (referred to some places as an external symbol), but not to other loadable modules.

This is similar to question #413955 How to write Linux driver module call/use another driver module?

Community
  • 1
  • 1
ctuffli
  • 3,559
  • 4
  • 31
  • 43
  • Thanks for your reply,i have already used the EXPORT_SYMBOL marco for my functions.The symbols are visible to other modules but it seems that their versions(?) are not what they should be.Overall i cant really understand why i get these messages , since everything worked in an older kernel version. – user973523 Oct 02 '11 at 13:23