upgrade of file(1) to 4.10 (including FreeBSD elf(5) fixes)

Oliver Eikemeier eikemeier at fillmore-labs.com
Tue Aug 3 11:29:56 PDT 2004

David O'Brien wrote:

> I really wish Christos had never added the code to *GUESS* at what
> FreeBSD version a binary was compiled on.

Everything what file(1) does is guesswork, nevertheless it is a great 

> The ELF binary format specification totally does NOT support the ability
> to do this.  file(1) makes GUESSES and has to use very FRAGILE
> HEURISTICS.  It is dependent on a totally optional ELF .note section I
> add to binaries (which isn't even guaranteed to be in a binary), and
> whose format could change in the future.

As usual, file(1) has to follow. Anyway, since it works for now, and 
currently there is no reason to break it, why is it bad? I actually like 
that feature, and it is useful for debugging ports that should have been 
recompiled after a system upgrade.

> file(1) will forever have trouble accurately determining the OS 
> version a
> program is compiled for.  So we will surely have these types of bugs in
> the foreseeable future.  I personally think the whole guessing code
> should just be removed from file(1) so we can get back to worrying about
> real bugs in FreeBSD.

As stated above: I consider this to be a useful feature. file(1) is 
great at guessing, even when it is wrong sometimes. We could document 
the format, when you are afraid it would be too dangerous to depend on 
something undocumented.


More information about the freebsd-current mailing list