From Jim.Pirzyk@disney.com  Fri Mar  2 15:13:16 2001
Return-Path: <Jim.Pirzyk@disney.com>
Received: from mail.disney.com (mail.disney.com [204.128.192.15])
	by hub.freebsd.org (Postfix) with ESMTP
	id 0AB0337B71A; Fri,  2 Mar 2001 15:13:16 -0800 (PST)
	(envelope-from Jim.Pirzyk@disney.com)
Received: from pain10.corp.disney.com (root@pain10.corp.disney.com [153.7.110.100])
	by mail.disney.com (Switch-2.0.1/Switch-2.0.1) with SMTP id f22NCjc20196;
	Fri, 2 Mar 2001 15:12:46 -0800 (PST)
Received: from louie.fa.disney.com by pain.corp.disney.com with ESMTP; Fri, 2 Mar 2001 15:13:52 -0800
Received: from plio.fan.fa.disney.com (plio.fan.fa.disney.com [153.7.118.2])
	by louie.fa.disney.com (8.9.2/8.9.2) with ESMTP id PAA07832;
	Fri, 2 Mar 2001 15:13:13 -0800 (PST)
	(envelope-from Jim.Pirzyk@fa.disney.com)
Received: from snoopy.fan.fa.disney.com (snoopy.fan.fa.disney.com [153.7.117.170])
	by plio.fan.fa.disney.com (8.9.2/8.9.2) with ESMTP id PAA07298;
	Fri, 2 Mar 2001 15:13:12 -0800 (PST)
	(envelope-from Jim.Pirzyk@fa.disney.com)
Received: (from Jim.Pirzyk@localhost)
	by snoopy.fan.fa.disney.com (8.11.1/8.9.3) id f22NDCY74429;
	Fri, 2 Mar 2001 15:13:12 -0800 (PST)
	(envelope-from Jim.Pirzyk@fa.disney.com)
Message-Id: <200103022313.f22NDCY74429@snoopy.fan.fa.disney.com>
Date: Fri, 2 Mar 2001 15:13:12 -0800 (PST)
From: Jim.Pirzyk@disney.com
Reply-To: Jim.Pirzyk@disney.com
To: FreeBSD-gnats-submit@freebsd.org
Cc: obrien@freebsd.org
Subject: file(1) does not determine what ELF ABI the file is
X-Send-Pr-Version: 3.2

>Number:         25498
>Category:       bin
>Synopsis:       file(1) no longer recognizes the ABI of an ELF file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 02 15:20:01 PST 2001
>Closed-Date:    Fri Mar 2 18:36:28 PST 2001
>Last-Modified:  Fri Mar 02 18:37:49 PST 2001
>Originator:     Jim Pirzyk
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
>Environment:

	A stock FreeBSD 4.2-RELEASE system with Linux and FreeBSD binaries,
	and the brandelf command.

>Description:

	In FreeBSD 3.x systems, file would tell you what the ABI for an ELF file
	was.  It would look like this:

	foo: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripped

	Where the 'FreeBSD' string was branded in the binary by the brandelf
	command.  Now in FreeBSD 4.x systems, brandelf sets the 7th byte of
	the file to be 9, which means FreeBSD ABI, and does NOT put the 'FreeBSD'
	string into the file.  The file(1) command has not been updated to 
	reflect this change.  

>How-To-Repeat:

	On a FreeBSD ELF binary, run the file(1) command on it, the output would
	look like this:

	foo: ELF 32-bit LSB executable, Intel 80386, version 1 , dynamically linked, not stripped


>Fix:

*** ./usr.bin/file/Magdir/elf.orig	Thu Oct  8 18:43:08 1998
--- ./usr.bin/file/Magdir/elf	Fri Mar  2 14:54:57 2001
***************
*** 71,74 ****
  >>20	belong		0		invalid version
  >>20	belong		1		version 1
  >>36	belong		1		MathCoPro/FPU/MAU Required
! >8	string		>\0		(%s)
--- 71,87 ----
  >>20	belong		0		invalid version
  >>20	belong		1		version 1
  >>36	belong		1		MathCoPro/FPU/MAU Required
! #>7  byte           0         (SYSV)
! >7   byte           1         (HP-UX)
! >7   byte           2         (NetBSD)
! >7   byte           3         (GNU/Linux)
! >7   byte           4         (GNU/Hurd)
! >7   byte           5         (86Open)
! >7   byte           6         (Solaris)
! >7   byte           7         (Monterey)
! >7   byte           8         (IRIX)
! >7   byte           9         (FreeBSD)
! >7   byte           10        (Tru64)
! >7   byte           97        (ARM)
! >7   byte           255       (embedded)
! #>8	string		>\0		(%s)
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Fri Mar 2 18:36:28 PST 2001 
State-Changed-Why:  
FreeBSD now uses the stock standard file(1) implimentation from 
Christos Zoulas <christos@gw.com>.  This problem needs to be reported to 
him and it will enter the FreeBSD tree on his next update. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25498 
>Unformatted:
