public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: ppc/ppc64 and x86 vsyscalls
Date: Tue, 09 Mar 2004 13:14:15 -0800	[thread overview]
Message-ID: <404E33A7.6070800@redhat.com> (raw)
In-Reply-To: <1078830318.9746.3.camel@gaston>

Benjamin Herrenschmidt wrote:

> Ok. So the challenge is to write the necessary code in the kernel
> to build that DSO based on the various functions after detection
> of the CPU type.
> 
> Another option would be to pre-build a bunch of them at kernel compile
> time. I have to investigate. The risk is that we end up with too
> many combinations, thus bloating the kernel image.

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.

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.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

  reply	other threads:[~2004-03-09 21:14 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 [this message]
2004-03-09 21:33       ` Benjamin Herrenschmidt
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=404E33A7.6070800@redhat.com \
    --to=drepper@redhat.com \
    --cc=benh@kernel.crashing.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