kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Unknown symbol reboot_mode
@ 2020-03-23 10:27 Tomek The Messenger
  2020-03-23 10:46 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Tomek The Messenger @ 2020-03-23 10:27 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 620 bytes --]

Hi
When I insert external kernel module which is compiled out of tree I got
error:

root:/run# insmod ./my_module.ko
[  137.443823] my_module: Unknown symbol reboot_mode (err 0)

I investigated that I have attached in my my_module.c file:
#include <linux/reboot.h>
and in this file we have:
extern enum reboot_mode reboot_mode;
However reboot_mode symbol is not exported with macro EXPORT_SYMBOL_GPL.
Probably this is the reason why symbol is not seen in my module. Then why
the same issue doesn't occur here:
/arch/arm/kernel/setup.c
/arch/arm64/kernel/process.c
Those linux files also use global variable reboot_mode.

[-- Attachment #1.2: Type: text/html, Size: 811 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Unknown symbol reboot_mode
  2020-03-23 10:27 Unknown symbol reboot_mode Tomek The Messenger
@ 2020-03-23 10:46 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-03-23 10:46 UTC (permalink / raw)
  To: Tomek The Messenger; +Cc: kernelnewbies

On Mon, Mar 23, 2020 at 11:27:50AM +0100, Tomek The Messenger wrote:
> Hi
> When I insert external kernel module which is compiled out of tree I got
> error:
> 
> root:/run# insmod ./my_module.ko
> [  137.443823] my_module: Unknown symbol reboot_mode (err 0)
> 
> I investigated that I have attached in my my_module.c file:
> #include <linux/reboot.h>
> and in this file we have:
> extern enum reboot_mode reboot_mode;
> However reboot_mode symbol is not exported with macro EXPORT_SYMBOL_GPL.
> Probably this is the reason why symbol is not seen in my module.

That is correct.

> Then why
> the same issue doesn't occur here:
> /arch/arm/kernel/setup.c
> /arch/arm64/kernel/process.c
> Those linux files also use global variable reboot_mode.

Because those files are not built as a kernel module, but rather
directly into the kernel image.

hope this helps,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2020-03-23 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 10:27 Unknown symbol reboot_mode Tomek The Messenger
2020-03-23 10:46 ` Greg KH

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).