[PATCH v2 0/1] bfd: add a mean to programatically detect a release version

Matthieu Longo matthieu.longo@arm.com
Mon Aug 18 14:53:07 GMT 2025


In a recent discussion around Object Attributes v2 [1], it appeared that we needed a way to detect whether a tool was built as a release version, or development version.

A previous patch (7b40f4c6587c) introduced this detection in gas. This patch reuses the same principle but moved the code into a utility function in bfd, so that gas, ld, and others can rely on it. It also adds a Tcl function 'is_release' that can be used with a '#target: ' directive to disable some tests relying on development-only features.

Regression tested on aarch64-unknown-linux-gnu in my OAv2 branch.

Regards,
Matthieu.

[1]: https://inbox.sourceware.org/binutils/20250715113924.57896-1-matthieu.longo@arm.com/T/#m8dae4e5a343ebcbef410f8369dab217087fe137b


Patch series v1: https://inbox.sourceware.org/binutils/20250814151629.174026-1-matthieu.longo@arm.com/
Diff with revision 1:
- add prefix bfd_ to is_release_version().
- fix typo in description.
- use POSIX version of "head -1".


Matthieu Longo (1):
  bfd: add a mean to programatically detect a release version

 bfd/bfd-in.h                               |  2 ++
 bfd/bfd-in2.h                              |  2 ++
 bfd/bfd.c                                  |  9 +++++++++
 binutils/testsuite/lib/binutils-common.exp | 13 +++++++++++++
 gas/as.c                                   |  2 +-
 5 files changed, 27 insertions(+), 1 deletion(-)

-- 
2.50.1



More information about the Binutils mailing list