On Thursday 2023-04-06 02:51, Gordon Messmer wrote:
On 2023-04-05 17:22, Jan Engelhardt wrote:
gimp: symbol lookup error: /lib64/libgegl-0.4.so.0: undefined symbol: g_string_free_and_steal
I don't think there's any evidence of corruption. Just a deficiency in rpm's ELF dependency generator that needs to be fixed.
*ld.so* stumbled over it and would stumble over it even if rpm was not in the picture. It is really a deficiency in the symbol map (especially because the programmer did not write any), or, in a sense, a deficiency in the static linker which did not add a stand-in map.
I think you're missing the point. [...] The problem is that the dependency on "libglib-2.0.so.0" only effectively communicates the major version of the library that is required, but in the case of this thread, the missing symbol was introduced in glib2 version 2.76. Without the minor version in the dependency data, rpm will mistakenly determine that the dependencies are satisfied.
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.
If glib2 used versioned symbols, then rpm would be able to actually determine the minimum version of glib2 that needs to be installed, but it doesn't. A better dependency generator (which I'm working on) would be able to provide enough information to indicate that at least version 2.76 of glib2 was required
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? (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.)