From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: ppc/ppc64 and x86 vsyscalls
Date: Wed, 10 Mar 2004 08:33:13 +1100 [thread overview]
Message-ID: <1078867992.9745.25.camel@gaston> (raw)
In-Reply-To: <404E33A7.6070800@redhat.com>
On Wed, 2004-03-10 at 08:14, Ulrich Drepper wrote:
> You can create one "big" DSO which covers all the configured processors.
> Then at kernel start time, you determine the actual processor and
> adjust the symbol table offsets to point to the correct version. There
> is no requirement that the table used is identical to the one on disk.
> It's loaded into ordinary memory which can be modified.
Ah, interesting.
> The tricky part of this would be to determine the symbol table slots.
> But even this is quite simple. Just locate the symbol table in the
> ELF-way, then iterate over the entries and use strcmp() for the names
> and act upon match. What you shouldn't do is to generate pointer to the
> symbol table entries somewhere. This is probably fragile and not worth
> the few cycles you'll save.
Yes, make sense. I can "pre" prepare bth 32 and 64 bits DSOs at kernel
start time, then I just have to map them. I suppose I should layout my
DSO in such a way:
/* In one place the actual function implementation */
function_A_vers_1()
function_A_vers_2()
function_A_vers_3()
function_B_vers_1()
function_B_vers_2()
etc .../...
/* Then, some empty "stubs" for the symbol table that gets really
* linked into user binaries. Those are the symbol table entries
* that get patched
*/
function_A() {}
function_B() {}
Sounds right ? It's not completely obvious how I'll do to also map the
64 bits versions of these in the kernel address space, but I can find
a trick.
Ben.
next prev parent reply other threads:[~2004-03-09 21:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-08 1:17 ppc/ppc64 and x86 vsyscalls Benjamin Herrenschmidt
2004-03-09 8:05 ` Ulrich Drepper
2004-03-09 11:05 ` Benjamin Herrenschmidt
2004-03-09 21:14 ` Ulrich Drepper
2004-03-09 21:33 ` Benjamin Herrenschmidt [this message]
2004-03-10 0:35 ` Ulrich Drepper
2004-03-10 2:08 ` Benjamin Herrenschmidt
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=1078867992.9745.25.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=drepper@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.