On 2023-04-06 01:37, Jan Engelhardt wrote:
ld.so _also_ has a dependency checker (at least for versioned symbols). It compares a program X's ".gnu.version_r" with libfoo.so.XYZ's ".gnu.version_d" section. rpm is just _reimplementing_ the same check on another level; when building packages, it essentially copies every ELF version_r and version_d entry to make RPM "Requires" and "Provides" out of it.
As I pointed out before, the ELF data doesn't indicate a minor version for the dependency, only the major version. *That* is the root of the problem. For libraries that don't provide versioned symbols (including glib2), there's nothing that indicates that g_string_free_and_steal became available in 2.76, and that is the minimum version required. So we'd either need to change rpm to build a dependency and provide on *every single symbol* in addition to the soname, or we need to provide another mechanism to version dependencies. (Or tell users to always update before installing a new package, and never selectively apply updates.)
So you want to add more logic to RPM's find-provides and find-requires code to add extra dependencies to .rpm files. But as shown above, RPM copies (some) version information from ELF to RPM anyway, so why don't we add the (newly sought) information to ELF binaries as well?
We don't need to add anything to the ELF binaries, they already have all of the information they need. That's why gimp and inkscape failed on launch and not later when they tried to use the missing function.
(One issue I recognize is that ELF-level symbol versions are evaluated using strict equality; ld.so would need to gain recognition for a ">=" operator.)
No, it doesn't. Versioned symbols work properly in both ELF and rpm's ELF dependency generator already. The problem affects libraries that don't provide versioned symbols (which is most of them).