Linux symbol export method:

 

[1] If we want export the symbol in a module, just use the EXPORT_SYMBOL(xxxx) in the C or H file.

 

  And compile the module by adding the compile flag -DEXPORT_SYMTAB.

 

  Then we can use the xxxx in the other module.

 

[2] If we want export some symbol in Kernel that is not in a module such as xxxx in the /arch/ppc/fec.c.

 

  Firstly, define the xxxx in the fec.c;

 

  Secondly, make a new file which contain the "extern" define the xxxx(for example, extern int xxxx);

 

  Lastly, in the ppc_ksyms.c we includes the new file, and add the EXPORT_SYMBOL(xxxx).

 

  Then we can use the xxxx.

 

相关文章:

  • 2022-01-07
  • 2021-04-20
  • 2022-12-23
  • 2021-09-25
  • 2021-09-29
猜你喜欢
  • 2021-07-28
  • 2022-12-23
  • 2021-11-06
  • 2021-12-27
  • 2021-05-19
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案