From owner-freebsd-hackers@FreeBSD.ORG  Sat Jan 23 14:38:11 2010
Return-Path: <owner-freebsd-hackers@FreeBSD.ORG>
Delivered-To: freebsd-hackers@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6192C106566C
	for <freebsd-hackers@freebsd.org>; Sat, 23 Jan 2010 14:38:11 +0000 (UTC)
	(envelope-from a_best01@uni-muenster.de)
Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE
	[128.176.192.15])
	by mx1.freebsd.org (Postfix) with ESMTP id A7BAF8FC15
	for <freebsd-hackers@freebsd.org>; Sat, 23 Jan 2010 14:38:10 +0000 (UTC)
X-IronPort-AV: E=Sophos;i="4.49,329,1262559600"; d="scan'208";a="234756187"
Received: from zivmaildisp1.uni-muenster.de (HELO
	ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85])
	by zivm-relay2.uni-muenster.de with ESMTP; 23 Jan 2010 15:38:08 +0100
Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459)
	id D12161B07BD; Sat, 23 Jan 2010 15:38:08 +0100 (CET)
Date: Sat, 23 Jan 2010 15:38:08 +0100 (CET)
From: Alexander Best <alexbestms@wwu.de>
Sender: <a_best01@uni-muenster.de>
Organization: Westfaelische Wilhelms-Universitaet Muenster
To: Kostik Belousov <kostikbel@gmail.com>
Message-ID: <permail-2010012314380880e26a0b00004e17-a_best01@message-id.uni-muenster.de>
In-Reply-To: <20100123133419.GI59590@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: freebsd-hackers@freebsd.org
Subject: Re: [patch] extending/completing brandelf's OS knowledge
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
	<freebsd-hackers.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, 
	<mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>,
	<mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Jan 2010 14:38:11 -0000

oh. i thought brandelf's purpose was to adjust an executable's OS ABI on a
general basis. an example would be having solaris executables with the OS ABI
set to 0. although freebsd won't support running these binaries brandelf could
be used to correct the OS ABI value which might come in handy if you're using
freebsd for backup purposes e.g.

or is this purpose covered by a different application in the base dir?

cheers.
alex

Kostik Belousov schrieb am 2010-01-23:
> On Sat, Jan 23, 2010 at 01:07:44PM +0100, Alexander Best wrote:
> > patch is pretty self explanatory i guess. brandelf should now be
> > able to
> > handle all OSes defined in the current SCO elf specs (26.10.2009).

> > cheers.
> > alex

> > Index: usr.bin/brandelf/brandelf.1
> > ===================================================================
> > --- usr.bin/brandelf/brandelf.1       (revision 202848)
> > +++ usr.bin/brandelf/brandelf.1       (working copy)
> > @@ -27,7 +27,7 @@
> >  .\"
> >  .\" $FreeBSD$
> >  .\"
> > -.Dd February 6, 1997
> > +.Dd January 23, 2010
> >  .Dt BRANDELF 1
> >  .Os
> >  .Sh NAME
> > @@ -62,10 +62,25 @@
> >  .Ar string
> >  ABI type.
> >  Currently supported ABIs are
> > +.Dq Li SVR4 ,
> > +.Dq Li HPUX ,
> > +.Dq Li NetBSD ,
> > +.Dq Li Linux ,
> > +.Dq Li Hurd ,
> > +.Dq Li 86Open ,
> > +.Dq Li Solaris ,
> > +.Dq Li AIX ,
> > +.Dq Li IRIX ,
> >  .Dq Li FreeBSD ,
> > -.Dq Li Linux ,
> > +.Dq Li TRU64 ,
> > +.Dq Li Modesto ,
> > +.Dq Li OpenBSD ,
> > +.Dq Li OpenVMS ,
> > +.Dq Li HPNSK ,
> > +.Dq Li AROS ,
> > +.Dq Li FenixOS
> >  and
> > -.Dq Li SVR4 .
> > +.Dq Li ARM .
> >  .It Ar file
> >  If
> >  .Fl t Ar string
> > @@ -95,7 +110,7 @@
> >  .Rs
> >  .%A The Santa Cruz Operation, Inc.
> >  .%T System V Application Binary Interface
> > -.%D April 29, 1998 (DRAFT)
> > +.%D October 26, 2009 (DRAFT)
> >  .%U http://www.sco.com/developer/devspecs/
> >  .Re
> >  .Sh HISTORY
> > Index: usr.bin/brandelf/brandelf.c
> > ===================================================================
> > --- usr.bin/brandelf/brandelf.c       (revision 202848)
> > +++ usr.bin/brandelf/brandelf.c       (working copy)
> > @@ -49,12 +49,25 @@
> >       const char *str;
> >       int value;
> >  };
> > -/* XXX - any more types? */
> >  static struct ELFtypes elftypes[] = {
> > -     { "FreeBSD",    ELFOSABI_FREEBSD },
> > +     { "SVR4",       ELFOSABI_NONE },
> > +     { "HPUX",       ELFOSABI_HPUX },
> > +     { "NetBSD",     ELFOSABI_NETBSD },
> >       { "Linux",      ELFOSABI_LINUX },
> > +     { "Hurd",       ELFOSABI_HURD },
> > +     { "86Open",     ELFOSABI_86OPEN },
> >       { "Solaris",    ELFOSABI_SOLARIS },
> > -     { "SVR4",       ELFOSABI_SYSV }
> > +     { "AIX",        ELFOSABI_AIX },
> > +     { "IRIX",       ELFOSABI_IRIX },
> > +     { "FreeBSD",    ELFOSABI_FREEBSD },
> > +     { "TRU64",      ELFOSABI_TRU64 },
> > +     { "Modesto",    ELFOSABI_MODESTO },
> > +     { "OpenBSD",    ELFOSABI_OPENBSD },
> > +     { "OpenVMS",    ELFOSABI_OPENVMS },
> > +     { "HPNSK",      ELFOSABI_NSK },
> > +     { "AROS",       ELFOSABI_AROS },
> > +     { "FenixOS",    ELFOSABI_FENIXOS },
> > +     { "ARM",        ELFOSABI_ARM }
> >  };

> >  int
> > Index: sys/sys/elf_common.h
> > ===================================================================
> > --- sys/sys/elf_common.h      (revision 202848)
> > +++ sys/sys/elf_common.h      (working copy)
> > @@ -113,6 +113,7 @@
> >  #define      ELFOSABI_OPENVMS        13      /* Open VMS */
> >  #define      ELFOSABI_NSK            14      /* HP Non-Stop Kernel
> >  */
> >  #define      ELFOSABI_AROS           15      /* Amiga Research OS
> >  */
> > +#define      ELFOSABI_FENIXOS        16      /* FenixOS */
> >  #define      ELFOSABI_ARM            97      /* ARM */
> >  #define      ELFOSABI_STANDALONE     255     /* Standalone
> >  (embedded) application */


> This does not make a sense. brandelf(1) is (was) used as a way to
> specify
> hint for the FreeBSD kernel under which ABI emulation the binary
> should
> be activated.

> We do not support, and I believe never will, ABIs added in the patch.