From owner-cvs-src@FreeBSD.ORG Tue Nov 15 10:12:55 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FC2116A420; Tue, 15 Nov 2005 10:12:55 +0000 (GMT) (envelope-from nge@cs.hmc.edu) Received: from turing.cs.hmc.edu (turing.cs.hmc.edu [134.173.42.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9395443D49; Tue, 15 Nov 2005 10:12:54 +0000 (GMT) (envelope-from nge@cs.hmc.edu) Received: by turing.cs.hmc.edu (Postfix, from userid 26983) id 3E47E53231; Tue, 15 Nov 2005 02:12:54 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.cs.hmc.edu (Postfix) with ESMTP id 25E5A5A8DE; Tue, 15 Nov 2005 02:12:54 -0800 (PST) Date: Tue, 15 Nov 2005 02:12:53 -0800 (PST) From: Nate Eldredge X-X-Sender: nate@turing To: Alexander Leidinger In-Reply-To: <20051115103719.5c237st6o0gsckwg@netchild.homeip.net> Message-ID: References: <200511142224.jAEMO0RG057965@repoman.freebsd.org> <20051115103719.5c237st6o0gsckwg@netchild.homeip.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Olivier Houchard , cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern imgact_elf.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2005 10:12:55 -0000 On Tue, 15 Nov 2005, Alexander Leidinger wrote: > Olivier Houchard wrote: > >> cognet 2005-11-14 22:24:00 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/kern imgact_elf.c >> Log: >> Add a new sysctl, kern.elf[32|64].can_exec_dyn. When set to 1, one can >> execute a ET_DYN binary (shared object). >> This does not make much sense, but some linux scripts expect to be able to >> execute /lib/ld-linux.so.2 (ldd comes to mind). >> The sysctl defaults to 0. >> >> MFC after: 3 days > > Wait... wouldn't it be better to fix those scripts instead? Well you can't really, that's inherently how things like ldd work on Linux. I think it makes sense in a way: ld-linux.so.2 contains the code to resolve library dependencies, so if you want to know the dependencies you should ask that library. The GNU/Linux folks choose to execute the library binary directly (which ELF allows you to do, it can have its own special main()) rather than communicate with it via magic environment variables or something. This is arguably better because it can't interfere with environment variables that might be used for something else. So you can't avoid that unless you change the way ld-linux.so works, or write a whole new ldd, and always make sure it searches in exactly the same way as the loader. Neither of which is really in the spirit of emulation. There are some other libraries on Linux which are executable, like libc.so.6, but it only prints out its version info and build options when run. What I'm wondering is what's the point in making this a sysctl. What benefit is there in turning it off? If a library has this execution capability, why can't we just use it? -- Nate Eldredge nge@cs.hmc.edu