From: Greg KH <greg@kroah.com>
To: Tomek The Messenger <tomekthemessenger@gmail.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Unknown symbol reboot_mode
Date: Mon, 23 Mar 2020 11:46:53 +0100 [thread overview]
Message-ID: <20200323104653.GA522243@kroah.com> (raw)
In-Reply-To: <CAA4NGyvS=wBr4+y+LFa0C+XbfGDhwesqMwk6aQ0TbVCjDHC_5A@mail.gmail.com>
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
prev parent reply other threads:[~2020-03-23 10:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 10:27 Unknown symbol reboot_mode Tomek The Messenger
2020-03-23 10:46 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200323104653.GA522243@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@kernelnewbies.org \
--cc=tomekthemessenger@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).