All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org, detaolb-devel@lists.sourceforge.net
Subject: Re: [Qemu-devel] ANN: DetaolB v0.4 is released
Date: Tue, 10 Jul 2007 15:42:25 -0400	[thread overview]
Message-ID: <200707101542.25709.rob@landley.net> (raw)
In-Reply-To: <f43fc5580707101130h9088ab4ibdf4768a907f8b1b@mail.gmail.com>

On Tuesday 10 July 2007 14:30:38 Blue Swirl wrote:
> > The sparc platform has a problem that if I boot with init as a "hello
> > world" program everything behaves as expected (there are two in the image
> > for testing purposes, /tools/bin/hello-dynamic and
> > /tools/bin/hello-static).  But if you boot with init=/tools/bin/bash it
> > hangs.  And so do the busybox shells.
>
> I think there is a problem with the dynamic loader, I get a bus error
> when running the programs on real Sparc.

Huh.  That's odd because hello-dynamic is using the dynamic loader.  (That's 
why there's a hello-dynamic and a hello-static.)

It's entirely possibly that qemu and real sparc hardware are behaving 
differently, but I'm not seeing this bus error under qemu.  (I haven't got 
real sparc hardware, so I can only debug against qemu...)

> If I try to run the dynamic loader, it reports on real HW as well as on
> Qemu: Standalone execution is not supported yet

The ability to run the dynamic loader as an executable and the ability to use 
it as a dynamic loader are two completely unrelated things on a modern Linux 
system.  The kernel doesn't _exec_ the library loader, it calls into it as a 
shared library.

In fact, under 2.4 if you ever mount any partitions with "noexec" you also 
need to remove the executable bit from the shared library loader, because 
otherwise you can just run the library loader and feed it any program to run 
and it'll do it for you.  (The library loader doesn't care about the noexec 
mount flag.)

Of course between 2.4 and 2.6 they added an extra check to the kernel so it 
refused to exec a program if the shared library loader that program refers to 
didn't have the executable bit set, for "security" reasons.  (And the glibc 
guys made ld-linux.so start checking the executable bit on libraries too.)  
This of course means that the old trick of removing the executable bit 
doesn't _work_ anymore, so mounting stuff "noexec" is essentially 
meaningless.  Oh well, it already was if you had something like "perl" on the 
system.  Or a command shell that could launch a shell script. :)

Note also that this is why uClibc includes its own "ldd", because the glibc 
one is just a wrapper that attempts to execute ld-linux.so with some 
debugging arguments to dump the library names.  So the glibc ldd doesn't work 
on uClibc binaries, because they're not linked against ld-linux.so.  The 
uClibc one works like readelf instead, and should work on anything.

But anyway, the ability to run a library loader as a command, and its ability 
to function _as_ a library loader, are totally unrelated.  Different entry 
points.

This talks about the issue in passing:
http://www.usenix.org/publications/library/proceedings/usenix98/freenix/record_html/lxrun-3.html

Rob
-- 
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

  reply	other threads:[~2007-07-10 19:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 23:58 [Qemu-devel] ANN: DetaolB v0.4 is released Christian MICHON
2007-06-30  7:47 ` Blue Swirl
2007-06-30 10:36   ` Johannes Schindelin
2007-06-30 10:51     ` Thiemo Seufer
2007-06-30 12:07       ` Christian MICHON
2007-06-30 17:15       ` Blue Swirl
2007-07-10 17:34         ` Rob Landley
2007-07-10 18:30           ` Blue Swirl
2007-07-10 19:42             ` Rob Landley [this message]
2007-07-11 11:17               ` Blue Swirl
2007-07-11 13:34                 ` [Detaolb-devel] " Christian MICHON
2007-07-11 14:20                   ` Christian MICHON
2007-07-11 17:33                   ` Rob Landley
2007-07-11 20:20                     ` Christian MICHON
2007-07-11 17:38                 ` Rob Landley
2007-07-11 20:26                   ` [Detaolb-devel] " Christian MICHON
2007-06-30 12:10     ` Christian MICHON
2007-07-04 18:30   ` Christian MICHON
2007-07-04 18:54     ` Blue Swirl
2007-07-04 19:45       ` Christian MICHON
2007-07-04 20:18         ` Blue Swirl
2007-07-04 20:30           ` Christian MICHON
2007-07-04 20:52             ` Blue Swirl
2007-07-04 21:04               ` Christian MICHON
2007-07-05 12:41                 ` Christian MICHON
2007-07-04 20:25         ` Andreas Färber
2007-07-04 20:32           ` Christian MICHON
2007-07-06 15:07             ` Rob Landley
2007-07-04 19:50     ` Cedric Hombourger
2007-07-04 19:54       ` Cedric Hombourger
2007-07-10 20:32         ` Bernhard Fischer
2007-07-10 20:36           ` Christian MICHON
2007-07-04 20:11       ` Christian MICHON
2007-07-05 19:23         ` Rob Landley
2007-07-05 20:28           ` Christian MICHON

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=200707101542.25709.rob@landley.net \
    --to=rob@landley.net \
    --cc=blauwirbel@gmail.com \
    --cc=detaolb-devel@lists.sourceforge.net \
    --cc=qemu-devel@nongnu.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.