git: contrib/file: Fix the DragonFly ABI note version decoding
Aaron LI
aly at crater.dragonflybsd.org
Tue Nov 17 04:44:05 PST 2026
commit d7452fd7ddb079e66ca5546f9d1b6781d7212815
Author: Aaron LI <aly at aaronly.me>
Date: Tue Nov 17 20:38:59 2026 +0800
contrib/file: Fix the DragonFly ABI note version decoding
The ABI note stores __DragonFly_version, which is encoded as
major * 100000 + minor * 100 + rev. file(1) decoded the minor and bump
fields as major * 100000 + minor * 10000 + bump, so a 6.5.22 binary was
reported as "for DragonFly 6.0.522".
Fix the version decoding, similar to my previous patch to readelf(1) in
commit c0de80f6b41e2add4684d84fa92d7abb0fc9b656.
Before:
% file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /libexec/ld-elf.so.2, for DragonFly 6.0.522, stripped
After:
% file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /libexec/ld-elf.so.2, for DragonFly 6.5.22, stripped
Summary of changes:
contrib/file/README.DRAGONFLY | 5 +++--
contrib/file/src/readelf.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d7452fd7ddb079e66ca5546f9d1b6781d7212815
--
DragonFly BSD source repository
More information about the Commits
mailing list