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

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


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