Add package metadata ELF note to binaries
If 'notes' is specified in DEB_BUILD_OPTIONS, add package metadata in the new .note.package ELF note using a specs file and the new --package-metadata switch that all linkers now support (bfd, gold, mold, lld).
For more details on the specification see:
https://systemd.io/COREDUMP_PACKAGE_METADATA/
Been doing this in src:systemd for a while, using dh-package-notes. This implementation is much simpler, as we've done the work to get the --package-notes
option upstreamed in all the linkers, so we no longer need temporary files, just a fixed specs file to include.
This is opt-in for now, so that we can test it. I intend to use it in src:systemd and a few other packages I maintain. If it works well, I intend to propose enabling by default for Trixie.
Fedora has been shipping this same feature enabled for all packages for the past couple of releases:
https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects
https://src.fedoraproject.org/rpms/package-notes