Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Mar 2001 15:13:12 -0800 (PST)
From:      Jim.Pirzyk@disney.com
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        obrien@freebsd.org
Subject:   bin/25498: file(1) does not determine what ELF ABI the file is
Message-ID:  <200103022313.f22NDCY74429@snoopy.fan.fa.disney.com>

next in thread | raw e-mail | index | archive | help

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 02 15:20:01 PST 2001
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103022313.f22NDCY74429>