Jump to content
XPEnology Community

Kernel symbols question (module development)


Recommended Posts

Hi guys,

 

I'm having a problem with a module. When trying to load the kernel it complains about a missing symbol, but it exists!:

DiskStation> modprobe sync_file
[   57.291977] sync_file: Unknown symbol anon_inode_getfile (err 0)
modprobe: ERROR: could not insert 'sync_file': Unknown symbol in module, or unknown parameter (see dmesg)
DiskStation> grep anon_inode_getfile /proc/kallsyms 
ffffffff811d07d0 T anon_inode_getfile

 

It exists in Module.symvers:

$ grep anon_inode_getfile Module.symvers
0x00000000      anon_inode_getfile      vmlinux EXPORT_SYMBOL_GPL

 

So I ask for help from those more experienced in linux.

Link to comment
Share on other sites

15 minutes ago, fbelavenuto said:

I'm sorry I hadn't seen your post!

I am trying to compile i915 for broadwell. Source code is latest from Synology (linux-4.4.x.txz)

Good luck, I'm currently stuck at the point in my topic above.

If you succeed, please tell me :)

  • Like 1
Link to comment
Share on other sites

On 1/20/2023 at 11:09 AM, Orphée said:

Good luck, I'm currently stuck at the point in my topic above.

If you succeed, please tell me :)

Found a solution!!

 

The symbol "anon_inode getfile" is called in the file "drivers/dma-buf/sync_file.c". This file was not created to be compiled as a module, so it does not link with existing symbols.

To resolve this, add the following line to this file, next to "#includes":

 

Quote

#include <linux/module.h>

 

Then add at the end of the file:

 

Quote

MODULE_LICENSE("GPL");

 

Once done, the file will be compiled as a GPL module and can be linked with any other kernel symbol.

 

 

 

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, fbelavenuto said:

Found a solution!!

 

The symbol "anon_inode getfile" is called in the file "drivers/dma-buf/sync_file.c". This file was not created to be compiled as a module, so it does not link with existing symbols.

To resolve this, add the following line to this file, next to "#includes":

 

 

Then add at the end of the file:

 

 

Once done, the file will be compiled as a GPL module and can be linked with any other kernel symbol.

 

 

 

Well played, were you able to build everything ?

 

did you try to build trace_events.ko ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...