public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Chris Friesen <cfriesen@nortel.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>,
	Andrew Morton <akpm@osdl.org>,
	James Bottomley <James.Bottomley@steeleye.com>,
	bapper@piratehaven.org, aaw@google.com
Subject: Re: RFC: bug in load_elf_binary?
Date: Fri, 14 Sep 2007 11:21:21 -0700	[thread overview]
Message-ID: <46EAD121.5080804@goop.org> (raw)
In-Reply-To: <46E9C6E4.5080102@nortel.com>

Chris Friesen wrote:
> I believe that's correct.  It's basically the equivalent of BSS, but
> used for an emulated OS (the app in question is an emulator).

Right.

>> Well, you could make the p_offset the same as the first segment with a
>> non-zero filesz.  That should satisfy the elf loader, though it might
>> still confuse things.
>
> Interesting idea.  Worth a try.
>
> However, this doesn't address the kernel side of things.  Am I correct
> in thinking that the kernel is making an invalid assumption that it
> can find the load_addr based on the first segment?

God, that code is such a tangle.  I'm not sure why it particularly cares
about the offset, though perhaps its making sure that (offset %
pagesize) == (vaddr % pagesize), which only matters for filesz>0.

It's not too surprising it falls over with more unconventional ELF files.

>> Why can't you create this mapping at runtime?
>
> Our emulated OS wants to put stuff at fixed addresses in this range,
> so we're trying to keep the loader from allocating stuff there before
> our program gets a chance to start up.

Hm, you might want to have a look at how valgrind gets itself started.

    J

      reply	other threads:[~2007-09-14 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-10 21:28 RFC: possible bug in load_elf_binary Chris Friesen
2007-09-12 18:36 ` RFC: bug in load_elf_binary? Chris Friesen
2007-09-13 22:00   ` Jeremy Fitzhardinge
2007-09-13 23:25     ` Chris Friesen
2007-09-14 18:21       ` Jeremy Fitzhardinge [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=46EAD121.5080804@goop.org \
    --to=jeremy@goop.org \
    --cc=James.Bottomley@steeleye.com \
    --cc=aaw@google.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=bapper@piratehaven.org \
    --cc=cfriesen@nortel.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