From: "H. Peter Anvin" <hpa@zytor.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Rusty Russell <rusty@rustcorp.com.au>
Cc: andy.shevchenko@gmail.com, arjan@infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: memcmp in modules
Date: Tue, 23 Apr 2013 16:15:28 -0700 [thread overview]
Message-ID: <51771610.5040303@zytor.com> (raw)
In-Reply-To: <201304222326.IJB21395.FOtVJFHFQMOOSL@I-love.SAKURA.ne.jp>
On 04/22/2013 07:26 AM, Tetsuo Handa wrote:
> Andy Shevchenko wrote:
>> What did I miss?
>
> Well, as of linux-next-20130422, memcmp() is not correctly exported to modules.
> Since linux-3.9-rc8 correctly exports memcmp(), this problem seems to be introduced
> in linux-next tree. Also, this problem seems to involve CONFIG_MODVERSIONS=y.
>
> [root@localhost linux-next]# modprobe ipv6
> FATAL: Error inserting ipv6 (/lib/modules/3.9.0-rc8-next-20130422/kernel/net/ipv6/ipv6.ko): Invalid argument
> [root@localhost linux-next]# dmesg
> ipv6: no symbol version for memcmp
> ipv6: Unknown symbol memcmp (err -22)
>
> Since arch/x86/include/asm/string_64.h uses
>
> int memcmp(const void *cs, const void *ct, size_t count);
>
> while arch/x86/include/asm/string_32.h uses
>
> #define memcmp __builtin_memcmp
>
> changing to what you have tried
>
> #define memcmp(a, b, n) __builtin_memcmp(a, b, n)
>
> or changing to what x86_64 does
>
> int memcmp(const void *cs, const void *ct, size_t count);
>
> might solve this problem. But I don't know which one is correct solution...
>
Rusty, this seems like a problem with your changes to the prefix
handling. Somehow memcmp being a macro gets picked up by some, but not
all, of the module-metadata generation tools.
Changing memcmp to a macro with arguments (see above) seems to paper
over the problem for this one, but there seems to be something much more
sinister going on and I would really like a good explanation as I fear
this can crop up in other places.
-hpa
prev parent reply other threads:[~2013-04-23 23:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHp75VdDwh0wgCWrVDcPps1C2qfdDZra15y9BQvzfWHzSMqbWA@mail.gmail.com>
2013-04-12 15:08 ` memcmp in modules Andy Shevchenko
2013-04-22 14:26 ` Tetsuo Handa
2013-04-23 12:40 ` [PATCH] x86_32: Fix module version table mismatch Tetsuo Handa
2013-04-23 14:14 ` Andy Shevchenko
2013-04-23 15:17 ` H. Peter Anvin
2013-04-23 15:41 ` Andy Shevchenko
2013-04-23 22:07 ` H. Peter Anvin
2013-04-23 22:56 ` H. Peter Anvin
2013-04-24 0:52 ` H. Peter Anvin
2013-04-24 1:00 ` H. Peter Anvin
2013-04-24 10:13 ` James Hogan
2013-04-24 11:24 ` Andy Shevchenko
2013-04-24 12:28 ` Tetsuo Handa
2013-04-24 13:49 ` Andy Shevchenko
2013-04-24 17:48 ` H. Peter Anvin
2013-04-25 10:42 ` [PATCH v2] modpost: fix unwanted VMLINUX_SYMBOL_STR expansion James Hogan
2013-04-29 2:10 ` Rusty Russell
2013-04-23 23:15 ` H. Peter Anvin [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=51771610.5040303@zytor.com \
--to=hpa@zytor.com \
--cc=andy.shevchenko@gmail.com \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=rusty@rustcorp.com.au \
/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