From owner-freebsd-bugs Thu Mar 28 16:34:20 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA21608 for bugs-outgoing; Thu, 28 Mar 1996 16:34:20 -0800 (PST) Received: from xi.dorm.umd.edu (xi.dorm.umd.edu [129.2.152.45]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id QAA21603 for ; Thu, 28 Mar 1996 16:34:16 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by xi.dorm.umd.edu (8.7.4/8.6.12) with SMTP id TAA02679; Thu, 28 Mar 1996 19:33:22 -0500 (EST) Date: Thu, 28 Mar 1996 19:33:22 -0500 (EST) From: Sujal Patel X-Sender: smpatel@xi.dorm.umd.edu To: Joerg Wunsch cc: freebsd-bugs@freefall.freebsd.org Subject: Re: kern/1102: Differentiation of FreeBSD & Linux ELF binaries [patch] In-Reply-To: <199603280945.KAA24169@uriah.heep.sax.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Thu, 28 Mar 1996, J Wunsch wrote: > > Maybe I was a bit too tired when I wrote this patch, but I don't really > > think it's a good idea to let the kernel parse the environment :) > > Well, doesn't the execve() code have to copy the environment over to > the new address space anyway? This is true that the kernel brings it into kernel space, so parsing it is trivial. I was just pointing out that I don't think it's the kernel place to be doing this (should be done in libc). > I remember that Data General did some hacking in their ELF binaries to > differentiate between the ``ABI'' and ``DG/UX'' ELF binaries (where > they could use several optimizations if not using the m88k ABI). So i > figure there is some `flags' field inside ELF that can be (ab)used. > The question is: do Linux and SVR4 ELF binaries differentiate in any > way? (We could certainly differentiate our own binaries, but we'll > also have to determine 3rd party programs.) Without abusing some field (like the unused part of e_ident), I don't think there is any way to differentiate static binaries... There are some gross hacks to find out what OS compiled it, but none are really acceptable (even the way we determine what OS made dynamic binaries is kinda nasty, but there really is no other choice). Sujal