Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2000 21:37:54 -0500
From:      Marcel Moolenaar <marcel@cup.hp.com>
To:        janb@cs.utep.edu
Cc:        dmaddox@sc.rr.com, current@FreeBSD.ORG
Subject:   Re: Other Linux stuff...
Message-ID:  <3A246C02.8963917F@cup.hp.com>
References:  <Pine.GSO.4.30.0011281820460.24388-100000@gecko>

next in thread | previous in thread | raw e-mail | index | archive | help
janb@cs.utep.edu wrote:
> 
> > It's not a matter of our emulator. The problem is that Linux allows the
> > execution of shared objects. Technically speaking this is wrong and our
> > ELF loader doesn't do that. We can change our ELF loader, but that would
> 
> Could you elaborate on this, please. I am interested in what is meant with
> execution of shared objects (as opposed to programs). Why is this wrong?

Because the ELF file doesn't have the right attribute and therefore may
not have all the necessary information to execute it properly (such as
start address). In principle a shared object will have the same
structure as an executable in that both are loadable. So, from a pure
ELF layout point of view, both shared objects and executables are the
same. But a shared library is not guaranteed to be executable. Allowing
shared objects to be executed is in violation with the specs:

on FreeBSD:

gauss% ./libc.so.4
./libc.so.4: Permission denied.

on HP-UX (why not, it's accessable):

barra:marcel_as% ./libc.2
./libc.2: Exec format error. Binary file not executable.

on Linux:

[marcel@hpcll510 /lib]$ ./libc.so.6
GNU C Library stable release version 2.1.3, by Roland McGrath et al.
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99 Free Software Foundation,
Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version egcs-2.91.66 19990314/Linux (egcs-1.1.2
release).
Compiled on a Linux 2.2.14-1.5.0 system on 2000-02-29.
Available extensions:
        GNU libio by Per Bothner
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        BIND-4.9.7-REL
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        Glibc-2.0 compatibility add-on by Cristian Gafton 
        linuxthreads-0.8 by Xavier Leroy
        libthread_db work sponsored by Alpha Processor Inc
Report bugs using the `glibcbug' script to <bugs@gnu.org>.

And for a different library (still on Linux):

[marcel@hpcll510 /lib]$ ./libutil.so.1
Abort

-- 
Marcel Moolenaar
  mail: marcel@cup.hp.com / marcel@FreeBSD.org
  tel:  (408) 447-4222


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A246C02.8963917F>