Linux-kernel mailing list archive 1998-31,: Re: execve("libm.so") -> SIGSEGV instead of ENOEXEC.

# Re: execve("libm.so") -> SIGSEGV instead of ENOEXEC.

Ulrich Drepper (drepper@cygnus.com)
03 Aug 1998 09:51:11 -0700

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Rafael Reilova: "Re: kernel compile time comparison (2.0 vs 2.1 with 64MB)"
- Previous message: MOLNAR Ingo: "Re: kernel compile time comparison (2.0 vs 2.1 with 64MB)"
- In reply to: Tigran Aivazian: "execve("libm.so") -> SIGSEGV instead of ENOEXEC."

Tigran Aivazian <tigran@sco.COM> writes:

> An attempt to exec() a shared library causes SIGSEGV. I thought the only
> two things you can do to a shared library is to dlopen() it or link with
> it dynamically. So, I assume trying to execve(2) it is illegal and hence
> it should return an error, perhaps ENOEXEC.

It's not illegal. A shared library (as you call it) is in fact a
dynamic binary. It can be executed and in the case of glibc also must
be executable. Not all shared objects are prepared for this, though.
If somebody nevertheless tries it SEGV is the right response.

    --
    ---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
    Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
    Cygnus Solutions `--' drepper at cygnus.com   `------------------------

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

- Next message: Rafael Reilova: "Re: kernel compile time comparison (2.0 vs 2.1 with 64MB)"
- Previous message: MOLNAR Ingo: "Re: kernel compile time comparison (2.0 vs 2.1 with 64MB)"
- In reply to: Tigran Aivazian: "execve("libm.so") -> SIGSEGV instead of ENOEXEC."