From: Keith Owens <kaos@ocs.com.au>
To: "Anthony Chee" <anthony.chee@polyu.edu.hk>
Cc: "Bart Trojanowski" <bart@jukie.net>,
linux-kernel@vger.kernel.org, kbuild-devel@vger.kernel.org,
kernelnewbies@vger.kernel.org
Subject: Re: undefined reference
Date: Tue, 26 Mar 2002 16:49:58 +1100 [thread overview]
Message-ID: <21554.1017121798@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Tue, 26 Mar 2002 12:17:50 +0800." <000701c1d47d$31daade0$ccd7fea9@winxp>
On Tue, 26 Mar 2002 12:17:50 +0800,
"Anthony Chee" <anthony.chee@polyu.edu.hk> wrote:
>Or let me say clearly.
>
>The suitution is I want the kernel source use the symbol from module.
>
>What I did in the module code are:
>1. EXPORT_SYMBOL(func) in the source code of module
>2. Set "extern int func()" in the module header
>
>What I did in the kernel source code are:
>1. Insert "func()" in the inode.c
>2. Add the module header in the kernel source code
>
>Then I use "make bzImage", I got no error message on compiling inode.c, but
>I got
>
>"fs/fs.o(.text+0x1377d): undefined reference to `func'"
You cannot do that. The kernel must be self contained. The only way
for the kernel to access module code and data is for the module to
register that code and data when the module is loaded and for the
kernel to access the module via the registration list.
See any module that handles a filesystem. sys_open() does not call the
module directly. A module registers its file operations on load. The
kernel (dentry_open) calls the module via f->f_op->open.
next prev parent reply other threads:[~2002-03-26 12:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-24 16:16 undefined reference Anthony Chee
2002-03-25 21:45 ` Bart Trojanowski
2002-03-26 4:17 ` Anthony Chee
2002-03-26 5:49 ` Keith Owens [this message]
2002-03-30 14:19 ` Anthony Chee
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=21554.1017121798@kao2.melbourne.sgi.com \
--to=kaos@ocs.com.au \
--cc=anthony.chee@polyu.edu.hk \
--cc=bart@jukie.net \
--cc=kbuild-devel@vger.kernel.org \
--cc=kernelnewbies@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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