From: Keith Owens <kaos@ocs.com.au>
To: "kumar M" <kumarm4@hotmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: exporting kernel symbols
Date: Mon, 28 Jan 2002 10:37:44 +1100 [thread overview]
Message-ID: <27549.1012174664@ocs3.intra.ocs.com.au> (raw)
In-Reply-To: Your message of "Sun, 27 Jan 2002 15:16:10 -0000." <F206dZTLOAnjLGXYB1J00005490@hotmail.com>
On Sun, 27 Jan 2002 15:16:10 +0000,
"kumar M" <kumarm4@hotmail.com> wrote:
>I am interested in knowing how mangling the name of symbols
>exported by the kernel to include the checksum of the information related to
>that symbol is done, whenever MOD VERSIONS
>is used for building a module. Is there any documentation on the
>process of the checksum computation, and which portion of the linux
>sources I need to go through to understand this ?
genksyms.c in the modutils source package[1]. The make dep process
pre-processes the C sources from each directory feeding the cpp output
into genksyms. genksyms calculates a hash for each exported symbol
based on its type, return values, parameters etc., recursively
descending parameter types as required.
The resulting hashes are written out as #defines to change foo to
foo_Rxxxxxxxx. The defines are read back in when the real compile is
done, change references to foo into foo_Rxxxxxxxx. In the kernel the
original symbols are used but the export list includes the suffix. In
modules, external references include the suffix.
In theory if a module refers to a symbol and the hashes for that symbol
match then the symbol has not changed its ABI and it is safe to load
the module, even if the kernel and module are from different versions.
In practice, modversions relies far too much on human processes and is
prone to false positives. The hashes can match when the ABI is
different because of human error[2], especially when people compile
drivers outside the kernel tree. Kernel and modutils 2.5 will have a
completely different method for checking ABI compatibility, if kbuild
2.5 ever gets in.
[1] http://kernel.org/pub/linux/utils/kernel/modutils/v2.4
[2] http://prdownloads.sourceforge.net/kbuild/kbuild-2.5-history.tar.bz2
next prev parent reply other threads:[~2002-01-27 23:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-27 15:16 kumar M
2002-01-27 23:37 ` Keith Owens [this message]
2002-01-28 13:13 kumar M
2002-01-28 13:22 ` Keith Owens
2003-02-13 20:22 Exporting Kernel Symbols shesha bhushan
2003-02-13 20:26 ` Randy.Dunlap
2003-02-13 20:35 shesha bhushan
2003-02-13 21:10 shesha bhushan
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=27549.1012174664@ocs3.intra.ocs.com.au \
--to=kaos@ocs.com.au \
--cc=kumarm4@hotmail.com \
--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
all inboxes | Powered by JetHome®