Subject: bin/12295: file(1) gives inconsistent results for ELF vs a.out.
To: None <gnats-bugs@gnats.netbsd.org>
From: Charlie Root <root@polaris.garbled.net>
List: netbsd-bugs
Date: 02/27/2001 14:19:27
>Number:         12295
>Category:       bin
>Synopsis:       file(1) gives inconsistent results for ELF vs a.out.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 27 13:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Charlie Root
>Release:        1.5<NetBSD-current source date>
>Organization:
	
>Environment:
	
System: NetBSD polaris 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (POLARIS) #1: Wed Dec 13 00:45:28 MST 2000 root@polaris:/usr/src/sys/arch/i386/compile/POLARIS i386


>Description:
Recently.. attempting to determine if a given binary was a.out or ELF, I ran
file(1) on it, and got:
polaris# file /home/garbled/footest
/home/garbled/footest: NetBSD/i386 demand paged dynamically linked executable not stripped

This doesn't actually bother to tell me what format the binary is in, whereas
an ELF binary:
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1, statically linked, stripped
Does specifically mention ELF, but doesn't bother to tell me that it's a 
NetBSD binary.

I find both of these confusing..  The ELF case should say that it's a NetBSD
binary, and the a.out case should say a.out somewhere, not just infer that
it's a.out because it doesn't say ELF.
	
>How-To-Repeat:
use file(1) on various binaries.
	
>Fix:
Fix the output.  However, one should note that libtool and parts of bsd.pkg.mk
likely use file output for recognition of a.out vs ELF.
	
>Release-Note:
>Audit-Trail:
>Unformatted: