dlopen-notes: make output stable regardless of order of inputs#56
Merged
Conversation
behrmann
approved these changes
Jun 5, 2026
behrmann
left a comment
There was a problem hiding this comment.
Looks reasonable to me, does what it says on the tin (current binaries from systemd main required): instead of eagerly throwing out priorities and having the last one win, because the dictionary is built at the end, build the whole mapping first and always update to the priority. It's a bit circumspect, because the dict gets built twice, as noted below, but it does the job.
When multiple files are passed to dlopen-notes --sonames the output depends on the order of inputs in case the same soname is used with different priorities across different binaries: $ ./dlopen-notes.py --sonames systemd-sbsign systemd-repart libblkid.so.1 required libcrypto.so.3 recommended libcryptsetup.so.12 recommended libfdisk.so.1 required libmount.so.1 required $ ./dlopen-notes.py --sonames systemd-repart systemd-sbsign libblkid.so.1 required libcrypto.so.3 required libcryptsetup.so.12 recommended libfdisk.so.1 required libmount.so.1 required sbsign requires libcrypto, and repart recommends it, so the output changes between required and recommended depending on which is passed last. Fix it so that the highest priority for any given soname is always returned, regardless of the number of input binaries.
behrmann
approved these changes
Jun 5, 2026
behrmann
left a comment
There was a problem hiding this comment.
Yep, that's what I meant. A bit more involved, but only builds the dictionary once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When multiple files are passed to dlopen-notes --sonames the output depends on the order of inputs in case the same soname is used with different priorities across different binaries:
sbsign requires libcrypto, and repart recommends it, so the output changes between required and recommended depending on which is passed last.
Fix it so that the highest priority for any given soname is always returned, regardless of the number of input binaries.